fix [#28788] Scale using "Individual origins" in bones
authorCampbell Barton <ideasman42@gmail.com>
Sun, 2 Oct 2011 19:57:34 +0000 (19:57 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 2 Oct 2011 19:57:34 +0000 (19:57 +0000)
works for rotate and scale

source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_conversions.c

index 8699bc886456fdb1bbb15bc27271c08bd29f6c7d..898785fd120d47e25da4cf0598f924eb91918930 100644 (file)
@@ -2612,7 +2612,9 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) {
                }
                else if (t->flag & T_EDIT) {
 
-                       if(t->settings->selectmode & SCE_SELECT_FACE) {
+                       if(     (t->settings->selectmode & SCE_SELECT_FACE) ||
+                               (t->obedit && t->obedit->type == OB_ARMATURE))
+                       {
                                copy_v3_v3(center, td->center);
                        }
                        else {
@@ -2902,10 +2904,10 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
 
        /* local constraint shouldn't alter center */
        if (around == V3D_LOCAL) {
-               if (t->flag & (T_OBJECT|T_POSE)) {
-                       center = td->center;
-               }
-               else if (t->settings->selectmode & SCE_SELECT_FACE) {
+               if (    (t->flag & (T_OBJECT|T_POSE)) ||
+                       (t->settings->selectmode & SCE_SELECT_FACE) ||
+                       (t->obedit && t->obedit->type == OB_ARMATURE))
+               {
                        center = td->center;
                }
        }
index c3a249d69bc65d6c1582df1cbf2bcd4a1ed89de3..e37435a0cd51684f4cc8f1aa5c2e742c96f4e6e6 100644 (file)
@@ -1194,7 +1194,7 @@ static void createTransArmatureVerts(TransInfo *t)
                                if (ebo->flag & BONE_TIPSEL)
                                {
                                        copy_v3_v3(td->iloc, ebo->tail);
-                                       copy_v3_v3(td->center, td->iloc);
+                                       copy_v3_v3(td->center, (t->around==V3D_LOCAL) ? ebo->head : td->iloc);
                                        td->loc= ebo->tail;
                                        td->flag= TD_SELECTED;
                                        if (ebo->flag & BONE_EDITMODE_LOCKED)