Modal Timer Operator registration with Window Manager


I have used the ‘ModalTimerOperator’ a few times in the past, starting with the ‘blueprint’ from ‘Templates’. Today, I needed to use it again but this time I wrote it from memory first. I defined it as
class MYMOD_OT_timer(bpy.types.Operator) , to be consistent with naming conventions, gave it bl_idname = “mymod.timer” and in code I called it with bpy.ops.mymod.timer() . And it was working fine. Then I checked my version against the ‘blueprint’ and realized that I should have used bl_idname = “wm.mymod_timer” and called it with bpy.ops.wm.mymod_timer() .
So, now I am confused. It works either way and I do not know the difference between the two versions.
Could you please help me understand the difference so that I may use the correct version?


To my understanding a lot of the “you have to do it like this”-stuff in Blender addon development is just convention. Nothing much is stopping you from pissing all over the existing structures. We just generally tend to not do that.

hahaha, so long as you don’t piss in the wind, huh?) Thanks for your comments. I am still not clear about the difference though. As far as I know, the window manager has a ‘operators’ collection attribute but I have not been able to find any documentation relating to cases where a user-defined Operator should be added to that collection and why. In fact, the documentation is rather sparse in that department. Any ideas or pointers are appreciated.