diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-09-05 04:11:39 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-09-05 04:11:39 +0400 |
commit | 8cf9e5f8c3904b3e46743c92c0275c4c54726866 (patch) | |
tree | 8b68b22d5d00df6f60b3c890c3b19b881d78be4d /release/scripts/templates/operator_modal.py | |
parent | ebe29c3f8444f1ca8128ecc989f8f4af9bec5dac (diff) |
change templates to call modal_handler_add() is called last since any errors between calling this function and returning will crash blender. see [#30687]
Diffstat (limited to 'release/scripts/templates/operator_modal.py')
-rw-r--r-- | release/scripts/templates/operator_modal.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/release/scripts/templates/operator_modal.py b/release/scripts/templates/operator_modal.py index d8115bc95bf..88e5ee80590 100644 --- a/release/scripts/templates/operator_modal.py +++ b/release/scripts/templates/operator_modal.py @@ -26,9 +26,10 @@ class ModalOperator(bpy.types.Operator): def invoke(self, context, event): if context.object: - context.window_manager.modal_handler_add(self) self.first_mouse_x = event.mouse_x self.first_value = context.object.location.x + + context.window_manager.modal_handler_add(self) return {'RUNNING_MODAL'} else: self.report({'WARNING'}, "No active object, could not finish") |