[Bf-blender-cvs] [9888374f4b5] blender2.8: Transform: re-revert new user-axis-first behavior

Campbell Barton noreply at git.blender.org
Thu Nov 29 11:55:45 CET 2018


Commit: 9888374f4b5a5c12dfa6c5252055017dc3f75ab5
Author: Campbell Barton
Date:   Thu Nov 29 21:51:56 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB9888374f4b5a5c12dfa6c5252055017dc3f75ab5

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.

===================================================================

M	source/blender/editors/transform/transform.h
M	source/blender/editors/transform/transform_generics.c

===================================================================

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) {



More information about the Bf-blender-cvs mailing list