Fix T37143: Wrong normal dir with individual origins + one vert selected
authorCampbell Barton <ideasman42@gmail.com>
Thu, 28 Nov 2013 08:23:05 +0000 (19:23 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 28 Nov 2013 08:59:26 +0000 (19:59 +1100)
source/blender/editors/transform/transform_constraints.c

index 4ba87eb8c399ee09461f287f6916bae2ff4038be..894145c9e9dd8515f6c5922fef669c2953c1c8bc 100644 (file)
@@ -576,7 +576,15 @@ void setConstraint(TransInfo *t, float space[3][3], int mode, const char text[])
 void setAxisMatrixConstraint(TransInfo *t, int mode, const char text[])
 {
        if (t->total == 1) {
-               setConstraint(t, t->data->axismtx, mode, text);
+               float axismtx[3][3];
+               if (t->flag & T_EDIT) {
+                       mul_m3_m3m3(axismtx, t->obedit_mat, t->data->axismtx);
+               }
+               else {
+                       copy_m3_m3(axismtx, t->data->axismtx);
+               }
+
+               setConstraint(t, axismtx, mode, text);
        }
        else {
                BLI_strncpy(t->con.text + 1, text, sizeof(t->con.text) - 1);