Nuke Python API Reference Logo
16.0
  • Introduction
  • Start-up Scripts
  • Getting Started
  • Nuke as a Python Module
  • Animation
  • Using the Command-line
  • Callbacks
  • Stereo
  • 3D
  • Roto and RotoPaint
  • Accessing Image Data
  • Custom Panels
  • Extending NUKE with PySide
  • Customizing the UI
  • Custom Flipbooks
  • Metadata
  • Working with Channels and Layers
  • Manipulating the Node Graph
  • Formats
  • Math
  • Asset Management Systems / Pipeline Integration
  • OpenAssetIO Integration
  • Graph Scope Variables / Multi-shot Set-up
  • Threading
  • Render Farm Integration (Concept)
  • Performance Profiling
  • Installing Plug-ins
  • Sample Scripts

API Reference

  • nuke
    • nuke.activeGroup
    • nuke.activeViewer
    • nuke.addAfterBackgroundFrameRender
    • nuke.addAfterBackgroundRender
    • nuke.addAfterFrameRender
    • nuke.addAfterRecording
    • nuke.addAfterRender
    • nuke.addAfterReplay
    • nuke.addAutoSaveDeleteFilter
    • nuke.addAutoSaveFilter
    • nuke.addAutoSaveRestoreFilter
    • nuke.addAutolabel
    • nuke.addBeforeBackgroundRender
    • nuke.addBeforeFrameRender
    • nuke.addBeforeRecording
    • nuke.addBeforeRender
    • nuke.addBeforeReplay
    • nuke.addDefaultColorspaceMapper
    • nuke.addFavoriteDir
    • nuke.addFilenameFilter
    • nuke.addFormat
    • nuke.addKnobChanged
    • nuke.addNodePresetExcludePaths
    • nuke.addOnCreate
    • nuke.addOnDestroy
    • nuke.addOnScriptClose
    • nuke.addOnScriptLoad
    • nuke.addOnScriptSave
    • nuke.addOnUserCreate
    • nuke.addRenderProgress
    • nuke.addSequenceFileExtension
    • nuke.addToolsetExcludePaths
    • nuke.addUpdateUI
    • nuke.addValidateFilename
    • nuke.addView
    • nuke.afterBackgroundFrameRender
    • nuke.afterBackgroundRender
    • nuke.afterFrameRender
    • nuke.afterRecording
    • nuke.afterRender
    • nuke.afterReplay
    • nuke.alert
    • nuke.allNodes
    • nuke.animation
    • nuke.animationEnd
    • nuke.animationIncrement
    • nuke.animationStart
    • nuke.animations
    • nuke.applyPreset
    • nuke.applyUserPreset
    • nuke.ask
    • nuke.askWithCancel
    • nuke.autoSaveDeleteFilter
    • nuke.autoSaveFilter
    • nuke.autoSaveRestoreFilter
    • nuke.autolabel
    • nuke.autoplace
    • nuke.autoplaceSnap
    • nuke.autoplace_all
    • nuke.autoplace_snap_all
    • nuke.autoplace_snap_selected
    • nuke.beforeBackgroundRender
    • nuke.beforeFrameRender
    • nuke.beforeRecording
    • nuke.beforeRender
    • nuke.beforeReplay
    • nuke.cacheUsage
    • nuke.canCreateNode
    • nuke.cancel
    • nuke.center
    • nuke.channels
    • nuke.choice
    • nuke.clearAssetCache
    • nuke.clearBlinkCache
    • nuke.clearDiskCache
    • nuke.clearGeoSelection
    • nuke.clearRAMCache
    • nuke.clearTabMenuFavorites
    • nuke.clearTabMenuWeighting
    • nuke.clone
    • nuke.cloneSelected
    • nuke.collapseToGroup
    • nuke.collapseToLiveGroup
    • nuke.collapseToVariableGroup
    • nuke.connectNodes
    • nuke.connectViewer
    • nuke.createLiveInput
    • nuke.createNode
    • nuke.createScenefileBrowser
    • nuke.createToolset
    • nuke.critical
    • nuke.deassetize
    • nuke.debug
    • nuke.defaultColorspaceMapper
    • nuke.defaultFontPathname
    • nuke.defaultNodeColor
    • nuke.delete
    • nuke.deletePreset
    • nuke.deleteUserPreset
    • nuke.deleteView
    • nuke.dependencies
    • nuke.dependentNodes
    • nuke.display
    • nuke.duplicateSelectedNodes
    • nuke.endGroup
    • nuke.error
    • nuke.execute
    • nuke.executeBackgroundNuke
    • nuke.executeInMainThread
    • nuke.executeInMainThreadWithResult
    • nuke.executeMultiple
    • nuke.executing
    • nuke.exists
    • nuke.expandSelectedGroup
    • nuke.expr
    • nuke.expression
    • nuke.extractSelected
    • nuke.filename
    • nuke.filenameFilter
    • nuke.forceClone
    • nuke.forceLoad
    • nuke.fork
    • nuke.formats
    • nuke.frame
    • nuke.fromNode
    • nuke.getAllUserPresets
    • nuke.getClipname
    • nuke.getColor
    • nuke.getColorspaceList
    • nuke.getDeletedPresets
    • nuke.getFileNameList
    • nuke.getFilename
    • nuke.getFonts
    • nuke.getFramesAndViews
    • nuke.getGeoSelection
    • nuke.getInput
    • nuke.getNodeClassName
    • nuke.getNodePresetExcludePaths
    • nuke.getNodePresetID
    • nuke.getOcioColorSpaces
    • nuke.getPaneFor
    • nuke.getPresetKnobValues
    • nuke.getPresets
    • nuke.getPresetsMenu
    • nuke.getReadFileKnob
    • nuke.getRenderProgress
    • nuke.getToolsetExcludePaths
    • nuke.getUserPresetKnobValues
    • nuke.getUserPresets
    • nuke.hotkeys
    • nuke.inputs
    • nuke.invertSelection
    • nuke.knob
    • nuke.knobChanged
    • nuke.knobDefault
    • nuke.knobTooltip
    • nuke.lastHitGroup
    • nuke.layers
    • nuke.licenseInfo
    • nuke.link
    • nuke.linkSelected
    • nuke.load
    • nuke.loadModuleFromPath
    • nuke.loadToolset
    • nuke.localiseFiles
    • nuke.localizationEnabled
    • nuke.makeGroup
    • nuke.maxPerformanceInfo
    • nuke.menu
    • nuke.message
    • nuke.modified
    • nuke.nodeAtPath
    • nuke.nodeCopy
    • nuke.nodeDelete
    • nuke.nodePaste
    • nuke.nodeTypes
    • nuke.nodesSelected
    • nuke.numvalue
    • nuke.oculaPresent
    • nuke.ofxAddPluginAliasExclusion
    • nuke.ofxMenu
    • nuke.ofxPluginPath
    • nuke.ofxRemovePluginAliasExclusion
    • nuke.onCreate
    • nuke.onDestroy
    • nuke.onScriptClose
    • nuke.onScriptLoad
    • nuke.onScriptSave
    • nuke.onUserCreate
    • nuke.openPanels
    • nuke.pan
    • nuke.performanceProfileFilename
    • nuke.pluginAddPath
    • nuke.pluginAppendPath
    • nuke.pluginExists
    • nuke.pluginInstallLocation
    • nuke.pluginPath
    • nuke.plugins
    • nuke.recentFile
    • nuke.redo
    • nuke.registerFlipbook
    • nuke.removeAfterBackgroundFrameRender
    • nuke.removeAfterBackgroundRender
    • nuke.removeAfterFrameRender
    • nuke.removeAfterRecording
    • nuke.removeAfterRender
    • nuke.removeAfterReplay
    • nuke.removeAutoSaveDeleteFilter
    • nuke.removeAutoSaveFilter
    • nuke.removeAutoSaveRestoreFilter
    • nuke.removeAutolabel
    • nuke.removeBeforeBackgroundRender
    • nuke.removeBeforeFrameRender
    • nuke.removeBeforeRecording
    • nuke.removeBeforeRender
    • nuke.removeBeforeReplay
    • nuke.removeDefaultColorspaceMapper
    • nuke.removeFavoriteDir
    • nuke.removeFilenameFilter
    • nuke.removeFilenameValidate
    • nuke.removeKnobChanged
    • nuke.removeOnCreate
    • nuke.removeOnDestroy
    • nuke.removeOnScriptClose
    • nuke.removeOnScriptLoad
    • nuke.removeOnScriptSave
    • nuke.removeOnUserCreate
    • nuke.removeRenderProgress
    • nuke.removeUpdateUI
    • nuke.render
    • nuke.renderProgress
    • nuke.rescanFontFolders
    • nuke.resetPerformanceTimers
    • nuke.restoreWindowLayout
    • nuke.resumePathProcessing
    • nuke.root
    • nuke.runIn
    • nuke.sample
    • nuke.saveEventGraphTimers
    • nuke.saveToScript
    • nuke.saveUserPreset
    • nuke.saveWindowLayout
    • nuke.scriptClear
    • nuke.scriptClose
    • nuke.scriptExit
    • nuke.scriptName
    • nuke.scriptNew
    • nuke.scriptOpen
    • nuke.scriptReadFile
    • nuke.scriptReadText
    • nuke.scriptSave
    • nuke.scriptSaveAndClear
    • nuke.scriptSaveAs
    • nuke.scriptSaveToTemp
    • nuke.scriptSource
    • nuke.script_directory
    • nuke.selectAll
    • nuke.selectConnectedNodes
    • nuke.selectPattern
    • nuke.selectSimilar
    • nuke.selectedNode
    • nuke.selectedNodes
    • nuke.setGeoSelection
    • nuke.setPreset
    • nuke.setReadOnlyPresets
    • nuke.setUserPreset
    • nuke.show
    • nuke.showBookmarkChooser
    • nuke.showCreateViewsDialog
    • nuke.showDag
    • nuke.showInfo
    • nuke.showSettings
    • nuke.splayNodes
    • nuke.startEventGraphTimers
    • nuke.startPerformanceTimers
    • nuke.stopEventGraphTimers
    • nuke.stopPerformanceTimers
    • nuke.stripFrameRange
    • nuke.suspendPathProcessing
    • nuke.tabClose
    • nuke.tabNext
    • nuke.tcl
    • nuke.thisClass
    • nuke.thisGroup
    • nuke.thisKnob
    • nuke.thisNode
    • nuke.thisPane
    • nuke.thisParent
    • nuke.thisRoot
    • nuke.thisView
    • nuke.toNode
    • nuke.toggleFullscreen
    • nuke.toggleViewers
    • nuke.toolbar
    • nuke.tprint
    • nuke.undo
    • nuke.unlinkSelected
    • nuke.updateUI
    • nuke.usingOcio
    • nuke.usingPerformanceTimers
    • nuke.validateFilename
    • nuke.value
    • nuke.views
    • nuke.waitForThreadsToFinish
    • nuke.warning
    • nuke.zoom
    • nuke.zoomToFitSelected
    • nuke.AColor_Knob
    • nuke.AnimationCurve
    • nuke.AnimationKey
    • nuke.Array_Knob
    • nuke.Axis_Knob
    • nuke.BBox_Knob
    • nuke.BackdropNode
    • nuke.BeginTabGroup_Knob
    • nuke.Bitmask_Knob
    • nuke.BlinkEditorKnob
    • nuke.Boolean_Knob
    • nuke.Box
    • nuke.Box3_Knob
    • nuke.CascadingEnumeration_Knob
    • nuke.ChannelMask_Knob
    • nuke.Channel_Knob
    • nuke.ColorChip_Knob
    • nuke.Color_Knob
    • nuke.Disable_Knob
    • nuke.Double_Knob
    • nuke.EditableEnumeration_Knob
    • nuke.EndTabGroup_Knob
    • nuke.Enumeration_Knob
    • nuke.EvalString_Knob
    • nuke.Eyedropper_Knob
    • nuke.File_Knob
    • nuke.FnPySingleton
    • nuke.Font_Knob
    • nuke.Format
    • nuke.Format_Knob
    • nuke.FrameRange
    • nuke.FrameRanges
    • nuke.FreeType_Knob
    • nuke.GeoSelect_Knob
    • nuke.GeoSelection
    • nuke.GeoSelectionItem
    • nuke.Gizmo
    • nuke.GlobalsEnvironment
    • nuke.Group
    • nuke.Gsv_Knob
    • nuke.Hash
    • nuke.Help_Knob
    • nuke.Histogram_Knob
    • nuke.IArray_Knob
    • nuke.Info
    • nuke.Int_Knob
    • nuke.Keyer_Knob
    • nuke.Knob
    • nuke.KnobType
    • nuke.Layer
    • nuke.Link_Knob
    • nuke.LinkableKnobInfo
    • nuke.LiveGroup
    • nuke.LookupCurves_Knob
    • nuke.Lut
    • nuke.Menu
    • nuke.MenuBar
    • nuke.MenuItem
    • nuke.MultiView_Knob
    • nuke.Multiline_Eval_String_Knob
    • nuke.Node
    • nuke.NodeConstructor
    • nuke.Nodes
    • nuke.Obsolete_Knob
    • nuke.OneView_Knob
    • nuke.OutputContext
    • nuke.Panel
    • nuke.PanelNode
    • nuke.ParticleChannels_Knob
    • nuke.Password_Knob
    • nuke.PathExpression_Knob
    • nuke.Path_Knob
    • nuke.Precomp
    • nuke.ProgressTask
    • nuke.Pulldown_Knob
    • nuke.PyCustom_Knob
    • nuke.PyScript_Knob
    • nuke.PythonCustomKnob
    • nuke.PythonKnob
    • nuke.Radio_Knob
    • nuke.Range_Knob
    • nuke.Root
    • nuke.RunInMainThread
    • nuke.Scale_Knob
    • nuke.SceneGraph_Knob
    • nuke.SceneView_Knob
    • nuke.Script_Knob
    • nuke.String_Knob
    • nuke.Tab_Knob
    • nuke.Text_Knob
    • nuke.ToolBar
    • nuke.Transform2d_Knob
    • nuke.UV_Knob
    • nuke.Undo
    • nuke.Unsigned_Knob
    • nuke.View
    • nuke.ViewView_Knob
    • nuke.Viewer
    • nuke.ViewerProcess
    • nuke.ViewerWindow
    • nuke.WH_Knob
    • nuke.XYZ_Knob
    • nuke.XY_Knob
    • nuke.CancelledError
    • nuke.ColorspaceLookupError
  • nuke.curveknob
  • nuke.curvelib
  • nuke.gsv
  • nuke.localization
  • nuke.memory2
  • nuke.nukemath
  • nuke.rotopaint
  • nuke.splinewarp
  • nukescripts
Nuke Python API Reference
  • »
  • nuke »
  • nuke.Link_Knob

nuke.Link_Knob

class nuke.Link_Knob

Bases: Knob

Methods

Class

return

Class name.

ClassID

return

Class ID.

applyOverride

This function only affects link knobs that are placed on a LiveGroup node.

clearAnimated

Clear animation for channel 'c'.

clearFlag

Clear flag.

critical

param message

message to put the knob in error, and do a popup.

debug

param message

message to put out to the error console, attached to the knob, if the verbosity level is set high enough.

enabled

return

True if the knob is enabled, False if it's disabled.

error

param message

message to put the knob in error.

fromScript

Initialise from script.

fullyQualifiedName

Returns the fully-qualified name of the knob within the node.

getAuthorMode

Returns the authoring mode currently set on the knob.

getAuthorModes

Returns the names of the authoring modes of the knob if the knob is an authoring knob, otherwise an empty list.

getDerivative

Return derivative at time 't' for channel 'c'.

getFlag

Returns whether the input flag is set.

getIntegral

Return integral at the interval [t1, t2] for channel 'c'.

getKeyIndex

Return keyframe index at time 't' for channel 'c'.

getKeyList

Get all unique keys on the knob.

getKeyTime

Return index of the keyframe at time 't' for channel 'c'.

getLink

getLinkedKnob

getNthDerivative

Return nth derivative at time 't' for channel 'c'.

getNumKeys

Return number of keyframes for channel 'c'.

getValue

Return value at the current frame for channel 'c'.

getValueAt

Return value at time 't' for channel 'c'.

hasExpression

Return True if animation at index 'index' has an expression.

isAnimated

Return True if channel 'c' is animated.

isKey

Return True if there is a keyframe at the current frame for channel 'c'.

isKeyAt

Return True if there is a keyframe at time 't' for channel 'c'.

label

return

label.

makeLink

makeWidget

Returns an instance of the QWidget subclass used to edit the knob's value.

name

return

name.

node

Return the node that this knob belongs to.

notDefault

return

True if any of the values is not set to the default, False otherwise.

removeKey

Remove key for channel 'c'.

removeKeyAt

Remove key at time 't' for channel 'c'.

revertOverride

This function only affects link knobs that are placed on a LiveGroup node.

setAnimated

Set channel 'c' to be animated.

setAuthorMode

Sets the authoring mode on the knob.

setEnabled

Enable or disable the knob.

setExpression

Set the expression for a knob.

setFlag

Logical OR of the argument and existing knob flags.

setLabel

param s

New label.

setLink

setName

param s

New name.

setTooltip

param s

New tooltip.

setValue

Set value of knob.

setValueAt

Sets the value 'val' at channel 'chan' for time 'time'.

setVisible

Show or hide the knob.

toScript

Return the value of the knob in script syntax.

toScriptPrefix

Write commands that must be executed before the to_script() value can be parsed.

tooltip

return

tooltip.

value

Return value of knob.

visible

return

True if the knob is visible, False if it's hidden.

warning

param message

message to put a warning on the knob.

Class() → Class name.
Returns

Class name.

ClassID() → Class ID.
Returns

Class ID.

applyOverride() → bool

This function only affects link knobs that are placed on a LiveGroup node. It replaces the value of the linked knob in the live group with the value set in the LiveGroup node.

clearAnimated()

Clear animation for channel ‘c’. Return True if successful.

clearFlag(f) → None.

Clear flag. :param f: Flag. :return: None.

critical(message) → None.
Parameters

message – message to put the knob in error, and do a popup.

Returns

None.

debug(message) → None.
Parameters

message – message to put out to the error console, attached to the knob, if the verbosity level is set high enough.

Returns

None.

enabled() → Boolean.
Returns

True if the knob is enabled, False if it’s disabled.

error(message) → None.
Parameters

message – message to put the knob in error.

Returns

None.

fromScript()

Initialise from script.

fullyQualifiedName(channel=- 1) → string

Returns the fully-qualified name of the knob within the node. This can be useful for expression linking.

Parameters

channel – Optional parameter, specifies the channel number of the sub-knob (for example, channels of 0 and 1 would refer to the x and y of a XY_Knob respectively), leave blank or set to -1 to get the qualified name of the knob only.

Returns

The string of the qualified knob or sub-knob, which can be used directly in expression links.

getAuthorMode() → Integer.

Returns the authoring mode currently set on the knob. This is a unique string identifier of the option, which is also used for serialisation and deserialisation. It is not meant to change,thus one can rely on it. :return: The string identifier of the current authoring mode set.

getAuthorModes() → List.

Returns the names of the authoring modes of the knob if the knob is an authoring knob, otherwise an empty list. :return: The names of the authoring modes of the knob if the knob is an authoring knob, otherwise an empty list. This is a list of strings.

getDerivative()

Return derivative at time ‘t’ for channel ‘c’.

getFlag(f) → Bool.

Returns whether the input flag is set. :param f: Flag. :return: True if set, False otherwise.

getIntegral()

Return integral at the interval [t1, t2] for channel ‘c’.

getKeyIndex()

Return keyframe index at time ‘t’ for channel ‘c’.

getKeyList()

Get all unique keys on the knob. Returns list.

getKeyTime()

Return index of the keyframe at time ‘t’ for channel ‘c’.

getLink() → s
getLinkedKnob() → knob
getNthDerivative()

Return nth derivative at time ‘t’ for channel ‘c’.

getNumKeys()

Return number of keyframes for channel ‘c’.

getValue()

Return value at the current frame for channel ‘c’.

getValueAt()

Return value at time ‘t’ for channel ‘c’.

hasExpression(index=- 1) → bool

Return True if animation at index ‘index’ has an expression. :param index: Optional index parameter. Defaults to -1 if not specified. This can be specified as a keyword parameter if desired. :return: True if has expression, False otherwise.

isAnimated()

Return True if channel ‘c’ is animated.

isKey()

Return True if there is a keyframe at the current frame for channel ‘c’.

isKeyAt()

Return True if there is a keyframe at time ‘t’ for channel ‘c’.

label() → label.
Returns

label.

makeLink(s, t) → None
makeWidget() → PySide6.QtWidgets.QWidget.

Returns an instance of the QWidget subclass used to edit the knob’s value. The widget will update the knob’s value when its value changes and should update its displayed value(s) when they change on the knob. Can return null if no widget should be created for the knob. :return: PySide6.QtWidgets.QWidget.

name() → name.
Returns

name.

node() → nuke.Node

Return the node that this knob belongs to. If the node has been cloned, we’ll always return a reference to the original. :return: The node which owns this knob, or None if the knob has no owner yet.

notDefault() → True if any of the values is not set to the default, False otherwise.
Returns

True if any of the values is not set to the default, False otherwise.

removeKey()

Remove key for channel ‘c’. Return True if successful.

removeKeyAt()

Remove key at time ‘t’ for channel ‘c’. Return True if successful.

revertOverride() → bool

This function only affects link knobs that are placed on a LiveGroup node. When called the LinkKnob will revert to the linked knob value and will follow it after reloads.

setAnimated()

Set channel ‘c’ to be animated.

setAuthorMode(authorMode) → None.

Sets the authoring mode on the knob. This accepts both the unique string identifier, which is also used for serialisation and deserialisation, or index of the option for convenience. These values are not meant to change, thus one can rely on them. :param authorMode: The string identifier or index of the authoring mode. :return: None.

setEnabled(enabled) → None.

Enable or disable the knob. :param enabled: True to enable the knob, False to disable it.

setExpression(expression, channel=- 1, view=None) → bool

Set the expression for a knob. You can optionally specify a channel to set the expression for.

Parameters
  • expression – The new expression for the knob. This should be a string.

  • channel – Optional parameter, specifying the channel to set the expression for. This should be an integer.

  • view – Optional view parameter. Without, this command will set the expression for the current view theinterface is displaying. Can be the name of the view or the index.

Returns

True if successful, False if not.

setFlag(f) → None.

Logical OR of the argument and existing knob flags. :param f: Flag. :return: None.

setLabel(s) → None.
Parameters

s – New label.

Returns

None.

setLink(s) → None
setName(s) → None.
Parameters

s – New name.

Returns

None.

setTooltip(s) → None.
Parameters

s – New tooltip.

Returns

None.

setValue() → None

Set value of knob.

setValueAt(val, time, chan) → bool

Sets the value ‘val’ at channel ‘chan’ for time ‘time’. :return: True if successful, False if not.

setVisible(visible) → None.

Show or hide the knob. :param visible: True to show the knob, False to hide it.

toScript(quote, context=current) → string.

Return the value of the knob in script syntax. Pass True for quote to return results quoted in {}. Pass None for context to get results for all views and key times (as stored in a .nk file).

toScriptPrefix() → string

Write commands that must be executed before the to_script() value can be parsed. This is used to write commands to declare Layers and Formats and other objects that are shared by knobs.

tooltip() → tooltip.
Returns

tooltip.

value() → string

Return value of knob.

visible() → Boolean.
Returns

True if the knob is visible, False if it’s hidden.

warning(message) → None.
Parameters

message – message to put a warning on the knob.

Returns

None.

Previous Next

© Copyright 2025, The Foundry. Python API Reference for Nuke 16.0v3. Last updated on May 20, 2025.