diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2021-02-04 16:43:57 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2021-02-04 16:43:57 +0300 |
commit | 760a16b88b51eee160a24b697472ec53bb452da4 (patch) | |
tree | 3444260cbcd93fd5c13901b121ee323ca6de9a3a /source/blender/editors/transform/transform_generics.c | |
parent | bec08621d60771c2464d9ee20d679c7d202bd9e1 (diff) |
Fix for 3D view transform: flipped rotation direction for numeric input
The rotation direction was flipped recently.
This meant that rotation on a single axis gave negative results compared
with previous Blender releases.
This partially reverts a9b53daf23ba8b6cb4c930e06154ffd35522b00d.
Differential Revision: https://developer.blender.org/D10299
Diffstat (limited to 'source/blender/editors/transform/transform_generics.c')
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index f648369bc31..b092b3e3e0b 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -428,7 +428,6 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve BLI_assert(is_zero_v4(t->values_modal_offset)); - bool use_orient_axis = false; bool t_values_set_is_array = false; if (op && (prop = RNA_struct_find_property(op->ptr, "value")) && @@ -453,11 +452,6 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve } } - if (op && (prop = RNA_struct_find_property(op->ptr, "orient_axis"))) { - t->orient_axis = RNA_property_enum_get(op->ptr, prop); - use_orient_axis = true; - } - if (op && (prop = RNA_struct_find_property(op->ptr, "constraint_axis"))) { bool constraint_axis[3] = {false, false, false}; if (t->flag & T_INPUT_IS_VALUES_FINAL) { @@ -466,9 +460,6 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve * orientation is more intuitive in the Redo Panel. */ constraint_axis[0] = constraint_axis[1] = constraint_axis[2] = true; } - else if (use_orient_axis) { - constraint_axis[t->orient_axis] = true; - } } else if (RNA_property_is_set(op->ptr, prop)) { RNA_property_boolean_get_array(op->ptr, prop, constraint_axis); @@ -497,6 +488,8 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve short orient_type_set = V3D_ORIENT_GLOBAL; short orient_type_matrix_set = -1; + bool use_orient_axis = false; + if ((t->spacetype == SPACE_VIEW3D) && (t->region->regiontype == RGN_TYPE_WINDOW)) { TransformOrientationSlot *orient_slot = &t->scene->orientation_slots[SCE_ORIENT_DEFAULT]; orient_type_scene = orient_slot->type; @@ -508,6 +501,11 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve short orient_type_default = orient_type_scene; + if (op && (prop = RNA_struct_find_property(op->ptr, "orient_axis"))) { + t->orient_axis = RNA_property_enum_get(op->ptr, prop); + use_orient_axis = true; + } + if (op && (prop = RNA_struct_find_property(op->ptr, "orient_axis_ortho"))) { t->orient_axis_ortho = RNA_property_enum_get(op->ptr, prop); } |