[Bf-blender-cvs] [be0b2ac18b8] blender2.8: Manipulator: ignore mouse location w/ view widgets

Campbell Barton noreply at git.blender.org
Mon Jan 29 07:41:28 CET 2018


Commit: be0b2ac18b81cd10fd336df02b9b076536af7418
Author: Campbell Barton
Date:   Mon Jan 29 17:40:19 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBbe0b2ac18b81cd10fd336df02b9b076536af7418

Manipulator: ignore mouse location w/ view widgets

When pressing on a button to zoom for eg,
using zoom-to-mouse-position doesn't make any sense.

There is also zoom speed scaling which increases the closer the cursor
is to the top-edge of the screen, which was noticable since the
navigation widget is currently at the top of the screen.

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

M	source/blender/editors/space_view3d/view3d_manipulator_navigate.c

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

diff --git a/source/blender/editors/space_view3d/view3d_manipulator_navigate.c b/source/blender/editors/space_view3d/view3d_manipulator_navigate.c
index 9f655fff8a1..6a5d63b180f 100644
--- a/source/blender/editors/space_view3d/view3d_manipulator_navigate.c
+++ b/source/blender/editors/space_view3d/view3d_manipulator_navigate.c
@@ -231,6 +231,16 @@ static void WIDGETGROUP_navigate_setup(const bContext *UNUSED(C), wmManipulatorG
 		}
 	}
 
+	/* Modal operators, don't use initial mouse location since we're clicking on a button. */
+	{
+		int mpr_ids[] = {MPR_MOVE, MPR_ROTATE, MPR_ZOOM};
+		for (int i = 0; i < ARRAY_SIZE(mpr_ids); i++) {
+			wmManipulator *mpr = navgroup->mpr_array[mpr_ids[i]];
+			wmManipulatorOpElem *mpop = WM_manipulator_operator_get(mpr, 0);
+			RNA_boolean_set(&mpop->ptr, "use_mouse_init", false);
+		}
+	}
+
 	{
 		wmManipulator *mpr = navgroup->mpr_array[MPR_ROTATE];
 		mpr->scale_basis = MANIPULATOR_SIZE / 2;



More information about the Bf-blender-cvs mailing list