workaround [#24958] Cloth pinning not working
authorCampbell Barton <ideasman42@gmail.com>
Wed, 1 Dec 2010 05:59:11 +0000 (05:59 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 1 Dec 2010 05:59:11 +0000 (05:59 +0000)
detailed explanation as to why this is needed in report.

source/blender/blenkernel/intern/cloth.c

index f8772cd802fffc5341285cb2bf521a25467a866f..946d03d388a3ea0d9db0198559e5148f03946f90 100644 (file)
@@ -447,6 +447,11 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob,
                return dm;
        }
 
+       /* XXX, workaround for bug [#24958], see report for more info */
+       if(CustomData_has_layer(&dm->vertData, CD_MDEFORMVERT) && !CustomData_has_layer(&result->vertData, CD_MDEFORMVERT)) {
+               DM_add_vert_layer(result, CD_MDEFORMVERT, CD_DUPLICATE, dm->getVertDataArray(dm, CD_MDEFORMVERT));
+       }
+
        if(clmd->sim_parms->reset
                || (framenr == (startframe - clmd->sim_parms->preroll) && clmd->sim_parms->preroll != 0)
                || (clmd->clothObject && result->getNumVerts(result) != clmd->clothObject->numverts))