Nuke TCL Scripting Documentation

Nuke Scripting

Nuke's scripting language is based on TCL. The syntax of Tcl is described in detail in the TCL manual page. Note that Nuke does not use the Tk user interface toolkit, this is often described as part of Tcl.

init.tcl:

Whenever Nuke starts up, it will look through the library and plugin path and excute the first 'init.tcl' script it finds. Since init.tcl may be run many times in a render farm, init.tcl should never be very time consuming.

menu.tcl:

If Nuke is started in interactive mode, it will also run the first 'menu.tcl' it finds. The menu.tcl file that comes originally with Nuke describes the DAG(*) Window user interface and all toolbars in Nuke including shortcut keys and user interface images. All these items are fully customizable.

(* DAG is shorthand for Directed Acyclic Graph and describes the way Nodes are connected by Arrows in Nuke)

plugins and operators:

Executing any unknown script command will attempt to load a plugin of that name. If the plugin fails to load or does not cause the script command to be defined then an "unknown command" error is produced.

If a binary plugin is found, these commands create a new image operator of the given type. They take one optional argument, which is a list of knob name and value pairs. This list also accepts the keyword inputs and addUserKnob.

operator stack:

There is a "stack" of all operators created by these commands (and also of operators clicked on by the user, which allows these commands to "paste" into the tree where the users expects). After the knobs are parsed the correct number of operators are popped off the stack and connected to the inputs of the new operator.

All new operators should have a capitalized name, to make them easy to distinguish from built-in script commands, which are all lowercase.