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:
Sybren A. Stüvel 2017-10-29 13:55:42 +01:00
parent ab2d1f61a8
commit 0012d54a70
Notes: blender-bot 2023-02-14 06:17:20 +01:00
Referenced by issue #53683, 2.79a release
1 changed files with 4 additions and 1 deletions

View File

@ -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,