Blender API : operator_active_status
I’m currently developing an add-on, and one feature would be really helpful.
I’m working with existing operators, and there is one context member that I use:
"bpy.context.active_operator"
This returns the last active operator. The problem is that once an operator has been active, it will continue to return that operator and never becomes None again (except at startup).
It would be really useful to have a context member that indicates whether an operator is currently running or not.
For example, it could either:
return a boolean (True if an operator is currently active, otherwise False), or return the name of the currently active operator, and None when no operator is running.
Example in the image:
But i think the verison of Operator_Name/None would be a bit more useful.
Have a nice day :)
1 Comment
Trying to clarify a bit:
To my understanding,
bpy.context.active_operatoris really "the operator whose redo properties are active", aka "the last executed operator", so it sounds unrelated?What you want is a "currently running operator"? Which would only make sense for modal operators I think:
Non-modal operators don't really have a useful "currently running" state. An operator is invoked, executes, returns, and control goes back to Blender. By the time another Python script could query the context, it's already finished.
But for modal operators, there is a defined running state, but it is not exposed to the API.
So is your request specifically about modal operators, and expecting something like
bpy.context.running_operatorreturning either the active modal operator'sbl_idname, or None when no modal operator is running?