diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-29 13:51:56 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-29 13:52:38 +0300 |
commit | 9888374f4b5a5c12dfa6c5252055017dc3f75ab5 (patch) | |
tree | b2de85e57418d1aabe07973c7bd991ec8bbd99b7 | |
parent | 4f997c0ebb734d5214fabb48059d50513ed570cf (diff) |
Transform: re-revert new user-axis-first behavior
This restores old behavior but leaves in new code
which is more flexible.
See: 6491d50d02b7 for feedback on why this isn't ideal.
-rw-r--r-- | source/blender/editors/transform/transform.h | 2 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 5dff9f9f30a..ca341fc8738 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -505,6 +505,8 @@ typedef struct TransInfo { struct { short user; + /* Used when user is global. */ + short user_alt; short index; short *types[2]; /* this gets used when current_orientation is V3D_MANIP_CUSTOM */ diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index c66cda57c57..f27df3bba25 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1405,9 +1405,14 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve t->orientation.index = 0; ARRAY_SET_ITEMS( t->orientation.types, - &t->orientation.user, - /* V3D_MANIP_GLOBAL */ - NULL); + NULL, + &t->orientation.user); + + /* Make second orientation local if both are global. */ + if (t->orientation.user == V3D_MANIP_GLOBAL) { + t->orientation.user_alt = V3D_MANIP_LOCAL; + t->orientation.types[1] = &t->orientation.user_alt; + } /* exceptional case */ if (t->around == V3D_AROUND_LOCAL_ORIGINS) { |