diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2020-05-20 22:22:10 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2020-05-20 22:22:10 +0300 |
commit | 600fd1c6f0ed5025068598bfb98f6881f2563acd (patch) | |
tree | c9d701e89d73fd83535970d0e2b4ef461729bcf8 /source/blender/editors/transform/transform.c | |
parent | 29afadcb15f71119f70f77bcf32c8e54c7614576 (diff) |
Fix T76919: Wrong orientation when changing translate to rotate
During the refactor of the transform operations, in an attempt to
maintain previous behavior, the default orientation of the translate
and resize operations became `Global` and the rotate operation became
`View`.
Now the default is always `View`, and on redo, the translate and rotate
operations are saved as `Global`.
Diffstat (limited to 'source/blender/editors/transform/transform.c')
-rw-r--r-- | source/blender/editors/transform/transform.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 8e3ad55bae1..f779a6dea39 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1615,6 +1615,17 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) int proportional = 0; PropertyRNA *prop; + if (!(t->con.mode & CON_APPLY) && (t->flag & T_MODAL) && + ELEM(t->mode, TFM_TRANSLATION, TFM_RESIZE)) { + /* When redoing these modes the first time, it's more convenient to save + * the Global orientation. */ + mul_m3_v3(t->spacemtx, t->values_final); + unit_m3(t->spacemtx); + + BLI_assert(t->orientation.index == 0); + t->orientation.types[0] = V3D_ORIENT_GLOBAL; + } + // Save back mode in case we're in the generic operator if ((prop = RNA_struct_find_property(op->ptr, "mode"))) { RNA_property_enum_set(op->ptr, prop, t->mode); |