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_draw.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_draw.py')
-rw-r--r--release/scripts/templates/operator_modal_draw.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/release/scripts/templates/operator_modal_draw.py b/release/scripts/templates/operator_modal_draw.py
index f2d5ad8982b..f1c4e113b0a 100644
--- a/release/scripts/templates/operator_modal_draw.py
+++ b/release/scripts/templates/operator_modal_draw.py
@@ -53,14 +53,13 @@ class ModalDrawOperator(bpy.types.Operator):
def invoke(self, context, event):
if context.area.type == 'VIEW_3D':
- context.window_manager.modal_handler_add(self)
-
# Add the region OpenGL drawing callback
# draw in view space with 'POST_VIEW' and 'PRE_VIEW'
self._handle = context.region.callback_add(draw_callback_px, (self, context), 'POST_PIXEL')
self.mouse_path = []
+ context.window_manager.modal_handler_add(self)
return {'RUNNING_MODAL'}
else:
self.report({'WARNING'}, "View3D not found, cannot run operator")