Merge branch 'master' into blender2.8
[blender.git] / source / blender / alembic / intern / abc_mesh.cc
index de0ed421eb762c048beca96a3c3851c3a424004c..fa2bbb8dfc38aee326e77423763aabcad04c706a 100644 (file)
@@ -358,6 +358,11 @@ bool AbcMeshWriter::isAnimated() const
        return me->adt != NULL;
 }
 
+void AbcMeshWriter::setIsAnimated(bool is_animated)
+{
+       m_is_animated = is_animated;
+}
+
 void AbcMeshWriter::do_write()
 {
        /* We have already stored a sample for this object. */
@@ -1076,7 +1081,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,