diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-08-24 10:04:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-08-24 10:04:28 +0300 |
commit | e20c825b05e00954995fe2ed74e7fb409d09abe8 (patch) | |
tree | 4491775682a618cb6e2e902bfe4ec61d72966d7b /release | |
parent | 134e927965c9871df8a9e13806f1cd48f4d43f16 (diff) |
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
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/templates_py/manipulator_custom_geometry.py | 2 |
1 files changed, 2 insertions, 0 deletions
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): |