Files
Dynamic-Link-Manager/.specstory/history/2026-03-13_20-28Z-camera-dof-focus-object-retargeting.md
T

40 lines
1.2 KiB
Markdown

<!-- Generated by SpecStory, Markdown v2.1.0 -->
<!-- cursor Session 315fde62-50dd-4c50-9d07-4089c4952f9d (2026-03-13 20:28Z) -->
# 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):
```python
# 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:
```python
# 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.
---