Fix: Collada import assert with faceless prims #120738

Merged
Philipp Oeser merged 1 commits from lichtwerk/blender:120721_b into main 2024-04-17 14:22:09 +02:00
1 changed files with 4 additions and 4 deletions

View File

@ -642,6 +642,10 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh,
int collada_meshtype = mp->getPrimitiveType();
if (collada_meshtype == COLLADAFW::MeshPrimitive::LINES) {
continue; /* read the lines later after all the rest is done */
}
/* Since we cannot set `poly->mat_nr` here, we store a portion of `mesh->mpoly` in Primitive.
*/
Primitive prim = {face_index, &material_indices.span[face_index], 0};
@ -793,10 +797,6 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh,
}
}
else if (collada_meshtype == COLLADAFW::MeshPrimitive::LINES) {
continue; /* read the lines later after all the rest is done */
}
if (mp_has_faces) {
mat_prim_map[mp->getMaterialId()].push_back(prim);
}