Nuke tcl commands

The following is a list of builtin Nuke commands. More...

Functions

 safe_mode value password
 turns on/off security features
 push node
 Add nodes to the top of the node stack.
 node node
 pop n
 Remove node(s) from the top of the node stack.
 stack index
 Return contents of stack.
 dup
 index n
 exch
 roll n m
 Rotate items on the stack.
 addUserKnob id name keyword data...
 Add a new knob to the user knob tab in a node panel.
 knob_default class.knob value
 Get or set the default value of a knob for a class of nodes.
 knob_defaults
 end_group
 Changes the current group to the parent of the current group.
 Root knob value
 Set knob value in the root node.
 expression expr
 Parse a Nuke expression.
 questionmark expression true_result false_result
 Actual name is "?", return 1 of two strings.
 in object command
 Execute commands with a given node/knob/field as the "context".
 value knob default_value
 The value tcl command returns the current value of a knob.
 numvalue knob default_value
 The value tcl command returns the current value of a knob.
 exists knob
 True if the named item exists.
 knob knob new_value
 Returns or sets the entire state of a knob.
 setkey knob time value
 Set a value at a keyframe for a knob.
 knobs -awdv node?values?
 Get or set a list of knobs for a node.
 values -ad node
 Get a list of the current values for all knobs in a node.
 nodes group
 Return a tcl list of all the child nodes of the group.
 clone node type args
 Create a clone node that behaves identical to the original.
 clone_selected action
 Command to execute for the Clone menu item.
 declone node
 Make the node not be a clone.
 show_info node...
 display command nodecontext
 Creates a dialog box showing the result of command.
 show_dag groupnode
 Show the tree view of one or more group nodes.
 zoom group scale center_x center_y
 Change the zoom and pan of a group's display.
 connect_viewer n node
 Connect a viewer input to a node.
 autoplace nodelist
 Automatically place nodes, so they do not overlap.
 autoplace_snap nodelist
 Move one or more nodes to the closest grid position.
 input node number input_node
 Return or set an input of a node.
 inputs node new_number
 selected_node
 Returns the "node the user is thinking about".
 selected_nodes
 List all the selected nodes Returns a tcl list of the names of all selected nodes in the current group. An attempt is made to return them in "useful" order where inputs are done before the final node, so commands applied to this list go from top-down. Produces an error if there are no selected nodes.
 dependencies nodelist
 List all nodes referred to by these nodes. Return all nodes that the listed nodes read information from, that are not themselves in the list. You can use switches to select what types of referral are looked for:

  • -e = expressions
  • -i = visible input pipes
  • -h = hidden input pipes. The default is to look for all types of connections.

 dependent_nodes nodelist
 List all nodes that refer to these nodes Return all nodes that read information from any nodes in the list, that are not themselves in the list. You can use switches to select what types of referral are looked for:

  • -e = expressions
  • -i = visible input pipes
  • -h = hidden input pipes. The default is to look for all types of connections.

 frame value
 Return or set the current frame number.
 make_timecode startcode, fps, startframe
 Returns a timecode string in the format HH:MM:SS:FF.
 x
 delete nodelist
 Delete nodes.
 argv index
 Returns command line arguments.
 argc
 Returns number of command line arguments.
 filename_list
 List all files in a directory the Nuke way.
 recent_file index
 Return a filename from the recent-files list.
 add_recent_file filename
 Add a file to the recent-files list.
 load plugins...
 Load a plugin.
 plugins switches pattern...
 Returns a list of plugins.
 plugin_name
 Returns the name of the plugin being currently loaded.
 plugin_exists_tcl
 Test for the existence of a plugin.
 quit
 Exit Nuke.
 bytes amount
 Convert large memory amounts into human readable format.
 plugin_path
 ofx_plugin_path
 plugin_addpath path
 plugin_appendpath path
 execute nodes rangelist
 Execute the current script for a specified frame range.
 frames type
 Return list of frames supplied on the command line to nuke.
 filename group
 Return the filename(s) this node or group is working with.
 add_format w h x y r t pa name
 Add a new image format to the Nuke script.
 formats
 Return all available formats in a script.
 add_channel name
 Add a named new channel to the Nuke script.
 add_layer layer channel...
 Add a new layer and channels to Nuke.
 layers
 List layers.
 channels node
 List channels.
 sample node channel x y dx dy
 Return pixel values from an image.
 modified status
 Get or set the 'modified' flag in a script.
 byte string index
 Utility function to extract single 8-bit values from a tcl string. Warning: if there are foreign letters this will return the bytes of the UTF-8 encoding. Use "string index \a string \a index" to get the UTF-8 character.
 char unicode
 Turn single character number into a string.
 set_expression expression
 Set the expression for the current Knob.
 fltk_color color_code
 Convert an FLTK color code into a packed RGBA.
 add_timeout timeout node script
 Add a timeout that will run a script after some elapsed time.
 version testversion
 Return the nuke version, or check a version number.
 error_node
 Return node that produced an error.
 error_message
 Return error message.
 full_name node
 Return fully-qualified name of node Print the name of the node and any groups enclosing it in "group.group.name" form. If the name does not appear to be a node, it is printed unchanged (allows "0" and deleted nodes to print something).
 memory command arg
 Get/set information about memory usage.
 undo
 python
 Run a python command returning the result as a TCL string.
 screen_width
 Returns the width of a node in the DAG.
 screen_height
 Returns the height of a node in the DAG.
 script_new name
 Start a new script.
 show_settings
 Show the settings of the current group.
 get_input prompt
 Pops up a box that lets the user type in an arbitrary string.
 get_filename prompt pattern default
 Pops up a file chooser dialog box.
 get_clipname prompt pattern default
 Pops up a file chooser dialog box.
 ask prompt
 Show a Yes/No dialog.
 message prompt
 Show an info dialog box.
 alert prompt
 Show an alert dialog box.
 menu name key icon tooltip command
 Add a new menu item to a menu bar or replace it.
 get_color prompt default
 Show a color chooser dialog.
 panel -w title list
 Create a dialog box with multiple UI elements.
 menubar name position size
 Create a user menu bar in the DAG view.
 animations
 Returns a list of animatable things the user wants to work on.
 animation_start
 Return first frame of animation.
 animation_end
 Return last frame of animation.
 animation_increment
 Return frame interval.
 animation name command...
 Does operations on an animation curve.
 script_open filename
 Open an existing script.
 script_save_as filename
 Save the current script.
 script_save filename
 Save the current script.
 script_exit
 Exit Nuke.
 script_close
 Close the current script or group.
 node_paste filename
 Paste nodes from a script file or the clipboard.
 node_copy filename
 Copy all selected nodes into a file or the clipboard.
 _node_delete filename
 Delete all selected items in a DAG_View.

Detailed Description

The following is a list of builtin Nuke commands.

Nuke provides a great number of builtin script commands. This list contains all commands that are available to the user. If a command is not found in the list of builtin commands, Nuke will first search the plugin path for binary plugins with the same name. If none is found, the same path will be searched for tcl plugins. If neither was found, Nuke prints an error message.


Function Documentation

safe_mode ( value  password

turns on/off security features

"safe_mode" disables certain scripting features that can make loading an unknown script unsafe. It tries to prevent any automatically-executing code from modifying any files or other state of your computer. Currently it disables the tcl open and exec commands inside expressions on knobs. Note that buttons and menu items can still run arbitrary things, but require the user to push them.

Since this makes it impossible to do some operations (like having a knob return a value from a file), tcl procedures you write can turn it off as needed, using a password you set.

safe_mode defaults to off for back-compatibility. Installations may want to add code to init.tcl to turn it on and set a password, then add code to temporarily turn it off in any procedures that need it.

"safe_mode" returns 1 or 0 to indicate if it is on.

"safe_mode 1 password", turns it on and remembers the password. If it is already on it returns an error if the password is wrong.

"safe_mode 0 password" turns it off if the password matches. If the password is wrong it returns an error.

See also:
exec, load, open
push ( node 

Add nodes to the top of the node stack.

  • node...: one or more nodes
See also:
pop, stack
node ( node 
  • node: a node

Returns the node's "internal name", this name will not change if the node is renamed and is unique to this node. This internal name can be used anywhere a node name is needed, including this function (in which case it returns the name unchanged). The internal name will change each time Nuke is run.

See also:
pop, stack, exists
pop (

Remove node(s) from the top of the node stack.

  • n: optional - number of nodes to pop, default 1. Use 0 to not change stack.
    Returns:
    Top item on stack before the pop, or 0 if the stack was empty
    See also:
    push, stack
stack ( index 

Return contents of stack.

  • index: optional - 0 is topmost node, 1 is the next node, etc.

The stack is used to parse scripts, the top items are used as inputs to the new nodes as they are created, and are popped and then the new node is pushed. It is also used interactively, as each click by the user on a node will push it on the stack (or move it to the top if it is already in the stack).

If an index is given, this returns the name of the node at that index in the stack, or throws an error if the index is out of range.

If no index is given, this returns a tcl list of the nodes in the stack.

This function does not modify the node stack.

See also:
push, pop, dup, index, roll, exch, selected_node, selected_nodes
dup (

Duplicates the top of the node stack, so the same node is on it twice. Same as "index 0".

See also:
index, stack
index (

Duplicates the n'th entry on the node stack.

  • n: 0 is topmost node, 1 is the next node, etc.
    See also:
    dup, stack
exch (

Swap the top two nodes on the node stack.

See also:
stack, push, pop, roll
roll ( m

Rotate items on the stack.

  • n: number of items to rotate
  • j: number of items to rotate to the bottom performs a circular shift of the to n nodes on the stack by the amount j. Positive j indicates upward motion on the stack, whereas negative j indicates downward motion.
See also:
stack, push, pop, exch
addUserKnob ( id name keyword  data...

Add a new knob to the user knob tab in a node panel.

Syntax: addUserKnob ?node node_name? knobID name ?keyword data...?

  • node node_name: optional: default is the current node
  • knobID: see below for a list of valid knob ID's
  • name: optional: this is the tcl name of the new knob
  • keyword data: see below for list of keywords and data

The following knob ID's are supported:

  • 0 (OBSOLETE_KNOB): attemts to set this execute a tcl script
  • 1 (STRING_KNOB): a little text entry field.
  • 2 (FILE_KNOB): a single line of text with a filechooser button.
  • 3 (INT_KNOB): Single integer value.
  • 4 (ENUMERATION_KNOB): a pulldown selection. This knob returns an integer. user_data can be 'M { list_of_menu_entries }'.
  • 6 (BOOL_KNOB): check box with label drawn to the right.
  • 7 (DOUBLE_KNOB): a floating point slider. user_data can be 'R min max' to define the slider range.
  • 12 (XY_KNOB): 2 numbers for x,y position, draws crosshair, proxy scaling
  • 13 (XYZ_KNOB): 3 numbers for x,y,z position.
  • 14 (WH_KNOB): 1 or 2 numbers for width and height, proxy scaling
  • 15 (BBOX_KNOB): 4 numbers for x,y,r,t of a rectangle, proxy scaling.
  • 16 (SIZE_KNOB): 1 number stored as width & height
  • 18 (COLOR_KNOB): red, green, blue. user_data can be 'R min max' to define range for all 3 sliders.
  • 19 (ACOLOR_KNOB): red, green, blue, alpha. user_data can be 'R min max' to define range for all 4 sliders.
  • 20 (TAB_KNOB): name is put on the tab
  • 26 (TEXT_KNOB): static text in the left label column. user_data can be 'T text' to add text in the right knob column.
  • 30 (UV_KNOB): Two numbers
  • 32 (SCRIPT_KNOB): a push button that executes a tcl script when clicked. user_data can be 'T script'.

The following keywords+data are supported, only the first letter is checked:

  • label "text" : If no label is specified, Nuke will use the name as the label. If the label is "INVISIBLE", the knob will not be visisble in the UI.
  • tooltip "text" : Text for popup tooltip
  • Range min max : range for floating-point slider
  • Menu {list} : for Enumeration knob
  • Text "text" : for Text and script knob
See also:
knob, knobs
knob_default ( class.knob  value

Get or set the default value of a knob for a class of nodes.

  • class: describes the class of nodes, i.e Blur
  • knob: the name of a knob in class
  • value: optional - default value for new nodes

Knob_default sets a default value for knobs in nodes that belong to the same class. All knobs with matching names, that are created after this command was issued, will default to the new value. If class. is missing or is "*." then this default applies to all nodes with such a knob. If several values are supplied, the first value which is valid will be used as the default.

See also:
knob, knob_defaults
knob_defaults (

Returns a list of all defined knob_defaults. To find the value of one use [knob_default name ].

See also:
knob_default
end_group (

Changes the current group to the parent of the current group.

Does nothing if the current group is a Root (the main window of a script).

See also:
group
Root ( knob  value

Set knob value in the root node.

tcl syntax:  Root { knob value ... }

  • set this knob
  • to a new value

knob-value pairs can be repeated as often as needed.

See also:
knob, node
expression ( expr 

Parse a Nuke expression.

  • expression

This command runs the same expression parser as is used by Animations. This is not the same as the tcl expr parser. The main differences are:

  1. Only floating point numbers are calculated. There are no strings, boolean, or integer values.
  2. You can name any knob that returns a floating point value, with a dot-separated name, see knob for details on these names. You may follow the knob name with a time in parenthesis (like a function call) and if it is animated it will be evaluated at that time. If it is animated and no time is given, "frame" is used.
  3. The words "frame", "t", and "x" evaluate to the frame number of the context node, or the frame number this animation is being evaluated at.
  4. The word 'y' in an animation expression evaluates to the value the animation would have if the control points were used and there was no expression. Outside an animation expression y returns zero.
  5. You can put in several expressions, separated by spaces, and it will return several numbers separated by spaces.
    See also:
    knob, value, setkey
questionmark ( expression true_result  false_result

Actual name is "?", return 1 of two strings.

  • expression: expression to evaluate
  • true_result: returned if expression is non-zero
  • false_result: returned if expression is zero

This command is most useful for imbedding in square brackets into a string value to allow a choice between two strings based on the values of other knobs. Ie "[? root.proxy proxy_string fullsize_string]"

in ( object  command

Execute commands with a given node/knob/field as the "context".

  • object: node, knob, or field in knob
  • command: commands to execute, use curly braces for multiple

The command is executed with the object as the "context". This means that all names are evaluated relative to this object, and commands that modify "this" node will modify the given one.

If no arguments are given, this returns the name of the current context. Warning: this name may not give the exact same context if your nodes do not all have unique names.

See also:
this
value ( knob  default_value

The value tcl command returns the current value of a knob.

Returns the current value of a knob. Unlike knob, this will evaluate animation at the current frame, and expand brackets and dollar signs in string knobs.

The optional default_value is returned if there is any error, such as that named knob not existing. This avoids the need for catch statments when producing status messages, it is faster to do this.

If you want to use the result in a math expression, you may want to use numvalue instead. That will always return a number instead of text.

See also:
numvalue, knob, expression, exists
numvalue ( knob  default_value

The value tcl command returns the current value of a knob.

This is the same as the value command except it will always return a number. For enumerations this returns the index into the menu, starting at zero. For checkmarks this returns 0 for false and 1 for true. For all other knobs it attempts to atoi the string, returning 0 on failure.

The optional default_value is returned if there is any error, such as the named knob not existing. This avoids the need for catch statments when producing status messages, it is faster to do this.

See also:
value, knob, expression, exists
exists ( knob 

True if the named item exists.

Returns true if the named knob or node exists. Returns false if it does not (including all syntax errors). This allows you to write more readable code than doing catch commands.

See also:
knob, value, expression
knob ( knob  new_value

Returns or sets the entire state of a knob.

  • -t: obtain the type of the knob (as an int), rather than set/get
  • -c: obtain the type of the knob as a string
  • knob: name of knob to query or set
  • value: optional - if given, this will set the knob

Each individual control on a control panel is called a "knob". A knob's name is a dot-separated list. An example of a fully-expanded name of a knob is "root.Group1.Blur1.size.w". "root" is the node name of the outermost group, "Group1" is a group inside that containing the blur operator, "Blur1" is the name of a blur operator, "size" is the name of the actual knob, and "w" is the name of the "field" (there are two fields in a blur size, "w" and "h").

You can omit a lot of this because all knob names are figured out relative to a "current knob" and "current node". These are set depending on the context of where the scripting is invoked. For menu items the current node is the group that contained the menu, and there is no current knob. For expressions typed into knob fields the current knob is that knob and the current node is the node the knob belongs to.

If a name does not start with "root" then a search upwards is done for the first word in the name, first against the fields in the current knob, then against the knobs in the current node, then against the nodes in the group containing the current node (or in it if it is a group), on up to the root.

The word "this" means the current knob or the current node.

The word "input" means the first (0 or B) input of a node. Ie "Blur1.input" returns the node connected to the input of Blur1, while "Blur1.input.input" returns the input of that node.

If you are getting the value for reporting to the user, you probably want to use the value or expression commands.

If the -t argument is specified, it will print out the type of the knob rathe than getting or setting the value. The type is an integer, using the same list as addUserKnob

If -c it will print out the type of the knob as a string, e.g. "Int_Knob", "Enumeration_Knob", "XY_Knob".

See also:
value, expression, setkey, knob_default, addUserKnob
setkey ( knob time  value

Set a value at a keyframe for a knob.

  • knob names a single numerical field in some operator
  • time of keyframe
  • value for new keyframe

This turns on the animated control for that field (if not already on) and adds a single keyframe at the given time and value. See knob for how to name knobs and fields.

If you don't want to turn on animation, use the knob command instead.

See also:
knob
knobs ( -awdv node?values? 

Get or set a list of knobs for a node.

  • -a: list all knobs
  • -d: list only knobs with non-default settings
  • -v: add setting after each knob
  • -w: write addUserKnob commands
  • node: node to use
  • name-value-list: optional list to set knobs

If only a node is named, this outputs a list of the names of all the knobs in this node. The switches control exactly what is in the list:

  • -a makes it list all possible knobs. normally user interface things like the name and the tile's x and y position are hidden.
  • -d will skip knobs that appear to be set to their default values.
  • -v Alternate the knob names with their current setting. The setting is identical to what the knob command returns.
  • -w will add to the -v list commands that will create any missing user knobs on the target node if the resulting list is passed to the knobs command.

The optional second argument is an alternating name + setting list as output by this command with -v, it then sets the knobs to the given settings.

See also:
knob, values
values ( -ad  node

Get a list of the current values for all knobs in a node.

  • -a: list all knobs
  • -d: list only knobs with non-default settings
  • node: node to use

Returns an alternating list of knob names and the current value of the knob. This is different than the knobs command in that knobs returns the expressions and curves, while values returns the evaluation of the expressions.

See also:
knobs
nodes ( group 

Return a tcl list of all the child nodes of the group.

  • group: optional

If the group name is ommitted the current group (ie the group the user picked a menu item from the menubar of).

The returned list contains internal hexadecimal names, which are guaranteed to be unique for every node in the script. To get user-friendly names you should use "[knob $n.name]" where "$n" is each word returned by this command.

See also:
node, knobs
clone ( node type  args

Create a clone node that behaves identical to the original.

  • node: original node
  • type: optional class of the original node
  • args: optional list of name+value pairs for all the knobs

A cloned node shares the exact same properties with its original. Clones share the same set of knobs and the same control panel. However they can have different positions and connections in the render tree. Any clone, including the original, can be deleted at any time without harming any of its clones.

This command will attempt to create a clone of the given node. This will fail if the original node does not exist or does not have the type specified. If it fails and a type is given, that type and args are used to create a normal node.

See also:
node, clone_selected
clone_selected ( action 

Command to execute for the Clone menu item.

  • action: optional action, if "copy" it cuts the resulting clones to the clipboard.

This makes a clone of all selected nodes, preserving connections between them, and makes only the clones be selected.

See also:
clone
declone ( node 

Make the node not be a clone.

nyi, the Node::declone method needs to be fixed!

show_info ( node... 

Returns a long string of debugging information about each node and the operators it is currently managing. You should not rely on it's contents or format being the same in different versions of Nuke.

See also:
node, nodes, show, display
display ( command  nodecontext

Creates a dialog box showing the result of command.

Creates a window showing the result of command. The command is executed in the "context" of the given node, so this and a knob name in expressions refer to that node. In the window is an "update" button which causes the command to be run again.

  • -w width: set the width of the window in pixels
  • -t title: set the title of the window
  • command: the text returned by this TCL command will be shown in the box
  • node: if this node is changed, the dialog box will automatically update

Example:

 display {return "The color is [knob color]"} [selected_node] 
See also:
node, panel
show_dag ( groupnode 

Show the tree view of one or more group nodes.

  • one or more groupnodes
See also:
node, nodes, show_info, show_dag, show_settings
zoom ( group scale center_x  center_y

Change the zoom and pan of a group's display.

  • group: optional group
  • scale: new zoom factor
  • center_x: optional center
  • center_y: optional center

If the group name is ommitted the current group (ie the group the user picked a menu item from the menubar of).

If no other arguments are given this returns the current zoom factor.

If one argument is given, zoom is set to that factor, and the image is positioned so the mouse is pointing at the same point. A zero or negative value will perform a zoom-to-fit.

If two more arguments are given the image is zoomed and then centered on that pont You probably want to use something like "zoom 1 $node.xpos $node.ypos" to show a particular node.

connect_viewer ( node

Connect a viewer input to a node.

  • n: input number
  • node: Node to connect, or 0

Some viewer in the current group is found, if there are no viewers one is created. The viewer is then altered to have at least n+1 inputs and then input n is connected to the given node.

This command is used by the numeric shortcuts in the DAG view menu.

autoplace ( nodelist 

Automatically place nodes, so they do not overlap.

  • node or nodelist
See also:
nodes, autoplace_snap
autoplace_snap ( nodelist 

Move one or more nodes to the closest grid position.

  • node or nodelist
See also:
knobs
input ( node number  input_node

Return or set an input of a node.

  • node: this is the node on the pointy side of the arrow
  • number: input number starting with 0 (0=B, 1=A)
  • input_node: optional - connect the input to this node

Attempts to make illegal connections (loops, between groups, wrong type of node) will produce an error.

See also:
inputs, node
inputs ( node  new_number
  • node
  • new_number: number of inputs requested

Get how many inputs the node has. Normally this is a constant but some nodes have a variable number, the user can keep connecting them and the count will increase.

Attempting to set the number will just disconnect all inputs greater or equal to new_number. For a variable input node this may decrease inputs to the new value. For most nodes this will have no effect on the value of inputs.

See also:
input, node
selected_node (

Returns the "node the user is thinking about".

If several nodes are selected, this returns one of them. The one returned will be an "output" node in that no other selected nodes use that node as an input. If you are interested in exactly what order the user clicked on nodes use the stack command. [selected_node] is usually the same as [stack 0] but not always!

If no nodes are selected, then if the last thing typed was a hotkey this returns the node the cursor is pointing at. If none, or the last event was not a hotkey, this produces a "No node selected" error. Most GUI commands that want to work on a node should use this to find the node.

See also:
selected_nodes, stack
selected_nodes (

List all the selected nodes Returns a tcl list of the names of all selected nodes in the current group. An attempt is made to return them in "useful" order where inputs are done before the final node, so commands applied to this list go from top-down. Produces an error if there are no selected nodes.

See also:
selected_node, stack
dependencies ( nodelist 

List all nodes referred to by these nodes. Return all nodes that the listed nodes read information from, that are not themselves in the list. You can use switches to select what types of referral are looked for:

  • -e = expressions
  • -i = visible input pipes
  • -h = hidden input pipes. The default is to look for all types of connections.

See also:
dependent_nodes
dependent_nodes ( nodelist 

List all nodes that refer to these nodes Return all nodes that read information from any nodes in the list, that are not themselves in the list. You can use switches to select what types of referral are looked for:

  • -e = expressions
  • -i = visible input pipes
  • -h = hidden input pipes. The default is to look for all types of connections.

See also:
dependencies
frame ( value 

Return or set the current frame number.

Returns the current frame. Normally this is the frame number set in the root node, typically by the user moving the frame slider in a viewer.

The returned value actually depends on the "context". If you have a timewarp, doing "in TimeWarp1.input {frame}" will give you a different number. If you put "[frame]" into a function curve, then the expression "knobname(10)" will return 10, as frame will evaluate to the number passed to the expression. Unlocked viewers have local frame numbers, too.

If a number is given, it sets the current frame number to that number. If the current context is the root this changes the root frame.

make_timecode ( startcode  ,
fps  ,
startframe   

Returns a timecode string in the format HH:MM:SS:FF.

  • startcode The start of the time code. Must be in the format of either HH:MM:SS:FF or HH;MM;SS;FF (for drop frames). Drop frames are assumed when the ; is used to delimit the time code, if the frame rate is 29.97 or 59.94.
  • fps The frame rate to use to generate the time codes per frame of output. To write the time codes in drop frame format, the start code must have semi-colons (;) in it, and the frame rate must be one of the frame rates that support drop frames (29.97 or 59.94).
  • startframe The start frame
x (

Return the current x value in Color/Math/Expression. This lets you embed tcl in square brackets into the expressions and have it produce a different value for each pixel.

Warning: calling tcl from inside Expression is really slow!

See also:
frame y Expression

Return the current y value in Color/Math/Expression. This lets you embed tcl in square brackets into the expressions and have it produce a different value for each pixel.

Warning: calling tcl from inside Expression is really slow!

See also:
frame x Expression

Return the current frame number.

See also:
frame, t
delete ( nodelist 

Delete nodes.

  • node or nodelist

The named node(s) are deleted. They can be recovered with an undo.

argv ( index 

Returns command line arguments.

  • index into command line parameters

Returns a string argument given on the command line when Nuke was invoked. The first word after the script name is [argv 0], the second is [argv 1], etc.

You can put [argv 0] into a filename or other string so that the filenames are specified on the command line. If you put this in a file writer, be sure to set the "file type" back to blank if you want the user to be able to specify the file type by the extension of the filename. You can also use this command as part of a filename, for instance the reader can use "[argv 0]" and the writer can use "[file rootname [argv 0]].jpeg" to force the output to be the same name as the input but with a ".jpeg" extension.

You can also put [argv n] into math expressions. The argument must then be a number (unfortunately it cannot be an expression). An annoyance is that if the -F flag specifying a frame range is not given, Nuke treats all trailing arguments that consist of only digits, dash, comma, or slash as frame ranges for backwards compatibility with older versions and strips them off before argv gets a chance to look at them. The only way around this is to use -F to specify a frame range, design your command so that the last argument is not a number, or require your users to put a decimal point into the number so that it doesn't make sense as an old style frame range. Using -F to specify framerange is recommended.

You can run the script with "nuke -x \a scriptname \a argv0 \a argv1 \a frames" If no frames are given it will run the range given on the root settngs (to make the script more useful, change this range to 1,1 so that the default behavior is to do one frame). Unix users can make the script look like a program by turning on the executable bit, and perhaps editing the shebang (#!) line at the start of the file. Windows users can use a batch file for the same effect.

If the argument is missing it produces an error and the script will fail. This will happen even if the node is disabled or not used due to a switch, so to allow variable argument lists, a negative index does not fail but instead returns the string "0". This allows you to put in expressions for the index to avoid failures. For instance "[argv [argc]-1]" will give you the last argument, and you can use "[argc]" in switch expressions so that the script works.

See also:
argc
argc (

Returns number of command line arguments.

Returns how many extra words were put on the command line between the script name and any frame ranges. These can be read with the argv command.

See also:
argv
filename_list (

List all files in a directory the Nuke way.

Returns a list of all files in a directory, but with "sequences" of names with sequential numbers in them reduced to the form that is used as filenames by file readers: "foo.%04d.rgb 1-10"

recent_file ( index 

Return a filename from the recent-files list.

  • index into the list, 1 = most recent Returns a filename, or returns an error if the index is greater than the length of the list.
    See also:
    add_recent_file
add_recent_file ( filename 

Add a file to the recent-files list.

  • filename name to add Acts as though you just visited the given file. It is added or moved to index 1 in the recent_file list. This is done automatically by Nuke when you open or save any file in gui mode.
    See also:
    recent_file
load ( plugins... 

Load a plugin.

  • plugin name or filename
Returns:
full filename and path of the plugin found

You can force a certain plugin to load with this command. If the plugin has already been loaded nothing happens.

If there is no slash in the name then the plugin_path is searched for it. If there is a slash then the name is used directly as a filename, if it does not start with a slash the name is relative to the directory containing any plugin being currently loaded.

If no filename extension is provided, it will try appending ".so" (or whatever is appropriate for your OS) and then by trying to append ".tcl".

This command can also be used to make one plugin load another. This is useful if you have a plugin that defines more than one command. If a plugin defines the commands A and B you can name it "A.so" and then make "B.tcl" that says "load ./A".

On Linux the tcl command for loading tcl plugins has been renamed "tcl_load" so you can call it.

See also:
unload, plugins
plugins ( switches  pattern...

Returns a list of plugins.

Returns a list of every loaded plugin, or every plugin available. By default each plugin is returned as the full pathname of the plugin file.

You can give a glob-style matching pattern and only the plugins whose filenames (not path) match a glob pattern will be returned. You can give more than one glob pattern. If you want all the binary plugins you should use "all_plugins *.$plugin_ext".

You can put switches before the glob patterns. Currently supported:

-all = Return all plugins in each of the plugin_path directories, rather than only the currently loaded plugins.

-nodir = Just put the filenames in the list, not the full path. There may be duplicates.

-- = Stop looking for switches, allows a glob pattern to start with dash.

See also:
load, plugin_path
plugin_name (

Returns the name of the plugin being currently loaded.

You can use this to generate filenames that are relative to the directory the plugin is in.

See also:
load, unload, plugins
plugin_exists_tcl (

Test for the existence of a plugin.

  • plugin name or filename
Returns:
1 if found, or 0 if not

This command tells you if a plugin with the given name exists in the plugin path.

If there is no slash in the name then the plugin_path is searched for it. If there is a slash then the name is used directly as a filename, if it does not start with a slash the name is relative to the directory containing any plugin being currently loaded.

If no filename extension is provided, it will try appending ".linuxfc4_intel" (or whatever your system is) and then by trying to append ".tcl".

See also:
unload, plugins
quit (

Exit Nuke.

If there were changes to the current script, Nuke will ask the user to save the changes, exit or cancel.

See also:
Root, modified, exit
bytes ( amount 

Convert large memory amounts into human readable format.

  • amount of bytes

If amount is 1024 or greater, bytes will divide it by 1024 and append the letter k. It will append M and G for Megabyte and Gigabyte quantities respectively.

plugin_path (

Returns a list of all the directories Nuke will search for plugins in.

The built-in default is ~/.nuke and the "plugins" directory from the same location the Nuke executable file is in. Setting the environment variable $NUKE_PATH to a colon-separated list of directories will insert those directories between them. You can further modify the plugin_path with plugin_addpath and plugin_appendpath, and often the init.tcl files in these directories will do so.

See also:
plugin_addpath, plugin_appendpath, ofx_plugin_path
ofx_plugin_path (

Returns a list of all the directories Nuke searched for OFX plugins in.

See also:
plugin_path
plugin_addpath ( path 
  • path(s)

Adds all the paths to the beginning of the Nuke plugin path. If the path already exists in the list of plugin paths, it is moved to the start. If this command is executed inside an init.tcl then the init.tcl in the path will be executed.

See also:
plugins, plugin_path, plugin_appendpath
plugin_appendpath ( path 
  • path(s)

Add a filepath to the end of the Nuke plugin path. If the path already exists in the list of plugin paths, it will remain at its current position. The init.tcl is not executed in this.

See also:
plugins, plugin_path, plugin_addpath
execute ( nodes  rangelist

Execute the current script for a specified frame range.

  • ?nodes?: any number of nodes to execute
  • rangelist: list of frame numbers to execute. Also 1-10 or 1,10 will be equal to all frames from 1 to 10, 1-10/2 or 1,10,2 will be a list of every other frame in that range.
    Returns:
    error if interrurpted by Ctrl-C or hitting cancel
    Execute the named nodes, which must all be Write or other executable operators. If no nodes are given then all executable nodes in the current group are executed. The ranges indicate what frames to run, they can be a single number, or "A,B" to do all frames between A and B inclusive, or "A,B,C" to do each C'th frame from A to the last one before or equal to B.

If Nuke is run with the GUI up, this will pop up a progress meter. If the user hits the cancel button this command will return a "cancelled" error.

If Nuke is run as a text command (with the -t switch) this prints a text percentage as it progresses. If the user types ^C (on Unix) it will return to the prompt, aborting all commands.

See also:
frames argv argc
frames ( type 

Return list of frames supplied on the command line to nuke.

  • type: first, last, all, ranges

All trailing command-line arguments that start with a number are parsed as "frame ranges" by Nuke. This will return these arguments. If none are given this acts as though root.first_frame,root.last_frame were given as the frame range.

[frames first] returns the lowest number.

[frames last] returns the highest number.

[frames all] returns a list of all frame numbers, expanding the ranges into individual numbers.

[frames ranges] returns frame ranges in a form that can be passed to execute. If no command line ranges were given this returns an empty list, not the root frame range.

[frames when expression] returns frame ranges when expression is non-zero.

[frames when expression every n] returns every nth frame where expression is non-zero.

See also:
execute argv argc
filename ( group 

Return the filename(s) this node or group is working with.

  • -v will replace %04d style sequences with the current frame number
  • node, if not given the current node is used

For a Read or Write operator (or anything else with a filename knob) this will return the current filename, based on the root.proxy settings and which of the fullsize/proxy filenames are filled in. All tcl expansion of commands and variables is done. However by default it will still have %04d sequences in it, use -v to get the actual filename with the current frame number.

If the node is a group, a search is done for executable (i.e. Write) operators and the value from each of them is returned. This will duplicate the result of calling execute on the group.

If no filenames are found, an empty string is returned.

See also:
nodes, execute
add_format ( w h x y r t pa  name

Add a new image format to the Nuke script.

tcl syntax:  add_format { w h ?x y r t? ?pa? name}

  • w, h: required - width in pixel
  • x, y, r, t: optional - image area, if smaller than 0, 0, w, h
  • pa: optional - pixel aspect ratio
  • name: required - format name

Create a new image format, which will show up on the pull-down menus for image formats. You must give a width and height and name. The xyrt rectangle describes the image area, if it is smaller than the width and height (for Acadamy aperature, for example). The pixel aspect is the ratio of the width of a pixel to the height.

See also:
formats
formats (

Return all available formats in a script.

Formats are returned as a tcl list. Each format contains8 elements: { width height xorigin yorigin right top aspect name }

See also:
add_format
add_channel ( name 

Add a named new channel to the Nuke script.

  • name: name of new channel

If a channel with this name already exists, nothing changes.

See also:
add_layer, layers, channels
add_layer ( layer  channel...

Add a new layer and channels to Nuke.

tcl syntax:  add_layer { name channel ... }

  • name: new layer name
  • channel...: up to eight channel names for the new layer

The full name of a Nuke channel consistes of the layer name, a dot, and one of the layer's channel names.

See also:
add_channel, layers
layers (

List layers.

See also:
add_channel, add_layer, channels
channels ( node 

List channels.

  • node: optional node, if given only the channels output by this node are listed. If not given, all channels known about are listed.
See also:
layers, add_channel, add_layer
sample ( node channel x y dx  dy

Return pixel values from an image.

Lets your tcl code look at pixel values. Notice that doing this requires the image to be calculated, so performance may be very bad if this is placed into an expression in a control panel.

The channel can be the name of a channel or an integer (starting at 1 for red).

x,y is the center of the area to sample. Note that integers are at the corners of pixels, to center on a pixel add .5 to both coordinates.

If the optional dx,dy are not given then the exact value of the square pixel that x,y lands in is returned. This is also called "impulse filtering".

dx and dy are the size of the area to sample, centered on x,y. This produces a cubic filtered result. Any sizes less than 1, including 0, produce the same filtered result, this is correct based on sampling theory.

modified ( status 

Get or set the 'modified' flag in a script.

  • status: optional new value
Returns:
1 if script was modified, else 0

Setting the value will turn the indicator in the title bar on/off and will start or stop the autosave timeout. If no argument is provided this returns the current modified state.

See also:
quit
byte ( string  index

Utility function to extract single 8-bit values from a tcl string. Warning: if there are foreign letters this will return the bytes of the UTF-8 encoding. Use "string index \a string \a index" to get the UTF-8 character.

  • string
  • index starting at 0
    Returns:
    a 2 digit hexadecimal number, i.e. 0xFF
    See also:
    char, string
char ( unicode 

Turn single character number into a string.

  • unicode: character number

Any characters greater than 127 will turn into a multibyte UTF-8 string. However most parts of Nuke (such as labels and the Text node) and the tcl interpreter understand this.

Zero will turn into "\xc0\x80" which tcl understands. However most nuke operators will not draw this correctly.

See also:
byte, string
set_expression ( expression 

Set the expression for the current Knob.

  • expression: text describing the new expression
See also:
knob
fltk_color ( color_code 

Convert an FLTK color code into a packed RGBA.

  • color_code: either a color lookup table entry, or a packed RGB value

Packed RGBA are stored in an unsigned integer: 0xRRGGBB00.

add_timeout ( timeout node  script

Add a timeout that will run a script after some elapsed time.

  • timeout in seconds, fractions are possible, i.e 0.5
  • node: optional script context node
  • script: after the timeout elapses, Nuke will run this script, if found
version ( testversion 

Return the nuke version, or check a version number.

Just "version" will return a floating-point number describing the current nuke build. The number is M.nbbb, where M is the major number (4), n is the minor number (6), and bbb is the build number.

If you give an argument, a warning is produced if it is greater than this Nuke version. In addition smaller numbers are stored internally and may modify the parsing of scripts for back compatibility. This stored number is reset when the script is done loading.

Newer versions of Nuke - from 6.0v1 upwards - may specify an additional parameter for the release and phase numbers (e. g. v1b5) to allow version numbers to be unambiguous. Older versions of Nuke will ignore this additional parameter.

  • version_float: a floating point number representing the version this script was saved in
  • rel_phase: an optional string such as "v1b5" to specify the release and phase numbers. If not specified, the version is obtained from the floating point number only (e. g. 5.1200 = 5.1v2); otherwise, only the major and minor numbers are used from the first argument, and the release and phase are taken from this one (e. g. 5.12345 v1b7 = 5.1v1b7). Nuke versions from 6.0v1 and onwards use the two parameter format.
See also:
$version_major, $version_minor, $version_build, $nuke_version_alphabeta, $nuke_version_long, $version_long, version
error_node (

Return node that produced an error.

If in an expression node.error returned true, you can use this command to get the node that actually reported the error. This may be some input somewhere above the node named in the expression. If there is no error this returns 0.

See also:
error_message
error_message (

Return error message.

If in an expression node.error returned true, you can use this command to get the error message. If there is no error this returns an empty string.

See also:
error_node
memory ( command  arg

Get/set information about memory usage.

  • command word
  • arg, optional argument to command

All amounts are in bytes. Use math like "n*1024*1024" to get megabytes, etc. The return value can be printed in a more user-friendly version by passing it as an argument to the bytes command.

Commands are:

  • info ?node? : returns a report about all the users of memory and some other status information. If a node is provided, only users of memory that belong to that node are printed (group nodes other than root are not yet implemented).
  • free ?amount? : tries to reduce usage to the given amount. If the amount is not given zero is used, but it also halts any currently running update, which will unlock and free lots more memory, but it will take a lot longer for that update to restart again.
  • usage : return the current memory usage (this is the memory that this can potentially free, so it is less than the amount of RAM the program is actually using).
  • max_usage ?amount? : return or set the maximum memory usage. If usage goes over this then free is automatically called.
  • total_ram : return the total amount of RAM this machine has.
  • total_vm : return the operating system limit of how much RAM a program can use. On 32 bit machines this may be less than total_ram!
  • free_count ?amount? : return how many times free was called by the usage going over max_usage (does not count calls to free by this command). You can also set the counter to any value, most useful for resetting it to zero.
  • new_handler_count ?amount? : return how many times "free 0" was called by the systems memory allocator indicating that it had run out of memory. This is not good! You can also set the counter to any value, most useful for resetting it to zero.
See also:
bytes
undo (

No arguments: perform the most recent undo

"undo count" : return how many undos there are

"undo cancel" : undoes the pending undo being created, thus returning the script to the state it was before the current tcl command was started.

"undo N" : return a string describing the n'th undo.

"undo -l N" : return a much longer description of the undo

python (

Run a python command returning the result as a TCL string.

All the arguments are appended with spaces and the result sent to the python interpreter.

  • -eval arg ... - evaluates as a Python expression. Returns a string. This is the default behavior.
  • -exec arg ... - evaluates as arbitrary code. No return value.
screen_width (

Returns the width of a node in the DAG.

Note that this property is read only.

screen_height (

Returns the height of a node in the DAG.

Note that this property is read only.

script_new ( name 

Start a new script.

  • name: optional script name

Makes a new Untitled script and creates a new root node for it and displays the window. Currently this is implemented by forking a new copy of nuke, so the calling script will not be able to access the new script.

See also:
script_open, script_save, * script_save_as, script_exit, script_close
show_settings (

Show the settings of the current group.

This opens the root or group setting Panel.

See also:
show, show_dag
get_input ( prompt 

Pops up a box that lets the user type in an arbitrary string.

  • prompt: present the user with this message
  • ?default?: default value for the input field
    Returns:
    user input
    See also:
    get_filename, get_clipname, panel
get_filename ( prompt pattern  default

Pops up a file chooser dialog box.

  • prompt: present the user with this message
  • ?pattern?: file selection pattern
  • ?default?: default filename and path
  • ?favorites?: which favorites to use: can be "image", "script", "font"
    Returns:
    user input
    You can use the pattern to restrict the displayed choices to matching filenames, normal Unix glob rules are used here.
    See also:
    get_input, get_clipname, panel
get_clipname ( prompt pattern  default

Pops up a file chooser dialog box.

  • prompt: present the user with this message
  • ?pattern?: file selection pattern
  • ?default?: default filename and path
    Returns:
    user input
    You can use the pattern to restrict the displayed choices to matching filenames, normal Unix glob rules are used here. Get_clipname compresses lists of filenames that only differ by an index number into a single entry called a 'clip'.
    See also:
    get_input, get_filename, panel
ask ( prompt 

Show a Yes/No dialog.

  • prompt: present the user with this message
    Returns:
    user choice
    This function shows a Yes/No dialog with the given message. ask will return 1 if the user clicked 'yes' or 0 otherwise.
    See also:
    message, alert, panel
message ( prompt 

Show an info dialog box.

  • prompt: present the user with this message

Pops up an info box (with a 'i' and the text message) and waits for the user to hit the OK button.

See also:
ask, alert, panel
alert ( prompt 

Show an alert dialog box.

  • prompt: present the user with this message

Pops up an alert box (with a '!' and the text message) and waits for the user to hit the OK button.

See also:
ask, message, panel
menu ( name key icon tooltip  command

Add a new menu item to a menu bar or replace it.

  • name: name and 'path' of the menu item
  • ?key?: shortcut key
  • ?icon?: filename of an image to use as icon
  • ?tooltip?: short text to explain the function of the menu item
  • command: tcl command to execute when menu is selected

The menu item name is a slash-separated list of title and submenus, for instance "File/Execute this...". If '&' is given this makes a MicroSoft style underscored shortcut out of the next letter. To get a real '/', '\', or '&', use '\/', '\\', and '&&'.

The shortcut, if given, indicates a keyboard shortcut. "#A" means alt+A. "^A" means control+A. "A" means upper-case A. "a" means lower-case "a". "F1" is function key 1. There are also ways to bind the arrows and other keys but they are kind of obscure. Use "" if you want no shortcut.

The icon names an image to put to the left of the text. If you only want to see the icon, put "@;" before the last word of the name (as in "/menu/submenu/@;item"). Use "" if you want no icon.

The tooltip will be displayed when the user points the mouse at the item (currently only for top-level items). Use "" for no tooltip.

The command should be surrounded by '{' and '}' and is the scripting commands this item should execute.

See also:
menubar
get_color ( prompt  default

Show a color chooser dialog.

  • prompt: present the user with this message
  • ?default?: default color value
    Returns:
    return the selected color
    This function shows a simple color chooser dialog. The format of the default color is either a value 0..255 in the fltk lookup table, or packed 8bit rgb, multiplied by 256, or in binary: 0xRRGGBB00.
panel ( -w title  list

Create a dialog box with multiple UI elements.

This will pop up a modal dialog box with widgets the user can edit, and ok/cancel buttons on the bottom. If the cancel button is hit this returns an error. If ok is hit, the edited values are stored into tcl variables. You can use the same tcl variables to initialize the widgets.

tcl syntax:  panel ?-w#? ?title? {{label var type args}...}

  • ?-w#?: optional - use -w followed by a number to set the desired panel width in pixels
  • ?title?: optional panel title the following arguments can be repeated as many times as needed
  • label: this is the label of the following UI element
  • var: this variable contains the default value and the result after the panel is closed
  • args depend on the UI desired element:
    • f: a text line with folder button to enter an search filenames
    • f2: a text line with folder button to enter an search clips
    • m: multiline text input (about 4 lines)
    • m2: larger multiline input (8 lines)
    • n: notepad - huge text field. n can be followed by the number of lines required, i.e. n3
    • b: boolean check box
    • c: RGB color chip
    • e: enumeration pulldown, add tcl list of enumeration values
    • F: text font pulldown menu
    • x: expression input (needs some additinal variables)
    • (none): single line text input
    • buttons: list of words for the buttons on the bottom
See also:
message, ask, alert
menubar ( name position  size

Create a user menu bar in the DAG view.

  • -spacing n: set the spacing between menu items
  • -bg image: optional background image
  • name: access the menubar via this name
  • position: 1=top, 2=right, 3=bottom, 4=left
  • size: bar hight or width in pixels

This creates an additional menu bar anywhere around the main view. Menu bars can hold additonal commands and shortcuts, called menu items.

See also:
menu
animations (

Returns a list of animatable things the user wants to work on.

If this is a command being executed from a menu item in a curve editor, a list of the names of all selected curves is returned. If this list is empty a "No curves selected" error is produced.

If this is a command being executed from the pop-up list in a knob then a list of all the fields in the knob is returned.

If this is a command being executed from the right-mouse-button pop-up list in a field of a knob, the name of that field is returned.

Otherwise this produces an error indicating that the command requries a knob context. You can get such a context by doing "in <knob> {command}"

Also see the "selected" argument to the animation command.

See also:
in, animation, animation_start, animation_end, animation_increment
animation_start (

Return first frame of animation.

Returns the starting frame (or x value) for the currently selected animations.

See also:
animation, animations, animation_end, animation_increment
animation_end (

Return last frame of animation.

Returns the last frame (or x value) for the currently selected animations.

See also:
animation, animations, animation_start, animation_increment
animation_increment (

Return frame interval.

Returns a recommended interval between samples of the currently selected animation.

See also:
animation, animations, animation_start, animation_end
animation ( name  command...

Does operations on an animation curve.

The following commands are supported:

  • clear deletes all the keys from the animation.
  • erase index ?last_index? removes all keyframes between index ans last_index
  • expression ?newvalue? returns or sets the expression for the animation. The default is "curve" or "y" which returns the interpolation of the keys.
  • generate start end increment field expression ?field expression? ... generates an animation with start, end, and increment. Multiple field/expression pairs generate a keyframe. Possible field commands are:
    • x sets the frame number for the next keyframe
    • y sets the keyframe value
    • dy sets the left slope
    • ldy sets left and righ slope to the same value
    • la and ra are the length of the slope handle in x direction. A value of 1 generates a handle that is one third of the distance to the next keyframe.
  • index x returns the index of the last key with x <= t, return -1 for none.
  • is_key return non-zero if there is a key with x == t. The actual return value is the index+1.
  • move field expression ?field expression? replaces all selected keys in an animations with new ones as explained above in generate
  • name returns a user-friendly name for this animation. This will eliminate any common prefix between this animation and all other selected ones, and also replaces "mangled" names returns by animations with nice ones.
  • size returns the number of keys in the animation.
  • test errors if no points in the animation are selected
  • y index ?newvalue? gets or sets the value of an animation.
  • x index ?newvalue? gets or sets the horizontal postion of a key. If the animation contains an expression or keyframes, the new value will be overridden.
See also:
animations
script_open ( filename 

Open an existing script.

  • filename: optional script file name

Opens a new script and root window containing the contents of the named file. Produces an error if the file does not exist or if it cannot be read.

If no script name is given, or the script name is a directory, Nuke will open a file chooser dialog.

See also:
script_new, script_save, script_save_as, script_exit, script_close
script_save_as ( filename 

Save the current script.

  • filename: script file name

If filename is missing or is the name of a directory, this pops up a file chooser. It then changes the name of the current script to this filename and writes it to disk.

If the file already exists, it will ask the user if they should overwrite it. If you don't want this question, you should instead set root.name to the file name and do script_save instead.

See also:
script_new, script_open, script_save, script_exit, script_close
script_save ( filename 

Save the current script.

  • filename: optional script file name

If filename is given, writes to that file, without changing the script name (use script_save_as to change the name). If no filename is given it writes the script's filename, and pops up a file chooser if the script is currently Untitled.

See also:
script_new, script_open, script_save_as, script_exit, script_close
script_exit (

Exit Nuke.

Checks all scripts and pops up save options dialogs if they were changes since the last save. If the user doesn't cancel, this will exit Nuke.

See also:
script_new, script_open, script_save, script_save_as, script_close
script_close (

Close the current script or group.

This is for a "close" menu item. It asks if the user wants to save the changes and then clears out the script and replaces it with an untitled one. This is also called by the window close button except if it exits the program rather than clearing out the root.

See also:
script_new, script_open, script_save, script_save_as, script_exit
node_paste ( filename 

Paste nodes from a script file or the clipboard.

  • filename

This function executes the script stored in a file. It is assumed the script is the result of a node_copy command. The filename can be "%clipboard%" to paste the operating system's clipboard contents.

See also:
node_copy, _node_delete
node_copy ( filename 

Copy all selected nodes into a file or the clipboard.

  • filename

The filename can be "%clipboard%" to indicate the operating system's cut & paste buffer.

See also:
node_paste, _node_delete
_node_delete ( filename 

Delete all selected items in a DAG_View.

Remove all selected nodes from the DAG. This method tries to keep arrows connected as well as possible.

See also:
node_paste, node_copy