Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-09-05 04:11:39 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-09-05 04:11:39 +0400
commit8cf9e5f8c3904b3e46743c92c0275c4c54726866 (patch)
tree8b68b22d5d00df6f60b3c890c3b19b881d78be4d /release/scripts/templates/operator_modal.py
parentebe29c3f8444f1ca8128ecc989f8f4af9bec5dac (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.py3
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")