PyAPI: expose 'bl_options' for operators in bpy.ops

Useful for checking which operators are only for internal use.
This commit is contained in:
2020-09-01 17:02:51 +10:00
parent 06ba233374
commit c78c425266
4 changed files with 20 additions and 5 deletions

View File

@@ -27,6 +27,7 @@ op_poll = ops_module.poll
op_call = ops_module.call
op_as_string = ops_module.as_string
op_get_rna_type = ops_module.get_rna_type
op_get_bl_options = ops_module.get_bl_options
class BPyOps:
@@ -209,6 +210,10 @@ class BPyOpsSubModOp:
"""Internal function for introspection"""
return op_get_rna_type(self.idname())
@property
def bl_options(self):
return op_get_bl_options(self.idname())
def __repr__(self): # useful display, repr(op)
# import bpy
return op_as_string(self.idname())