
A Nuke script is a directed acyclic graph (DAG): nodes (vertices) connected by pipes (edges) that always flow forward — never in a cycle. That is not just computer science trivia. It is why your script can be evaluated in a clear order, cached, and handed to another artist without turning into a knot.
In mathematics, particularly graph theory, and computer science, a directed acyclic graph (DAG) is a directed graph with no directed cycles… following those directions will never form a closed loop… A directed graph is a DAG if and only if it can be topologically ordered…— Wikipedia: Directed acyclic graph
Good graph structure is how you stay fast, debuggable, and employable on a team. This lesson is the convention set most feature comps expect you to follow.
Every serious composite should have a distinct B-spine: a vertical column of Merge nodes stacked so the main stack travels through the B input. Your footage if it exists should be vertically aligned above your final shot write node.
Merge takes metadata from the B side (resolution, channels, often the “hero” pipe you want to preserve).Rule of thumb: if you cannot point at one vertical run of Merges and say “that is the shot,” the graph is not structured yet.
Lens logic means: stack layers in the order a real camera / lens would see them — front to back in depth, not in random paint order.
Light hits the sensor after passing through whatever is in front. In the composite:
Smell | What it usually means |
|---|---|
Lots of unnecessary holdouts | Layers are in the wrong depth order |
| You are forcing A behind B because the stack is inverted |
Stenciling one layer by another just to “put it behind” | Reverse lens logic — reorder the stack instead |
Foreground edge work on something that should be occluded | Wrong merge order |
If you find yourself setting Merge to “under,” stop and fix the order. Under is a tool, not a lifestyle. Chronic under-merges mean the B-spine is upside down relative to depth.
Foreground elements already hold out what is behind them when the stack order is correct. Use explicit holdouts when:
Not because the graph was built back-to-front.
A complex graph is not a badge of skill. It is a liability.
Prefer:
DOT / sticky for “parked” experiments)If two nodes do the same job, one of them should go. If a chain can be one Grade instead of five, use one Grade.
“Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.”— DRY: Don’t Repeat Yourself
In a node graph, DRY means:
Repeating work is how versions drift: “I fixed the despill on the beauty but not on the contact shadow branch.”
By convention, sources and side work flow left → right into the vertical spine.
Merge sits on the right — horizontal prep into a vertical stack reads naturallyConsistency beats personal flair. Match the show’s template if one exists.
You are not the only person who will open this script. Supervisors, TDs, lighting, the night crew, and future-you in six months all need to understand it.
Treat the graph like readable code:
Practice | Why |
|---|---|
Clear backdrops / sections | “Prep,” “Key,” “CG integrate,” “Grain,” “Out” |
Sticky notes for non-obvious intent | “Client note v03 — keep edge warm” |
No mystery disconnected islands | Delete or label parked work |
Same merge / lens conventions as the team | Hand-off without a guided tour |
A clean graph:
Inspiration / gallery of extreme (and educational) scripts: scriptsofanotherdimension.tumblr.com
Study them for layout ideas — then simplify for production.
underAnti-pattern | Fix |
|---|---|
Spaghetti with no main pipe | Rebuild a B-spine; branch and rejoin |
Everything merged | Reorder depth; use |
Horizontal “novel” of Merges | Vertical spine + left-side prep |
Viewer LUT baked into Write | Keep color management out of “creative mess” mid-graph |
Merge under used as a crutchunder, your order is wrong.Structure is not bureaucracy. It is how your shot survives contact with other humans and future notes.