Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2021-10-04 13:16:55 +0300
committerBastien Montagne <bastien@blender.org>2021-10-04 13:17:50 +0300
commit23d9953c807f3376212b1a0a31f7a7669e9eb1ac (patch)
tree710f8c52e86bc43650f1c3e4ce9e9d21a45f06aa /release
parentce6a24976a38be5aa8fba346424e3caae2b2f9ae (diff)
I18n tools: Fix issue when extracting messages on release builds.
This was also affecting prototype of buildbot-driven UI messages extraction...
Diffstat (limited to 'release')
-rw-r--r--release/scripts/modules/bl_i18n_utils/bl_extract_messages.py10
1 files changed, 9 insertions, 1 deletions
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 3355e9075a0..6c9c212387e 100644
--- a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
+++ b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
@@ -378,7 +378,15 @@ def dump_rna_messages(msgs, reports, settings, verbose=False):
if cls in blacklist_rna_class:
return cls.__name__
cls_id = ""
- bl_rna = cls.bl_rna
+ bl_rna = getattr(cls, "bl_rna", None)
+ # It seems that py-defined 'wrappers' RNA classes (like `MeshEdge` in `bpy_types.py`) need to be accessed
+ # once from `bpy.types` before they have a valid `bl_rna` member.
+ # Weirdly enough, this is only triggered on release builds, debug builds somehow do not have that issue.
+ if bl_rna is None:
+ if getattr(bpy.types, cls.__name__, None) is not None:
+ bl_rna = getattr(cls, "bl_rna", None)
+ if bl_rna is None:
+ raise TypeError("Unknown RNA class")
while bl_rna:
cls_id = bl_rna.identifier + "." + cls_id
bl_rna = bl_rna.base