diff options
-rw-r--r-- | source/blender/editors/transform/transform.c | 6 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 16 |
2 files changed, 17 insertions, 5 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index f3306caa931..c15c8aefddf 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -825,11 +825,15 @@ static void transform_event_xyz_constraint(TransInfo *t, short key_type, bool is } } else if (!edit_2d) { - if (ELEM(cmode, '\0', axis)) { + if (cmode == 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 e4063c055d6..9d94d229b25 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1681,13 +1681,21 @@ 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) { - t->orientation.index = 1; + if (orient_type_constraint == V3D_ORIENT_GLOBAL) { + t->orientation.index = 1; + } + else { + t->orientation.index = 2; + } } } |