I set up a modal timer, but the interval value doesn’t seem to change how often the timer fires.
Am I doing something wrong?
Here is the code:
class ModalTimerOperator5(bpy.types.Operator):
"""Operator which runs its self from a timer"""
bl_idname = "wm.modal_update_panel"
bl_label = "Timer-5"
done_once = False
_timer = None
def modal(self, context, event):
print ('timer')
return {'PASS_THROUGH'}
def execute(self, context):
wm = context.window_manager
self._timer = wm.event_timer_add(1.0, context.window) # Interval not working.
wm.modal_handler_add(self)
return {'RUNNING_MODAL'}
def cancel(self, context):
ModalTimerOperator5.done_once = False
ModalTimerOperator5.timer_cycles = 0
context.window_manager.event_timer_remove(self._timer)
return {'CANCELLED'}