Workspace: Move engines to workspace and Properties Editor cleanup
[blender.git] / release / scripts / templates_py / operator_modal_timer.py
index b8211126dafed8e177d7830a831a01d9684e04ce..df4d10e656b604e5cbed173d0c2b888f8ffeb505 100644 (file)
@@ -10,7 +10,8 @@ class ModalTimerOperator(bpy.types.Operator):
 
     def modal(self, context, event):
         if event.type in {'RIGHTMOUSE', 'ESC'}:
-            return self.cancel(context)
+            self.cancel(context)
+            return {'CANCELLED'}
 
         if event.type == 'TIMER':
             # change theme color, silly!
@@ -29,7 +30,6 @@ class ModalTimerOperator(bpy.types.Operator):
     def cancel(self, context):
         wm = context.window_manager
         wm.event_timer_remove(self._timer)
-        return {'CANCELLED'}
 
 
 def register():