nuke

Set up the ‘nuke’ module

This initializes Nuke’s internal modules and brings the symbols into this namespace

Functions

activeViewer

Return an object representing the active Viewer panel.

addAfterBackgroundFrameRender

Add code to execute after each frame of a background render. The call must be in the form of: def foo(context): pass.

addAfterBackgroundRender

Add code to execute after any background renders. The call must be in the form of: def foo(context): pass.

addAfterFrameRender

Add code to execute after each frame of a render

addAfterRecording

Add code to execute after viewer recording

addAfterRender

Add code to execute after any renders

addAfterReplay

Add code to execute after viewer replay

addAutoSaveDeleteFilter

Add a function to modify the autosave filename before Nuke attempts delete the autosave file.

addAutoSaveFilter

Add a function to modify the autosave filename before Nuke saves the current script on an autosave timeout.

addAutoSaveRestoreFilter

Add a function to modify the autosave restore file before Nuke attempts to restores the autosave file.

addAutolabel

Add code to execute on every node to produce the text to draw on it in the DAG.

addBeforeBackgroundRender

Add code to execute before starting any background renders. The call must be in the form of: def foo(context): pass.

addBeforeFrameRender

Add code to execute before each frame of a render

addBeforeRecording

Add code to execute before viewer recording

addBeforeRender

Add code to execute before starting any renders

addBeforeReplay

Add code to execute before viewer replay

addDefaultColorspaceMapper

Add a function to modify default colorspaces before Nuke passes them to Readers or Writers.

addFavoriteDir

Add a path to the file choosers favorite directory list.

addFilenameFilter

Add a function to modify filenames before Nuke passes them to the operating system.

addFormat

Create a new image format, which will show up on the pull-down menus for image formats.

addKnobChanged

Add code to execute when the user changes a knob The knob is availble in nuke.thisKnob() and the node in nuke.thisNode().

addNodePresetExcludePaths

Adds a list of paths that will be excluded from Node preset search paths.

addOnCreate

Add code to execute when a node is created or undeleted

addOnDestroy

Add code to execute when a node is destroyed

addOnScriptClose

Add code to execute before a script is closed

addOnScriptLoad

Add code to execute when a script is loaded

addOnScriptSave

Add code to execute before a script is saved

addOnUserCreate

Add code to execute when user creates a node

addRenderProgress

Add code to execute when the progress bar updates during any renders

addSequenceFileExtension

Adds the input file extension to the list of extensions that will get displayed as sequences in the file browser.

addToolsetExcludePaths

:param paths Sequence of paths to exclude.

addUpdateUI

Add code to execute on every node when things change.

addValidateFilename

Add a function to validate a filename in Write nodes.

addView

Deprecated.

afterBackgroundFrameRender

afterBackgroundRender

afterFrameRender

afterRecording

afterRender

afterReplay

alert

Show a warning dialog box.

allNodes

List of all nodes in a group.

animation

Does operations on an animation curve.

animationEnd

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

animationIncrement

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

animationStart

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

animations

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

applyPreset

Applies a given preset to the current node.

applyUserPreset

Applies a given user preset to the current node.

ask

Show a Yes/No dialog.

askWithCancel

Show a Yes/No/Cancel dialog.

autoSaveDeleteFilter

Internal function.

autoSaveFilter

Internal function.

autoSaveRestoreFilter

Internal function.

autolabel

autoplace

Deprecated.

autoplaceSnap

Move node to the closest grid position.

autoplace_all

Performs autoplace of all nodes in current context group.

autoplace_snap_all

Performs autoplace snap of all nodes in current context group.

autoplace_snap_selected

Performs autoplace snap of all selected nodes in current context group.

beforeBackgroundRender

beforeFrameRender

beforeRecording

beforeRender

beforeReplay

cacheUsage

Get the total amount of memory currently used by the cache.

canCreateNode

This function can be used to determine whether it is possible to create a node with the specified node class.

cancel

Cancel an in-progress operation.

center

Return the center values of a group's display, these values are suitable to be passed to nuke.zoom as the DAG center point.

channels

Deprecated.

choice

Shows a dialog box with the given title and prompt text, and a combo box containing the given options.

clearBlinkCache

Clear the Blink cache for all devices.

clearDiskCache

Clear the disk cache of all files.

clearRAMCache

Clear the RAM cache of all files.

clearTabMenuFavorites

Uncheck every favourite node in tab search menu.

clearTabMenuWeighting

Set the weight of each node to 0 in tab search menu.

clone

Create a clone node that behaves identical to the original.

cloneSelected

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

collapseToGroup

Moves the currently selected nodes to a new group, maintaining their previous connections.

collapseToLiveGroup

Moves the currently selected nodes to a new group, maintaining their previous connections.

connectNodes

Deprecated.

connectViewer

Connect a viewer input to a node.

createLiveInput

Creates a new LiveInput and populates the fileand liveGroupknobs according to the filename and LiveGroup name of the parent group

createNode

Creates a node of the specified type and adds it to the DAG.

createScenefileBrowser

Pops up a scene browser dialog box.

createToolset

Creates a tool preset based on the currently selected nodes.

critical

Puts the message into the error console, treating it like an error.

debug

Puts the message into the error console, treating it like a debug message, which only shows up when the verbosity level is high enough.

defaultColorspaceMapper

Called by libnuke.

defaultFontPathname

Get the path to Nukes default font.

defaultNodeColor

Get the default node colour.

delete

The named node is deleted.

deletePreset

Deletes a pre-created node preset

deleteUserPreset

Deletes a pre-created user node preset

deleteView

Deprecated.

dependencies

List all nodes referred to by the nodes argument. 'what' is an optional integer (see below).

dependentNodes

List all nodes referred to by the nodes argument. 'what' is an optional integer (see below).

display

Creates a window showing the result of a python script.

duplicateSelectedNodes

Creates a duplicate of all selected nodes in the current script context group

endGroup

Deprecated.

error

Puts the message into the error console, treating it like an error.

execute

Execute the named Write node over the specified frames.

executeBackgroundNuke

Run an instance of Nuke as a monitored sub process.

executeInMainThread

Execute the callable 'call' with optional arguments 'args' and named arguments 'kwargs' i n Nuke's main thread and return immediately.

executeInMainThreadWithResult

Execute the callable 'call' with optional arguments 'args' and named arguments 'kwargs' in Nuke's main thread and wait for the result to become available.

executeMultiple

Execute the current script for a specified frame range.

executing

Returns whether an Executable Node is currently active or not.

exists

Check for the existence of a named item.

expandSelectedGroup

Moves all nodes from the currently selected group node into its parent group, maintaining node input and output connections, and deletes the group.

expr

expression(s) -> float

expression

Parse a Nuke expression.

extractSelected

Disconnects the selected nodes in the group from the tree, and shifts them to the side.

filename

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

filenameFilter

forceClone

return:

True if succeeded, False otherwise.

forceLoad

Force the plugin to be fully instantiated.

fork

Forks a new instance of Nuke optionally with the contents of the named file.

formats

return:

List of all available formats.

frame

Return or set the current frame number.

fromNode

Return the Node n as a string.

getAllUserPresets

Gets a list of all current user presets

getClipname

Pops up a file chooser dialog box.

getColor

Show a color chooser dialog and return the selected color as an int.

getColorspaceList

Get a list of all colorspaces listed in an enumeration knob.

getDeletedPresets

Gets a list of all currently deleted presets

getFileNameList

Retrieves the filename list.

getFilename

Pops up a file chooser dialog box.

getFonts

Return a list of all available font families and styles

getFramesAndViews

Pops up a dialog with fields for a frame range and view selection.

getInput

Pops up a dialog box with a text field for an arbitrary string.

getNodeClassName

Gets the class name for the currently selected node

getNodePresetExcludePaths

Gets a list of all paths that are excluded from the search for node presets.

getNodePresetID

Gets the node preset identifier for the currently selected node

getOcioColorSpaces

return:

list of strings

getPaneFor

Returns the first pane that contains the named panel or None if it can't be found.

getPresetKnobValues

Gets a list of knob values for a given preset

getPresets

Gets a list of all presets for the currently selected node's class

getPresetsMenu

Gets the presets menu for the currently selected node.

getReadFileKnob

Gets the read knob for a node (if it exists).

getRenderProgress

return:

The progress of the render. Can be 0 if there is no progress to report.

getToolsetExcludePaths

Gets a list of all paths that are excluded from the search for node presets.

getUserPresetKnobValues

Gets a list of knob values for a given preset

getUserPresets

Gets a list of all user presets for the currently selected node's class

hotkeys

Returns the Nuke key assignments as a string formatted for use in nuke.display().

inputs

Deprecated.

invertSelection

Selects all unselected nodes, and deselects all selected ones.

knob

Returns or sets the entire state of a knob.

knobChanged

knobDefault

Set a default value for knobs in nodes that belong to the same class.

knobTooltip

Set an override for a tooltip on a knob.

layers

Lists the layers in a node.

licenseInfo

return:

None

load

Load a plugin.

loadModuleFromPath

Load a Python file and return the module object

loadToolset

Loads the tool preset with the given file name.

localisationEnabled

Checks if localisation is enabled on a given Read_File_Knob.

localiseFiles

This functionality has been removed, please check the documentation

localizationEnabled

Checks if localization is enabled on a given Read_File_Knob.

makeGroup

Creates a new group containing copies of all the currently selected nodes.

maxPerformanceInfo

maxPerformanceInfo -> Get the max performance info for this session.

memory

DeprecationWarning: nuke.memory(cmd, value) is now deprecated, please use the new nuke.memory2 module instead.

menu

Find and return the Menu object with the given name.

message

Show an info dialog box.

modified

Deprecated.

nodeCopy

Copy all selected nodes into a file or the clipboard.

nodeDelete

Removes all selected nodes from the DAG.

nodePaste

Paste nodes from a script file or the clipboard.

nodeTypes

:param force_plugin_load bool True to force loading all plugins on the path before querying node types, defaults to False :return list of all loaded node types

nodesSelected

return:

true if any nodes are currently selected

numvalue

The numvalue function returns the current value of a knob.

oculaPresent

Check whether Ocula is present.

ofxAddPluginAliasExclusion

Adds the ofx effect name to a list of exclusions that will not get tcl aliases automatically created for them.

ofxMenu

Find all the OFX plugins (by searching all the directories below $OFX_PLUGIN_PATH, or by reading a cache file stored in $NUKE_TEMP_DIR), then add a menu item for each of them to the main menu.

ofxPluginPath

List of all the directories Nuke searched for OFX plugins in.

ofxRemovePluginAliasExclusion

Remove an ofx plugin alias exclusion that was previously added with .

onCreate

onDestroy

onScriptClose

onScriptLoad

onScriptSave

onUserCreate

openPanels

nodesSelected() -> List

pan

Return the pan values of a group's display.

performanceProfileFilename

return:

the profile filename if performance timers are in use, otherwise returns None.

pluginAddPath

Adds all the paths to the beginning of the Nuke plugin path.

pluginAppendPath

Add a filepath to the end of the Nuke plugin path.

pluginExists

This function is the same as load(), but only checks for the existence of a plugin rather than loading it.

pluginInstallLocation

The system-specific locations that Nuke will look in for third-party plugins.

pluginPath

List all the directories Nuke will search in for plugins.

plugins

Returns a list of every loaded plugin or every plugin available.

recentFile

Returns a filename from the recent-files list.

redo

Perform the most recent redo.

registerFlipbook

Register a flipbook application name into Nuke.

removeAfterBackgroundFrameRender

Remove a previously-added callback with the same arguments.

removeAfterBackgroundRender

Remove a previously-added callback with the same arguments.

removeAfterFrameRender

Remove a previously-added callback with the same arguments.

removeAfterRecording

Remove a previously-added callback with the same arguments.

removeAfterRender

Remove a previously-added callback with the same arguments.

removeAfterReplay

Remove a previously-added callback with the same arguments.

removeAutoSaveDeleteFilter

Remove a previously-added callback with the same arguments.

removeAutoSaveFilter

Remove a previously-added callback with the same arguments.

removeAutoSaveRestoreFilter

Remove a previously-added callback with the same arguments.

removeAutolabel

Remove a previously-added callback with the same arguments.

removeBeforeBackgroundRender

Remove a previously-added callback with the same arguments.

removeBeforeFrameRender

Remove a previously-added callback with the same arguments.

removeBeforeRecording

Remove a previously-added callback with the same arguments.

removeBeforeRender

Remove a previously-added callback with the same arguments.

removeBeforeReplay

Remove a previously-added callback with the same arguments.

removeDefaultColorspaceMapper

Remove a previously-added callback with the same arguments.

removeFavoriteDir

Remove a directory path from the favorites list.

removeFilenameFilter

Remove a previously-added callback with the same arguments.

removeFilenameValidate

Remove a previously-added callback.

removeKnobChanged

Remove a previously-added callback with the same arguments.

removeOnCreate

Remove a previously-added callback with the same arguments.

removeOnDestroy

Remove a previously-added callback with the same arguments.

removeOnScriptClose

Remove a previously-added callback with the same arguments.

removeOnScriptLoad

Remove a previously-added callback with the same arguments.

removeOnScriptSave

Remove a previously-added callback with the same arguments.

removeOnUserCreate

Remove a previously-added callback with the same arguments.

removeRenderProgress

Remove a previously-added callback with the same arguments.

removeUpdateUI

Remove a previously-added callback with the same arguments.

render

execute(nameOrNode, start, end, incr, views, continueOnError = False) -> None.

renderProgress

rescanFontFolders

Rebuild the font cache scanning all available font directories.

resetPerformanceTimers

Clears the accumulated time on the performance timers.

restoreWindowLayout

Restores a saved window layout.

resumePathProcessing

Resume path processing.

root

Get the DAG's root node.

runIn

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

sample

Get pixel values from an image.

saveEventGraphTimers

Save events in the event graph.

saveToScript

Saves the fileContent with the given filename.

saveUserPreset

Saves a node's current knob values as a user preset.

saveWindowLayout

Saves the current window layout.

scriptClear

Clears a Nuke script and resets all the root knobs to user defined knob defaults.

scriptClose

Close the current script or group.

scriptExit

Exit Nuke.

scriptName

Return the current script's file name

scriptNew

Start a new script.

scriptOpen

Opens a new script containing the contents of the named file.

scriptReadFile

Read nodes from a file.

scriptReadText

Read nodes from a string.

scriptSave

Saves the current script to the current file name.

scriptSaveAndClear

Calls nuke.scriptSave and nuke.scriptClear :param filename: Save to this file name without changing the script name in the project. :param ignoreUnsavedChanges: Optional. If set to True scripSave will be called, ignoring any unsaved changes :return: True when sucessful. False if the user cancels the operation. In this case nuke.scripClear will not be called.

scriptSaveAs

Saves the current script with the given file name if supplied, or (in GUI mode) asks the user for one using the file chooser.

scriptSaveToTemp

Saves the script to a file without modifying the root information or the original script

scriptSource

Same as scriptReadFile().

script_directory

selectAll

Select all nodes in the DAG.

selectConnectedNodes

Selects all nodes in the tree of the selected node.

selectPattern

Selects nodes according to a regular expression matching pattern, entered through an input dialog.

selectSimilar

Selects nodes that match a node in the current selection based on matchType criteria.

selectedNode

Returns the 'node the user is thinking about'.

selectedNodes

Returns a list of all selected nodes in the current group.

setPreset

Create a node preset for the given node using the supplied knob values

setReadOnlyPresets

Sets whether newly created presets should be added in read-only mode.

setUserPreset

Create a node preset for the given node using the supplied knob values

show

Opens a window for each named node, as though the user double-clicked on them.

showBookmarkChooser

Show bookmark chooser search box.

showCreateViewsDialog

pluginPath() -> string list

showDag

Show the tree view of a group node or opens a node control panel.

showInfo

Returns a long string of debugging information about each node and the operators it is currently managing.

showSettings

Show the settings of the current group.

splayNodes

Deprecated.

startEventGraphTimers

Start keeping track of events in the event graph.

startPerformanceTimers

Start keeping track of accumulated time on the performance timers, and display the accumulated time in the DAG.

stopEventGraphTimers

Stop keeping track of events in the event graph.

stopPerformanceTimers

Stop keeping track of accumulated time on the performance timers, and cease displaying the accumulated time in the DAG.

stripFrameRange

Strip out the frame range from a clipname, leaving a file path (still possibly with variables).

suspendPathProcessing

Suspend path processing.

tabClose

Close the active dock tab.

tabNext

Make the next tab in this dock active.

tcl

Run a tcl command.

thisClass

Get the class name of the current node.

thisGroup

Returns the current context Group node.

thisKnob

Returns the current context knob if any.

thisNode

Return the current context node.

thisPane

Returns the active pane.

thisParent

Returns the current context Node parent.

thisRoot

Returns the current context Root node.

thisView

Get the name of the current view.

toNode

Search for a node in the DAG by name and return it as a Python object.

toggleFullscreen

Toggles between windowed and fullscreen mode.

toggleViewers

Toggles all the viewers on and off.

toolbar

Find and return the ToolBar object with the given name.

tprint

Prints the values to a stream, or to stdout by default.

undo

Perform the most recent undo.

updateUI

usingOcio

usingOCIO() -> returns true if using OCIO instead of Nuke LUTs.

usingPerformanceTimers

return:

true if performance timers are in use.

validateFilename

value

The value function returns the current value of a knob.

views

List of all the globally existing views.

waitForThreadsToFinish

Returns true if Nuke should wait for any Python threads to finish before exitting.

warning

Puts the message into the error console, treating it like a warning.

zoom

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

zoomToFitSelected

Does a zoom to fit on the selected nodes in the DAG

Classes

AColor_Knob

AnimationCurve

AnimationKey

A control point for an animation curve. @var x The horizontal position of the point @var y The vertical position of the point @var lslope The derivative to the left of the point. If interpolation does not have USER_SET_SLOPE then this may not be correct until after evaluate() has been called. @var rslope The derivative to the right of the point. If interpolation does not have USER_SET_SLOPE then this may not be correct until after evaluate() has been called. @var la The left 'bicubic' value. This represents the horizontal position of the left bezier handle end, where 1.0 means 1/3 of the distance to the previous point. If both handles for a span are 1.0 then the horizontal interpolation is linear and thus the vertical interpolation a cubic function. The legal values are 0 to 3. Setting outside of this range will produce undefined results. @var ra The right 'bicubic' value, again the legal range is 0 to 3. @var interpolation Used to calculate all the slopes except for the left slope of the first key and the right slope of the last key. Legal values are: - USER_SET_SLOPE: If this bit is on, the slopes are fixed by the user and interpolation and extrapolation are ignored. - CONSTANT: The value of the curve is equal to the y of the point to the left. - LINEAR: slopes point directly at the next key. - SMOOTH: same as CATMULL_ROM but the slopes are clamped so that the convex-hull property is preserved (meaning no part of the curve extends vertically outside the range of the keys on each side of it). This is the default. - CATMULL_ROM: the slope at key n is set to the slope between the control points n-1 and n+1. This is used by lots of software. - cubic: the slope is calculated to the only cubic interpolation which makes the first and second derivatives continuous. This type of interpolation was very popular in older animation software. A different cubic interpolation is figured out for each set of adjacent points with the CUBIC type. - for the smooth, CATMULL_ROM, and CUBIC interpolations, the first and last key have slopes calculated so that the second derivative is zero at them. @var extrapolation controls how to set the left slope of the first point and the right slope of the last point. Notice that this can be set differently on the first and last points, and is also remembered on all internal points so if end points are deleted old behavior is restored). - constant: the left slope of the first point, and the right slope of the last point, are set to zero. - linear: (and all other values): The left slope of the first point is set equal to it's right slope (calculated by the interpolation). the right slope of the last point is set equal to it's left slope. if there is only one point both slopes are set to zero. @var selected True if the point is selected in the curve editor.

Array_Knob

A knob which holds an array of values.

Axis_Knob

A knob which descibes a 3D affine transformation, by combining rotations around each principal axis, scaling, translation, skew and a pivot point.

BBox_Knob

A knob which holds a bounding box.

BackdropNode

BeginTabGroup_Knob

Begin a group of tabs.

Bitmask_Knob

Boolean_Knob

A knob which holds a boolean value.

Box

A 2-dimensional rectangle.

Box3_Knob

A 3-dimensional box.

CascadingEnumeration_Knob

Stores a single value between 0 and some maximum, and manages a set of keywords visible to the user.

ChannelMask_Knob

Channel_Knob

A knob which lets you select a layer and enable or disable individual channels.

ColorChip_Knob

A knob which holds a single unsigned int that describes a user interface colour.

Color_Knob

A knob which holds a color.

Disable_Knob

A knob which holds a boolean value representing the disabled state of a node.

Double_Knob

A knob which holds one or more double-precision floating point values.

EditableEnumeration_Knob

Stores a single value between 0 and some maximum, and manages a set of Radio Buttons visible to the user.

EndTabGroup_Knob

End a group of tabs.

Enumeration_Knob

Stores a single value between 0 and some maximum, and manages a set of keywords visible to the user.

EvalString_Knob

A string-valued knob which evaluates it's value as a TCL expression.

Eyedropper_Knob

File_Knob

A knob which holds a filename.

FnPySingleton

Font_Knob

A knob for choosing a font.

Format

A format.

Format_Knob

FrameRange

A frame range, with an upper and lower bound and an increment.

FrameRanges

A sequence of FrameRange objects with convenience functions for iterating over all frames in all ranges.

FreeType_Knob

A knob which holds a font family and style name.

GeoSelect_Knob

A knob which allows selection of parts of a 3D object.

Gizmo

GlobalsEnvironment

Dictionary-style object holding global Nuke state.

Group

Hash

A hash value for any number of objects.

Help_Knob

Histogram_Knob

IArray_Knob

Info

An info object stores x, y, w and h values.

Int_Knob

A knob which holds one or more integer values.

Keyer_Knob

Knob

A modifiable control that appears (unless hidden) in the panel for a node.

KnobType

Constants for use in parameters which require a knob type.

Layer

A layer is a set of channels.

Link_Knob

LinkableKnobInfo

A linkable knob description.

LiveGroup

LookupCurves_Knob

Provide a set of user-editable lookup curves.

Lut

Menu

MenuBar

MenuItem

MultiView_Knob

Multiline_Eval_String_Knob

A knob which evaluates it's string value as a TCL expression.

Node

NodeConstructor

Nodes

Obsolete_Knob

For internal use only.

OneView_Knob

OutputContext

Describes a context in which expressions can be evaluated.

Panel

PanelNode

ParticleChannels_Knob

Password_Knob

A knob which holds a password string value.

Precomp

ProgressTask

Pulldown_Knob

PyCustom_Knob

PyScript_Knob

A button that executes a Python script.

PythonCustomKnob

PythonKnob

A string-valued knob which evaluates its value as a Python expression.

Radio_Knob

Stores a single value between 0 and some maximum, and manages a set of Radio Buttons visible to the user.

Range_Knob

A knob which the minimum and maximum for a range of values.

Root

RunInMainThread

Scale_Knob

SceneGraph_Knob

Displays a list of items as a hierarchy.

SceneView_Knob

Displays a list of items as a hierarchy.

Script_Knob

A button which executes a TCL script.

String_Knob

A knob which holds a string value.

Tab_Knob

Groups subsequent knobs onto a tab.

Text_Knob

A knob which holds a string value.

ToolBar

Transform2d_Knob

UV_Knob

A knob which describes a texture coordinate.

Undo

Unsigned_Knob

A knob which holds one or more unsigned integer values.

View

A named view.

ViewView_Knob

Viewer

ViewerProcess

ViewerWindow

WH_Knob

A knob which holds width and height values.

XYZ_Knob

A knob which holds a 3D coordinate.

XY_Knob

A knob which describes a 2D position.

Exceptions

CancelledError

ColorspaceLookupError

an excpetion that should be thrown when looking up the colorspace