Alembic import: fixed mesh corruption when changing topology
When the mesh changed topology but kept the vertex count the same, it would result in a corrupt mesh. By checking the face & loop counts too, this has become less likely. I've checked IPolyMeshSchema::isConstant(), but it returns true even when we see that the mesh changed topology.
This commit is contained in:
parent
02bac54fa9
commit
bae796f0d5
|
@ -1082,7 +1082,10 @@ DerivedMesh *AbcMeshReader::read_derivedmesh(DerivedMesh *dm,
|
|||
ImportSettings settings;
|
||||
settings.read_flag |= read_flag;
|
||||
|
||||
if (dm->getNumVerts(dm) != positions->size()) {
|
||||
bool topology_changed = positions->size() != dm->getNumVerts(dm) ||
|
||||
face_counts->size() != dm->getNumPolys(dm) ||
|
||||
face_indices->size() != dm->getNumLoops(dm);
|
||||
if (topology_changed) {
|
||||
new_dm = CDDM_from_template(dm,
|
||||
positions->size(),
|
||||
0,
|
||||
|
|
Loading…
Reference in New Issue