Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/editors/transform/transform.h2
-rw-r--r--source/blender/editors/transform/transform_generics.c11
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) {