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

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-09-06 03:01:55 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-09-06 03:01:55 +0400
commit0121d1744cace2c36f56fba417d8cb7098768ae3 (patch)
treedb9ba291c87c86f409dce3d55229386e04b3e41b
parent42426f816bafae5d863f16dcb05135dfa773e387 (diff)
code cleanup: ensure modal_handler_add() is called directly before returning.
-rw-r--r--io_anim_acclaim/__init__.py2
-rw-r--r--io_anim_c3d/__init__.py2
-rw-r--r--modules/selection_utils.py3
-rw-r--r--space_view3d_panel_measure.py2
-rw-r--r--space_view3d_screencast_keys.py2
-rw-r--r--system_demo_mode/demo_mode.py2
6 files changed, 7 insertions, 6 deletions
diff --git a/io_anim_acclaim/__init__.py b/io_anim_acclaim/__init__.py
index 38df1f9d..be8ce5b6 100644
--- a/io_anim_acclaim/__init__.py
+++ b/io_anim_acclaim/__init__.py
@@ -390,9 +390,9 @@ class AmcAnimator(bpy.types.Operator):
return {'PASS_THROUGH'}
def execute(self, context):
- context.window_manager.modal_handler_add(self)
self.timer = context.window_manager.\
event_timer_add(0.001, context.window)
+ context.window_manager.modal_handler_add(self)
return {'RUNNING_MODAL'}
def cancel(self, context):
diff --git a/io_anim_c3d/__init__.py b/io_anim_c3d/__init__.py
index ffd3658c..8741c252 100644
--- a/io_anim_c3d/__init__.py
+++ b/io_anim_c3d/__init__.py
@@ -87,9 +87,9 @@ class C3DAnimateCloud(bpy.types.Operator):
return {'PASS_THROUGH'}
def execute(self, context):
- context.window_manager.modal_handler_add(self)
self.timer = context.window_manager.\
event_timer_add(0.001, context.window)
+ context.window_manager.modal_handler_add(self)
return {'RUNNING_MODAL'}
def cancel(self, context):
diff --git a/modules/selection_utils.py b/modules/selection_utils.py
index aff9eea8..3bf89816 100644
--- a/modules/selection_utils.py
+++ b/modules/selection_utils.py
@@ -72,8 +72,9 @@ class SelectionOrder(bpy.types.Operator):
return {'PASS_THROUGH'}
def invoke(self, context, event):
- context.window_manager.modal_handler_add(self)
self.update(context)
+
+ context.window_manager.modal_handler_add(self)
return {'RUNNING_MODAL'}
diff --git a/space_view3d_panel_measure.py b/space_view3d_panel_measure.py
index 85cea04c..2d861301 100644
--- a/space_view3d_panel_measure.py
+++ b/space_view3d_panel_measure.py
@@ -922,7 +922,6 @@ class VIEW3D_OT_display_measurements(bpy.types.Operator):
# Add the region OpenGL drawing callback
for WINregion in context.area.regions:
if WINregion.type == 'WINDOW':
- context.window_manager.modal_handler_add(self)
self._handle = WINregion.callback_add(
draw_measurements_callback,
(self, context),
@@ -930,6 +929,7 @@ class VIEW3D_OT_display_measurements(bpy.types.Operator):
print("Measure panel display callback added")
+ context.window_manager.modal_handler_add(self)
return {'RUNNING_MODAL'}
return {'CANCELLED'}
diff --git a/space_view3d_screencast_keys.py b/space_view3d_screencast_keys.py
index 1530681c..01077bab 100644
--- a/space_view3d_screencast_keys.py
+++ b/space_view3d_screencast_keys.py
@@ -592,7 +592,6 @@ class ScreencastKeysStatus(bpy.types.Operator):
if context.window_manager.screencast_keys_keys is False:
# operator is called for the first time, start everything
context.window_manager.screencast_keys_keys = True
- context.window_manager.modal_handler_add(self)
self.key = []
self.time = []
self.mouse = []
@@ -605,6 +604,7 @@ class ScreencastKeysStatus(bpy.types.Operator):
self._timer = context.window_manager.event_timer_add(0.025,
context.window)
ScreencastKeysStatus.overall_time.insert(0, time.time())
+ context.window_manager.modal_handler_add(self)
return {'RUNNING_MODAL'}
else:
# operator is called again, stop displaying
diff --git a/system_demo_mode/demo_mode.py b/system_demo_mode/demo_mode.py
index 29e8bf32..54b8ed24 100644
--- a/system_demo_mode/demo_mode.py
+++ b/system_demo_mode/demo_mode.py
@@ -396,8 +396,8 @@ class DemoMode(bpy.types.Operator):
return {'CANCELLED'}
else:
DemoMode.enabled = True
- context.window_manager.modal_handler_add(self)
+ context.window_manager.modal_handler_add(self)
return {'RUNNING_MODAL'}
def cancel(self, context):