Fix #27480: armature multimodifier was not working in edit mode.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 26 May 2011 10:21:09 +0000 (10:21 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 26 May 2011 10:21:09 +0000 (10:21 +0000)
source/blender/modifiers/intern/MOD_armature.c

index 95579147dbbec0c6788001a14b1d30d339f05119..a0ee047e31921711c5a601409e5498bf35e9e16c 100644 (file)
@@ -127,8 +127,8 @@ static void deformVerts(ModifierData *md, Object *ob,
        modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */
        
        armature_deform_verts(amd->object, ob, derivedData, vertexCos, NULL,
-                                 numVerts, amd->deformflag, 
-        (float(*)[3])amd->prevCos, amd->defgrp_name);
+               numVerts, amd->deformflag, (float(*)[3])amd->prevCos, amd->defgrp_name);
+
        /* free cache */
        if(amd->prevCos) {
                MEM_freeN(amd->prevCos);
@@ -145,8 +145,16 @@ static void deformVertsEM(
 
        if(!derivedData) dm = CDDM_from_editmesh(editData, ob->data);
 
-       armature_deform_verts(amd->object, ob, dm, vertexCos, NULL, numVerts,
-                                 amd->deformflag, NULL, amd->defgrp_name);
+       modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */
+
+       armature_deform_verts(amd->object, ob, dm, vertexCos, NULL,
+               numVerts, amd->deformflag, (float(*)[3])amd->prevCos, amd->defgrp_name);
+
+       /* free cache */
+       if(amd->prevCos) {
+               MEM_freeN(amd->prevCos);
+               amd->prevCos= NULL;
+       }
 
        if(!derivedData) dm->release(dm);
 }