Fix #26324: proportional editing and armature applied to editing cage during edit...
authorSergey Sharybin <sergey.vfx@gmail.com>
Sun, 6 Mar 2011 17:03:25 +0000 (17:03 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sun, 6 Mar 2011 17:03:25 +0000 (17:03 +0000)
Not sure why proportional editing used to disable crazyspace corrections,
but from that time hwn it was done transform stuff was changed a lot.
I've made several tests (with file from report and sintel from durian
data files) and it worked nice.

source/blender/editors/transform/transform_conversions.c

index 9a70ec2f3be0f3efdb72d47db2863ff517f96339..84392b1c3ccc8329f37a28a9cee5c78a398ac9e2 100644 (file)
@@ -2056,27 +2056,25 @@ static void createTransEditVerts(bContext *C, TransInfo *t)
        if(propmode) editmesh_set_connectivity_distance(em, mtx);
 
        /* detect CrazySpace [tm] */
-       if(propmode==0) {
-               if(modifiers_getCageIndex(t->scene, t->obedit, NULL, 1)>=0) {
-                       if(modifiers_isCorrectableDeformed(t->obedit)) {
-                               /* check if we can use deform matrices for modifier from the
-                                  start up to stack, they are more accurate than quats */
-                               totleft= editmesh_get_first_deform_matrices(t->scene, t->obedit, em, &defmats, &defcos);
-
-                               /* if we still have more modifiers, also do crazyspace
-                                  correction with quats, relative to the coordinates after
-                                  the modifiers that support deform matrices (defcos) */
-                               if(totleft > 0) {
-                                       mappedcos= crazyspace_get_mapped_editverts(t->scene, t->obedit);
-                                       quats= MEM_mallocN( (t->total)*sizeof(float)*4, "crazy quats");
-                                       crazyspace_set_quats_editmesh(em, (float*)defcos, mappedcos, quats);
-                                       if(mappedcos)
-                                               MEM_freeN(mappedcos);
-                               }
-
-                               if(defcos)
-                                       MEM_freeN(defcos);
+       if(modifiers_getCageIndex(t->scene, t->obedit, NULL, 1)>=0) {
+               if(modifiers_isCorrectableDeformed(t->obedit)) {
+                       /* check if we can use deform matrices for modifier from the
+                          start up to stack, they are more accurate than quats */
+                       totleft= editmesh_get_first_deform_matrices(t->scene, t->obedit, em, &defmats, &defcos);
+
+                       /* if we still have more modifiers, also do crazyspace
+                          correction with quats, relative to the coordinates after
+                          the modifiers that support deform matrices (defcos) */
+                       if(totleft > 0) {
+                               mappedcos= crazyspace_get_mapped_editverts(t->scene, t->obedit);
+                               quats= MEM_mallocN( (t->total)*sizeof(float)*4, "crazy quats");
+                               crazyspace_set_quats_editmesh(em, (float*)defcos, mappedcos, quats);
+                               if(mappedcos)
+                                       MEM_freeN(mappedcos);
                        }
+
+                       if(defcos)
+                               MEM_freeN(defcos);
                }
        }