From bed083e37b382fcd5deb9a0f60c79c7dac94c72f Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Thu, 30 Jun 2022 20:17:54 -0400 Subject: [PATCH] Fix #331. --- korman/operators/op_modifier.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/korman/operators/op_modifier.py b/korman/operators/op_modifier.py index 9fb18cc..8cc0c1b 100644 --- a/korman/operators/op_modifier.py +++ b/korman/operators/op_modifier.py @@ -94,12 +94,14 @@ class ModifierClipboard: def _paste_property(self, src, dst, prop): prop_name = prop.identifier + if prop_name in {"rna_type"}: + return # Old properties? Discard their asses. if not hasattr(dst, prop_name): return - # Collection properties must be manually copied... + # Collection and pointer properties must be manually copied... if prop.type == "COLLECTION": dst_prop, src_prop = getattr(dst, prop_name), getattr(src, prop_name) dst_prop.clear() @@ -107,6 +109,10 @@ class ModifierClipboard: dst_item = dst_prop.add() for item_prop in src_item.rna_type.properties: self._paste_property(src_item, dst_item, item_prop) + elif prop.type == "POINTER" and prop.fixed_type.base.name != "ID": + dst_prop, src_prop = getattr(dst, prop_name), getattr(src, prop_name) + for subprop_name in src_prop.rna_type.properties: + self._paste_property(src_prop, dst_prop, subprop_name) else: try: if src.is_property_set(prop_name):