[Bf-blender-cvs] [b026965f80c] master: Revert "Fix T76504: Change in behavior of constraints orientation"

Germano Cavalcante noreply at git.blender.org
Mon May 11 18:55:27 CEST 2020


Commit: b026965f80c7e1beabbf4310af83af66c5b04e45
Author: Germano Cavalcante
Date:   Mon May 11 13:43:29 2020 -0300
Branches: master
https://developer.blender.org/rBb026965f80c7e1beabbf4310af83af66c5b04e45

Revert "Fix T76504: Change in behavior of constraints orientation"

This reverts commit 2f63e479313332756d0879b841527a31fa1d30b3.

===================================================================

M	source/blender/editors/transform/transform.c
M	source/blender/editors/transform/transform_generics.c

===================================================================

diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 6ff3826da09..6ce006a0f81 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -825,15 +825,11 @@ static void transform_event_xyz_constraint(TransInfo *t, short key_type, bool is
       }
     }
     else if (!edit_2d) {
-      if (cmode == axis) {
+      if (ELEM(cmode, '\0', axis)) {
         /* Successive presses on existing axis, cycle orientation modes. */
         t->orientation.index = (t->orientation.index + 1) % ARRAY_SIZE(t->orientation.types);
         initTransformOrientation(t->context, t, t->orientation.types[t->orientation.index]);
       }
-      else if (t->orientation.index != 1) {
-        t->orientation.index = 1;
-        initTransformOrientation(t->context, t, t->orientation.types[t->orientation.index]);
-      }
 
       if (t->orientation.index == 0) {
         stopConstraint(t);
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 23f1295db3e..300186e2ecb 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -1719,21 +1719,13 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
     }
 
     t->orientation.types[0] = orient_type_default;
+    t->orientation.types[1] = orient_type_constraint;
+    t->orientation.types[2] = orient_type_constraint != V3D_ORIENT_GLOBAL ? V3D_ORIENT_GLOBAL :
+                                                                            V3D_ORIENT_LOCAL;
     t->orientation.custom = custom_orientation;
 
-    /* To keep the old behavior logic to init contraint orientarions became this: */
-    t->orientation.types[1] = V3D_ORIENT_GLOBAL;
-    t->orientation.types[2] = orient_type_constraint != V3D_ORIENT_GLOBAL ?
-                                  orient_type_constraint :
-                                  V3D_ORIENT_LOCAL;
-
     if (t->con.mode & CON_APPLY) {
-      if (orient_type_constraint == V3D_ORIENT_GLOBAL) {
-        t->orientation.index = 1;
-      }
-      else {
-        t->orientation.index = 2;
-      }
+      t->orientation.index = 1;
     }
   }



More information about the Bf-blender-cvs mailing list