diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-12-19 12:44:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-12-19 12:49:13 +0300 |
commit | 231ea39ed154b8284f45e97b10fbb699e79358c3 (patch) | |
tree | e421be6d952a45cdae49f273e5a4a733d1f00d3d /source/blender/editors/transform | |
parent | a246604937660e3b074fcc410a005da11049a73b (diff) |
Transform: use the scenes transform orientation
- Use the user orientation when pressing XYZ keys,
second press switches to global.
- Pressing again switches to global, or local
if you're have global orientation set.
The option for gizmos to have their own orientations will be added,
see: D4075
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform.c | 6 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 2aff12266a7..0f555bcc5b7 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1381,15 +1381,15 @@ int transformEvent(TransInfo *t, const wmEvent *event) } else { if (event->shift) { - initSelectConstraint(t, t->spacemtx); - } - else { /* bit hackish... but it prevents mmb select to print the orientation from menu */ float mati[3][3]; strcpy(t->spacename, "global"); unit_m3(mati); initSelectConstraint(t, mati); } + else { + initSelectConstraint(t, t->spacemtx); + } postSelectConstraint(t); } } diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 704d818a1c6..c1a2eb218cf 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1408,13 +1408,14 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve t->orientation.index = 0; ARRAY_SET_ITEMS( t->orientation.types, - NULL, - &t->orientation.user); + &t->orientation.user, + NULL); /* 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; + t->orientation.types[0] = &t->orientation.user_alt; + SWAP(short *, t->orientation.types[0], t->orientation.types[1]); } /* exceptional case */ |