From e20c825b05e00954995fe2ed74e7fb409d09abe8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 24 Aug 2017 17:04:28 +1000 Subject: Manipulator: modal callback can now cancel & pass events Re-use operator return flags for manipulator modal & invoke, this means manipulators can allow navigation or other events to be handled as they run - see T52499 --- release/scripts/templates_py/manipulator_custom_geometry.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'release/scripts/templates_py') diff --git a/release/scripts/templates_py/manipulator_custom_geometry.py b/release/scripts/templates_py/manipulator_custom_geometry.py index 38f7a358b2a..0f1ab72f9ef 100644 --- a/release/scripts/templates_py/manipulator_custom_geometry.py +++ b/release/scripts/templates_py/manipulator_custom_geometry.py @@ -93,6 +93,7 @@ class MyCustomShapeWidget(Manipulator): def invoke(self, context, event): self.init_mouse_y = event.mouse_y self.init_value = self.target_get_value("offset") + return {'RUNNING_MODAL'} def exit(self, context, cancel): context.area.header_text_set() @@ -108,6 +109,7 @@ class MyCustomShapeWidget(Manipulator): value = self.init_value + delta self.target_set_value("offset", value) context.area.header_text_set("My Manipulator: %.4f" % value) + return {'RUNNING_MODAL'} class MyCustomShapeWidgetGroup(ManipulatorGroup): -- cgit v1.2.3