Using Variables with the Root Node

The Root node allows you to control parameters that affect the entire Nuke script, rather than just a single node. You can access the Root node parameters by going to Project Settings and viewing the Root tab.

The frame range (first_frame and last_frame) and fps knobs on the Root node allow expressions, allowing you to reference Variables here.

To do this, right click on the knob and select Add expression…

A window will appear. In the Expression field, type to reference your Variable using % and your variable name. You can check if the result matches your expectations below before clicking OK.

This is the Variable we are referencing in this example:

Once you’ve clicked OK, evaluated Variables will appear in your Root node in blue:

Now changing the value of your Variable will automatically update the Root node’s first_frame knob.

Note:  These expressions cannot include animations (e.g. use of the frame, t and x variables) - these expressions will be flagged as invalid and will evaluate to 0 if used.

Note:  To see more examples of variables usage see Using Graph Scope Variables in Your Workflows.