diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-06 10:08:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-06 10:11:26 +0300 |
commit | 3b1e2a4f5657b88c3d2bd0e3ff7f4ae07da61da7 (patch) | |
tree | bd6e9f570a654ba394253b89ea12fd524ae7daa8 /source/blender/editors | |
parent | 0294e1d27f2f64e88ab980f5fafa3d3e0743877c (diff) |
Fix T62241: Repeat last translate, wrong direction
Only use orientation value when the operator uses orientation axis.
Own error in 03da3b6593a24
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/transform/transform.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 5b26066afe0..877ca336cfe 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -2160,6 +2160,9 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) } /* Orientation used for redo. */ + const bool use_orient_axis = ( + t->orient_matrix_is_set && + (RNA_struct_find_property(op->ptr, "orient_axis") != NULL)); short orientation; if (t->con.mode & CON_APPLY) { orientation = t->con.orientation; @@ -2177,10 +2180,13 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) { orientation = RNA_property_enum_get(op->ptr, prop); } - else { + else if (use_orient_axis) { /* We're not using an orientation, use the fallback. */ orientation = t->orientation.unset; } + else { + orientation = V3D_ORIENT_GLOBAL; + } if ((prop = RNA_struct_find_property(op->ptr, "orient_axis"))) { @@ -2212,7 +2218,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) if (t->con.mode & CON_APPLY) { RNA_float_set_array(op->ptr, "orient_matrix", &t->con.mtx[0][0]); } - else if (t->orient_matrix_is_set) { + else if (use_orient_axis) { RNA_float_set_array(op->ptr, "orient_matrix", &t->orient_matrix[0][0]); } else { |