scan ALL objects for constraints targeting orig

This commit is contained in:
Nathan
2026-03-13 15:45:07 -06:00
parent 991fd07f9e
commit 038537186c
2 changed files with 167 additions and 3 deletions
+6 -3
View File
@@ -482,14 +482,17 @@ def run_retarg_relatives(orig, rep, rep_descendants, orig_to_rep):
for ob in candidates:
if ob.parent == orig:
ob.parent = rep
for c in getattr(ob, "constraints", []):
if getattr(c, "target", None) == orig:
c.target = rep
if ob.type == "MESH" and ob.modifiers:
for m in ob.modifiers:
if getattr(m, "object", None) == orig:
m.object = rep
# Retarget constraints on ALL objects (including orig hierarchy like eyes)
for ob in bpy.data.objects:
for c in getattr(ob, "constraints", []):
if getattr(c, "target", None) == orig:
c.target = rep
# Camera DOF: retarget focus_object from orig to rep
for ob in bpy.data.objects:
if ob.type != 'CAMERA':