[Bf-blender-cvs] [e138cdeeb6] master: Transform manipulator: Allow first clicking Shift before selecting axis

Sergey Sharybin noreply at git.blender.org
Wed Jan 18 12:21:51 CET 2017


Commit: e138cdeeb637bb63f2a66728db1c3281ac1fca09
Author: Sergey Sharybin
Date:   Thu Dec 15 11:12:43 2016 +0100
Branches: master
https://developer.blender.org/rBe138cdeeb637bb63f2a66728db1c3281ac1fca09

Transform manipulator: Allow first clicking Shift before selecting axis

Avoids possible jumps when one is trying to do some really preciese tweak.

Quite striaghtforward change for mouse input initialization: take Shift
state into account. However, this will interfere with the axis exclusion
which is currently also uses Shift (the feature to move something in a
plane which doesn't have selected axis). This is probably not so commonly
used feature (nobody in the studio even knew of it) and the only downside
now would be that such a constrainted movement will become accurate by
default. That's easy to deal from user side by just unholding Shift key.

Reviewers: brecht, mont29, Severin

Differential Revision: https://developer.blender.org/D2418

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

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

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

diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 20c62e91d0..31ffa019e4 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -2176,7 +2176,7 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
 	calculateCenter(t);
 
 	if (event) {
-		initMouseInput(t, &t->mouse, t->center2d, event->mval);
+		initMouseInput(t, &t->mouse, t->center2d, event->mval, event->shift);
 	}
 
 	switch (mode) {
@@ -8495,7 +8495,7 @@ static void initTimeScale(TransInfo *t)
 	center[1] = t->mouse.imval[1];
 
 	/* force a reinit with the center2d used here */
-	initMouseInput(t, &t->mouse, center, t->mouse.imval);
+	initMouseInput(t, &t->mouse, center, t->mouse.imval, false);
 
 	initMouseInputMode(t, &t->mouse, INPUT_SPRING_FLIP);
 
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index a59f9dc43d..7ea4448a44 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -728,7 +728,7 @@ typedef enum {
 	INPUT_CUSTOM_RATIO_FLIP,
 } MouseInputMode;
 
-void initMouseInput(TransInfo *t, MouseInput *mi, const float center[2], const int mval[2]);
+void initMouseInput(TransInfo *t, MouseInput *mi, const float center[2], const int mval[2], const bool precision);
 void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode);
 eRedrawFlag handleMouseInput(struct TransInfo *t, struct MouseInput *mi, const struct wmEvent *event);
 void applyMouseInput(struct TransInfo *t, struct MouseInput *mi, const int mval[2], float output[3]);
diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c
index 9b7d19eacd..42cc918ec8 100644
--- a/source/blender/editors/transform/transform_input.c
+++ b/source/blender/editors/transform/transform_input.c
@@ -234,10 +234,10 @@ static void InputAngleSpring(TransInfo *t, MouseInput *mi, const double mval[2],
 	output[1] = toutput[0];
 }
 
-void initMouseInput(TransInfo *UNUSED(t), MouseInput *mi, const float center[2], const int mval[2])
+void initMouseInput(TransInfo *UNUSED(t), MouseInput *mi, const float center[2], const int mval[2], const bool precision)
 {
 	mi->factor = 0;
-	mi->precision = 0;
+	mi->precision = precision;
 
 	mi->center[0] = center[0];
 	mi->center[1] = center[1];




More information about the Bf-blender-cvs mailing list