|
|
@ -94,12 +94,14 @@ class ModifierClipboard: |
|
|
|
|
|
|
|
|
|
|
|
def _paste_property(self, src, dst, prop): |
|
|
|
def _paste_property(self, src, dst, prop): |
|
|
|
prop_name = prop.identifier |
|
|
|
prop_name = prop.identifier |
|
|
|
|
|
|
|
if prop_name in {"rna_type"}: |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
# Old properties? Discard their asses. |
|
|
|
# Old properties? Discard their asses. |
|
|
|
if not hasattr(dst, prop_name): |
|
|
|
if not hasattr(dst, prop_name): |
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
# Collection properties must be manually copied... |
|
|
|
# Collection and pointer properties must be manually copied... |
|
|
|
if prop.type == "COLLECTION": |
|
|
|
if prop.type == "COLLECTION": |
|
|
|
dst_prop, src_prop = getattr(dst, prop_name), getattr(src, prop_name) |
|
|
|
dst_prop, src_prop = getattr(dst, prop_name), getattr(src, prop_name) |
|
|
|
dst_prop.clear() |
|
|
|
dst_prop.clear() |
|
|
@ -107,6 +109,10 @@ class ModifierClipboard: |
|
|
|
dst_item = dst_prop.add() |
|
|
|
dst_item = dst_prop.add() |
|
|
|
for item_prop in src_item.rna_type.properties: |
|
|
|
for item_prop in src_item.rna_type.properties: |
|
|
|
self._paste_property(src_item, dst_item, item_prop) |
|
|
|
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: |
|
|
|
else: |
|
|
|
try: |
|
|
|
try: |
|
|
|
if src.is_property_set(prop_name): |
|
|
|
if src.is_property_set(prop_name): |
|
|
|