MCPcopy Create free account
hub / github.com/defold/defold / LoadMeshes

Function LoadMeshes

engine/modelc/src/modelimporter_gltf.cpp:1144–1157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1142}
1143
1144static void LoadMeshes(Scene* scene, cgltf_data* gltf_data)
1145{
1146 InitSize(scene->m_Models, gltf_data->meshes_count, gltf_data->meshes_count);
1147
1148 for (uint32_t i = 0; i < gltf_data->meshes_count; ++i)
1149 {
1150 cgltf_mesh* gltf_mesh = &gltf_data->meshes[i]; // our "Model"
1151 Model* model = &scene->m_Models[i];
1152 model->m_Name = DuplicateObjectName(gltf_mesh);
1153 model->m_Index = i;
1154
1155 LoadPrimitives(scene, model, gltf_data, gltf_mesh); // Our "Meshes"
1156 }
1157}
1158
1159
1160// If the mesh wasn't skinned, but uses same material as other skinned meshes, we need to create a duplicate

Callers 1

LoadSceneFunction · 0.85

Calls 3

InitSizeFunction · 0.85
DuplicateObjectNameFunction · 0.85
LoadPrimitivesFunction · 0.85

Tested by

no test coverage detected