diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2020-05-07 22:51:30 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2020-05-07 22:51:51 +0300 |
commit | b5eeef834f5d59c081ff15a5b8a01d414c6d8e1d (patch) | |
tree | dc08cc6733c932fa65cb9a325b3d31501246ec2f /source/blender/editors/transform/transform.c | |
parent | 2f63e479313332756d0879b841527a31fa1d30b3 (diff) |
Fix direction of the Gizmo Extrude adjustment axis
The extrude adjustment gizmo reads the last constrained axis set.
So it is important to keep the final value actually used.
Diffstat (limited to 'source/blender/editors/transform/transform.c')
-rw-r--r-- | source/blender/editors/transform/transform.c | 61 |
1 files changed, 11 insertions, 50 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index c15c8aefddf..6ff3826da09 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1740,38 +1740,26 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) !RNA_property_is_set(op->ptr, prop))) { /* Set the first time to register on redo. */ RNA_property_enum_set(op->ptr, prop, orient_set); - - if (((prop = RNA_struct_find_property(op->ptr, "orient_matrix")) && - !RNA_property_is_set(op->ptr, prop))) { - RNA_float_set_array(op->ptr, "orient_matrix", &t->spacemtx[0][0]); - } + RNA_float_set_array(op->ptr, "orient_matrix", &t->spacemtx[0][0]); } } if ((prop = RNA_struct_find_property(op->ptr, "constraint_axis"))) { bool constraint_axis[3] = {false, false, false}; - if (t->idx_max == 0) { - if (t->con.mode & CON_APPLY) { - if (t->con.mode & CON_AXIS0) { - constraint_axis[0] = true; - } - if (t->con.mode & CON_AXIS1) { - constraint_axis[1] = true; - } - if (t->con.mode & CON_AXIS2) { - constraint_axis[2] = true; - } - RNA_property_boolean_set_array(op->ptr, prop, constraint_axis); + if (t->con.mode & CON_APPLY) { + if (t->con.mode & CON_AXIS0) { + constraint_axis[0] = true; } - else { - RNA_property_unset(op->ptr, prop); + if (t->con.mode & CON_AXIS1) { + constraint_axis[1] = true; + } + if (t->con.mode & CON_AXIS2) { + constraint_axis[2] = true; } + RNA_property_boolean_set_array(op->ptr, prop, constraint_axis); } else { - constraint_axis[0] = true; - constraint_axis[1] = true; - constraint_axis[2] = true; - RNA_property_boolean_set_array(op->ptr, prop, constraint_axis); + RNA_property_unset(op->ptr, prop); } } @@ -2028,33 +2016,6 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve calculatePropRatio(t); calculateCenter(t); - /* Overwrite initial values if operator supplied a non-null vector. - * - * Run before init functions so 'values_modal_offset' can be applied on mouse input. - */ - BLI_assert(is_zero_v4(t->values_modal_offset)); - if ((prop = RNA_struct_find_property(op->ptr, "value")) && RNA_property_is_set(op->ptr, prop)) { - float values[4] = {0}; /* in case value isn't length 4, avoid uninitialized memory */ - - if (RNA_property_array_check(prop)) { - RNA_float_get_array(op->ptr, "value", values); - } - else { - values[0] = RNA_float_get(op->ptr, "value"); - } - - copy_v4_v4(t->values, values); - - if (t->flag & T_MODAL) { - copy_v4_v4(t->values_modal_offset, values); - t->redraw = TREDRAW_HARD; - } - else { - copy_v4_v4(t->values, values); - t->flag |= T_INPUT_IS_VALUES_FINAL; - } - } - if (event) { /* Initialize accurate transform to settings requested by keymap. */ bool use_accurate = false; |