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

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/rigify
diff options
context:
space:
mode:
authorDemeter Dzadik <Mets>2021-11-05 18:47:40 +0300
committerDemeter Dzadik <demeter@blender.studio>2021-11-05 20:14:26 +0300
commit905cfc4040e71bcc60d5526506814431bd0a8e58 (patch)
tree68fd1d956b3739d8728ea1699ba84d1236a5286b /rigify
parent6274264545c61a74e6093b0243e9b973dcd50d19 (diff)
Fix T92530: Rigify is trying to copy addon properties
The copy_custom_properties() function needs to check if a property is actually a custom property created by the user, or a property defined by an addon. I think we don't want to copy addon-defined properties here, since that's not what is usually meant by "custom property". Reviewed By: angavrilov Maniphest Tasks: T92530 Differential Revision: https://developer.blender.org/D13084
Diffstat (limited to 'rigify')
-rw-r--r--rigify/utils/mechanism.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/rigify/utils/mechanism.py b/rigify/utils/mechanism.py
index 00aef154..0b5c8d93 100644
--- a/rigify/utils/mechanism.py
+++ b/rigify/utils/mechanism.py
@@ -463,14 +463,20 @@ def reactivate_custom_properties(obj):
def copy_custom_properties(src, dest, *, prefix='', dest_prefix='', link_driver=False, overridable=True):
"""Copy custom properties with filtering by prefix. Optionally link using drivers."""
res = []
- exclude = {'rigify_parameters', 'rigify_type'}
+
+ # Exclude addon-defined properties.
+ exclude = {prop.identifier for prop in src.bl_rna.properties if prop.is_runtime}
for key, value in src.items():
if key.startswith(prefix) and key not in exclude:
new_key = dest_prefix + key[len(prefix):]
- ui_data_src = src.id_properties_ui(key)
-
+ try:
+ ui_data_src = src.id_properties_ui(key)
+ except TypeError:
+ # Some property types, eg. Python dictionaries
+ # don't support id_properties_ui.
+ continue
if src != dest or new_key != key:
dest[new_key] = value