[Bf-blender-cvs] [0012d54a70a] master: Alembic import: fixed mesh corruption when changing topology
Sybren A. Stüvel
noreply at git.blender.org
Sun Oct 29 15:13:34 CET 2017
Commit: 0012d54a70ac1dcd83531a32d1fe3ab017034e4b
Author: Sybren A. Stüvel
Date: Sun Oct 29 13:55:42 2017 +0100
Branches: master
https://developer.blender.org/rB0012d54a70ac1dcd83531a32d1fe3ab017034e4b
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.
===================================================================
M source/blender/alembic/intern/abc_mesh.cc
===================================================================
diff --git a/source/blender/alembic/intern/abc_mesh.cc b/source/blender/alembic/intern/abc_mesh.cc
index 6545ced8e4a..36b134f8b0c 100644
--- a/source/blender/alembic/intern/abc_mesh.cc
+++ b/source/blender/alembic/intern/abc_mesh.cc
@@ -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,
More information about the Bf-blender-cvs
mailing list