Retarget an existing FX rig from one shot to another. Duplicates a named node group (and its BackdropNode), renames shot-coded nodes, then remaps all file references from the source shot's sequences to their analogues in the target shot.
"Retarget the [backdrop/group name] network from [SOURCE_SHOT] to [TARGET_SHOT]."
Or supply the three inputs explicitly:
| Input | Description | Example |
|---|---|---|
SOURCE_NODES |
List of node names + backdrop label to copy | Read1, Grade2, Merge3, PARK003 Rig |
SOURCE_DIR |
Root directory of the source shot's sequences | /path/to/raw_videos/PARK003/ |
TARGET_DIR |
Root directory of the target shot's sequences | /path/to/raw_videos/CWG006/ |
- Verify Nuke connection (ping or
get_script_info). - Read the position of every source node via
get_node_info(knobsxpos,ypos). - Find the BackdropNode enclosing the group: it has knobs
xpos,ypos,bdwidth,bdheight, and alabelmatching the group name. - Determine bounding box of the group:
max_xposacross all nodes + node width (~80). - Compute
offset_x= bounding box width + a gap of at least 150 units (Nuke's coordinate scale is larger than Houdini's). - Duplicate via
execute_python:nuke.selectAll() nuke.invertSelection() for name in source_node_names: nuke.toNode(name).setSelected(True) nuke.nodeCopy('%clipboard%') nuke.nodePaste('%clipboard%')
- Move each new node's
xposby+ offset_x. - Create a new BackdropNode at the same offset: copy
bdwidth,bdheight,label.
- Scan new node names for the source shot code, case-insensitive.
- Also catch Nuke's auto-suffix artefacts: Nuke appends a number on paste
(e.g.
Read_PARK003→Read_PARK0031). Detect these by the shot code stem. - Propose renames: replace source shot code with target shot code.
- Also update the BackdropNode
labelknob if it contains the source shot code. - Show the rename list and get user confirmation before applying.
- Apply:
node['name'].setValue(new_name)viaexecute_pythonormodify_node.
- Scan all new nodes for
fileknob values containing the source shot directory. - Also check inside
Groupnodes — recurse vianuke.toNode(group_name).nodes()and scan each child's knobs. - Other knobs that may contain file paths:
vfield_file,lut,script(on Group nodes), any knob of typeFile_Knob. - Collect: node name | knob name | current value.
- List the source shot directory — collect sequence folder names.
- List the target shot directory — collect sequence folder names.
- Match sequences semantically, in this priority order:
- Shot plate — keywords:
pl01_ref,ref,HD_ref,plate - Clean plate — keywords:
cp01,cleanPlate,clean_plate - Roto — keywords:
roto - Render passes — match by pass name:
Normal,Depth,Alpha,BaseColor,Roughness,Metallic,Specular,Source
- Shot plate — keywords:
- Use process of elimination: once a source sequence is matched, remove it from the candidate pool for subsequent matches.
- Flag format changes (
.exr↔.png) — note these explicitly. - Flag unmatched source sequences — leave their parameters unchanged.
Frame expression translation table:
Nuke uses printf-style or hash-style frame tokens, not Houdini's $F syntax.
| Source pattern | Detected by | New pattern |
|---|---|---|
%04d |
printf 4-digit | %04d (usually unchanged) |
%06d |
printf 6-digit | %06d (usually unchanged) |
#### |
4 hashes | #### (usually unchanged) |
%04d with frame offset |
expression node upstream | Adjust offset value, keep format |
Determine which pattern applies by inspecting the first filename in the target
sequence folder: count the digits, check for leading zeros, check whether the
frame number matches %d directly or requires an offset expression.
If the source used a Nuke frame offset (e.g. Read node frame_mode: offset,
frame: -1000) and the target sequence starts at a different frame number,
update the frame knob accordingly — do not change the file path pattern.
- Present the full mapping table before touching any parameters:
- Old path → New path
- Expression/offset change (if any)
- Format change (if any)
- Unmatched sequences (listed separately)
- Do not proceed until the user approves.
- For each approved mapping, update the
fileknob viamodify_nodeorexecute_python:nuke.toNode(name)['file'].setValue(new_path). - If the frame padding changed, also update the
formatorframeknobs as needed. - Apply to every node/knob pair found in the scan.
- Call
save_scriptafter all remaps are applied. - Report a final summary: N nodes copied, M nodes renamed, P parameters remapped, Q sequences unmatched.
- Do not remap unmatched-sequence parameters — leave them pointing at the source shot. The user handles those manually.
- In Nuke, the BackdropNode label is the primary human-readable identifier for a rig group — always update it to reflect the target shot name.
- Nuke Read nodes have a
colorspaceknob — if the source and target shots use different colorspace tags (e.g. different camera LUTs), flag this for the user but do not change it automatically. - If source nodes use a
TimeOffsetorRetimenode with frame expressions, those may need adjustment when the target shot has a different frame range — flag but do not auto-fix.