1.2 KiB
1.2 KiB
Camera DOF focus object retargeting (2026-03-13 20:28Z)
User
Add camera DOF focus_object retargeting to the run_retarg_relatives function in T:\Dynamic-Link-Manager\ops\migrator.py.
The function currently ends with this code (around line 475-480):
# Armature modifiers: any mesh with armature modifier using orig -> switch to rep
for ob in bpy.data.objects:
if ob.type != "MESH":
continue
for mod in ob.modifiers:
if mod.type == "ARMATURE" and mod.object == orig:
if ob not in rep_descendants:
mod.object = rep
Add the following code immediately after that section:
# Camera DOF: retarget focus_object from orig to rep
for ob in bpy.data.objects:
if ob.type != 'CAMERA':
continue
camera = ob.data
if not camera.dof:
continue
if camera.dof.focus_object == orig:
camera.dof.focus_object = rep
Use Python to read the file, find the exact text, and add the new code.