diff --git a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py index dc4826288e3..764c42be1ef 100644 --- a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py +++ b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py @@ -545,7 +545,7 @@ def dump_py_messages_from_files(msgs, reports, files, settings): for n in opname.split('.'): op = getattr(op, n) try: - return op.get_rna().bl_rna.translation_context + return op.get_rna_type().translation_context except Exception as e: default_op_context = i18n_contexts.operator_default print("ERROR: ", str(e)) diff --git a/release/scripts/modules/bpy/ops.py b/release/scripts/modules/bpy/ops.py index 028cce063ac..664dc79b28b 100644 --- a/release/scripts/modules/bpy/ops.py +++ b/release/scripts/modules/bpy/ops.py @@ -116,7 +116,16 @@ class BPyOpsSubModOp: __slots__ = ("_module", "_func") def _get_doc(self): - return op_as_string(self.idname()) + idname = self.idname() + sig = op_as_string(self.idname()) + # XXX You never quite know what you get from bpy.types, + # with operators... Operator and OperatorProperties + # are shadowing each other, and not in the same way for + # native ops and py ones! See T39158. + # op_class = getattr(bpy.types, idname) + op_class = op_get_rna_type(idname) + descr = op_class.description + return f"{sig}\n{descr}" @staticmethod def _parse_args(args): @@ -208,23 +217,7 @@ class BPyOpsSubModOp: def __repr__(self): # useful display, repr(op) # import bpy - idname = self.idname() - as_string = op_as_string(idname) - # XXX You never quite know what you get from bpy.types, - # with operators... Operator and OperatorProperties - # are shadowing each other, and not in the same way for - # native ops and py ones! See T39158. - # op_class = getattr(bpy.types, idname) - op_class = op_get_rna(idname) - descr = op_class.bl_rna.description - # XXX, workaround for not registering - # every __doc__ to save time on load. - if not descr: - descr = op_class.__doc__ - if not descr: - descr = "" - - return "# %s\n%s" % (descr, as_string) + return op_as_string(self.idname()) def __str__(self): # used for print(...) return ("" %