diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-09-13 11:16:06 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-09-13 11:16:06 +0300 |
commit | a6fc7180297f855c2592b20b26f96eb8e5a9e0ca (patch) | |
tree | ca62e3e1c301e42814a76f522975855bc1d6ceea /release/scripts/modules | |
parent | 9900addf11d9a5b964aa745cf141998195f7c8db (diff) |
PyAPI: add API call to get an operators type
Getting the instance leaks memory and was only meant to be used for
generating docs.
Diffstat (limited to 'release/scripts/modules')
-rw-r--r-- | release/scripts/modules/bpy/ops.py | 5 | ||||
-rw-r--r-- | release/scripts/modules/rna_info.py | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/release/scripts/modules/bpy/ops.py b/release/scripts/modules/bpy/ops.py index 7c5c76ffdbe..028cce063ac 100644 --- a/release/scripts/modules/bpy/ops.py +++ b/release/scripts/modules/bpy/ops.py @@ -27,6 +27,7 @@ op_poll = ops_module.poll op_call = ops_module.call op_as_string = ops_module.as_string op_get_rna = ops_module.get_rna +op_get_rna_type = ops_module.get_rna_type op_get_instance = ops_module.get_instance @@ -193,6 +194,10 @@ class BPyOpsSubModOp: return ret + def get_rna_type(self): + """Internal function for introspection""" + return op_get_rna_type(self.idname()) + def get_rna(self): """Internal function for introspection""" return op_get_rna(self.idname()) diff --git a/release/scripts/modules/rna_info.py b/release/scripts/modules/rna_info.py index 53d2e2d0151..535f2cda626 100644 --- a/release/scripts/modules/rna_info.py +++ b/release/scripts/modules/rna_info.py @@ -731,14 +731,14 @@ def BuildRNAInfo(): operators = dir(op_mod) for op in sorted(operators): try: - rna_prop = getattr(op_mod, op).get_rna() + rna_prop = getattr(op_mod, op).get_rna_type() except AttributeError: rna_prop = None except TypeError: rna_prop = None if rna_prop: - GetInfoOperatorRNA(rna_prop.bl_rna) + GetInfoOperatorRNA(rna_prop) for rna_info in InfoOperatorRNA.global_lookup.values(): rna_info.build() |