When creating a new Blender Operator, you'll derive the class from bpy.types.Operator
, like this:
import bpy
class MyShinyOp(bpy.types.Operator):
bl_idname = 'object.my_shiny_operator'
bl_label = "Operator"
# ... and so on and so forth
My current understanding is that most operators should derive from bpy.types.Operator
just like above. After registration, I should see this operator as
bpy.types.OBJECT_OT_my_shiny_operator
But what if I want to extend an already existing one, like
bpy.types.MESH_OT_primitive_monkey_add
I cannot derive from it, as it isn't a class any more, it is a registered Operator - a class instance. So this code will fail:
class MyShinyOp(bpy.types.MESH_OT_primitive_monkey_add)
Is there a way to get a reference to the class itself? Is it around somewhere just like user written classes? Or is this somehow wrapped C++ stuff? Is it possible to derive from existing Operators at all?
from that_addon import thatoperator
is your best bet. $\endgroup$