Reverted copying mesh->runtime.deformed_only in CDDM_from_mesh_ex
authorSybren A. Stüvel <sybren@stuvel.eu>
Wed, 16 May 2018 11:06:54 +0000 (13:06 +0200)
committerSybren A. Stüvel <sybren@stuvel.eu>
Wed, 16 May 2018 11:06:57 +0000 (13:06 +0200)
Doing that copy is the right thing, but only if the mesh has its own
deformed_only flag set correctly. This isn't generally the case, so
keeping dm->deformedOnly = 1 is better.

source/blender/blenkernel/intern/cdderivedmesh.c

index e585c4ca666b3a6ed42a094e98ec0bc3698079e4..b77582b7ec3c7304d5ed5d09c6e0ac6fb0368565 100644 (file)
@@ -608,7 +608,10 @@ DerivedMesh *CDDM_from_mesh_ex(Mesh *mesh, int alloctype)
        DM_init(dm, DM_TYPE_CDDM, mesh->totvert, mesh->totedge, 0 /* mesh->totface */,
                mesh->totloop, mesh->totpoly);
 
-       dm->deformedOnly = mesh->runtime.deformed_only;
+       /* This should actually be dm->deformedOnly = mesh->runtime.deformed_only,
+        * but only if the original mesh had its deformed_only flag correctly set
+        * (which isn't generally the case). */
+       dm->deformedOnly = 1;
        dm->cd_flag = mesh->cd_flag;
 
        if (mesh->runtime.cd_dirty_vert & CD_MASK_NORMAL) {