Fox #31185: Cannot sculpt shape keys
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 1 May 2012 12:14:44 +0000 (12:14 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 1 May 2012 12:14:44 +0000 (12:14 +0000)
Was related on sculpting on locked keys. Issue was caused by building
PBVH from base mesh which is now doesn't have shape key loaded into
it as it was in 2.62.

Fixed by loading coordinates from deformed mesh into PBVH like it
happens for on-locked shape keys.

source/blender/blenkernel/intern/cdderivedmesh.c

index 6ff612e3367d7b401ae7bea68534cc3a53149c66..2bf199cb47fd416e5d198bcecc0477c72c21b927 100644 (file)
@@ -267,6 +267,8 @@ static struct PBVH *cdDM_getPBVH(Object *ob, DerivedMesh *dm)
        if (!cddm->pbvh && ob->type == OB_MESH) {
                SculptSession *ss= ob->sculpt;
                Mesh *me= ob->data;
+               int deformed = 0;
+
                cddm->pbvh = BLI_pbvh_new();
                cddm->pbvh_draw = can_pbvh_draw(ob, dm);
 
@@ -275,7 +277,9 @@ static struct PBVH *cdDM_getPBVH(Object *ob, DerivedMesh *dm)
                BLI_pbvh_build_mesh(cddm->pbvh, me->mface, me->mvert,
                                    me->totface, me->totvert);
 
-               if (ss->modifiers_active && ob->derivedDeform) {
+               deformed = ss->modifiers_active || me->key;
+
+               if (deformed && ob->derivedDeform) {
                        DerivedMesh *deformdm= ob->derivedDeform;
                        float (*vertCos)[3];
                        int totvert;