fix T50004: Removed check for empty mesh and adjusted the vertex import function to accept meshes without vertices as well
This commit is contained in:
parent
4151f12713
commit
447fc7c4ce
Notes:
blender-bot
2023-02-14 07:25:44 +01:00
Referenced by issue #50004, No empty Collada mesh import possible
|
@ -317,11 +317,6 @@ bool MeshImporter::is_nice_mesh(COLLADAFW::Mesh *mesh) // checks if mesh has su
|
|||
}
|
||||
}
|
||||
|
||||
if (mesh->getPositions().empty()) {
|
||||
fprintf(stderr, "ERROR: Mesh %s has no vertices.\n", name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -329,11 +324,15 @@ void MeshImporter::read_vertices(COLLADAFW::Mesh *mesh, Mesh *me)
|
|||
{
|
||||
// vertices
|
||||
COLLADAFW::MeshVertexData& pos = mesh->getPositions();
|
||||
if (pos.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
int stride = pos.getStride(0);
|
||||
if (stride == 0) stride = 3;
|
||||
|
||||
me->totvert = mesh->getPositions().getFloatValues()->getCount() / stride;
|
||||
me->mvert = (MVert *)CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC, NULL, me->totvert);
|
||||
|
||||
me->totvert = pos.getFloatValues()->getCount() / stride;
|
||||
me->mvert = (MVert *)CustomData_add_layer(&me->vdata, CD_MVERT, CD_CALLOC, NULL, me->totvert);
|
||||
|
||||
MVert *mvert;
|
||||
int i;
|
||||
|
|
Loading…
Reference in New Issue