Package nuke :: Module callbacks
[hide private]
[frames] | no frames]

Module callbacks

source code

Functions [hide private]
 
_addBackgroundCallback(list, call, args, kwargs) source code
 
_addCallback(dict, call, args, kwargs, nodeClass, node=None) source code
 
_doAutoSaveCallbacks(filters, filename) source code
 
_doBackgroundCallbacks(list, context) source code
 
_doCallbacks(dict, node=None) source code
 
_removeBackgroundCallback(list, call, args, kwargs) source code
 
_removeCallback(dict, call, args, kwargs, nodeClass, node=None) source code
 
addAfterBackgroundFrameRender(call, args=(), kwargs={})
Add code to execute after each frame of a background render.
source code
 
addAfterBackgroundRender(call, args=(), kwargs={})
Add code to execute after any background renders.
source code
 
addAfterFrameRender(call, args=(), kwargs={}, nodeClass='Write')
Add code to execute after each frame of a render
source code
 
addAfterRecording(call, args=(), kwargs={}, nodeClass='Viewer')
Add code to execute after viewer recording
source code
 
addAfterRender(call, args=(), kwargs={}, nodeClass='Write')
Add code to execute after any renders
source code
 
addAfterReplay(call, args=(), kwargs={}, nodeClass='Viewer')
Add code to execute after viewer replay
source code
None
addAutoSaveDeleteFilter(filter)
Add a function to modify the autosave filename before Nuke attempts delete the autosave file.
source code
None
addAutoSaveFilter(filter)
Add a function to modify the autosave filename before Nuke saves the current script on an autosave timeout.
source code
None
addAutoSaveRestoreFilter(filter)
Add a function to modify the autosave restore file before Nuke attempts to restores the autosave file.
source code
 
addAutolabel(call, args=(), kwargs={}, nodeClass='*')
Add code to execute on every node to produce the text to draw on it in the DAG.
source code
 
addBeforeBackgroundRender(call, args=(), kwargs={})
Add code to execute before starting any background renders.
source code
 
addBeforeFrameRender(call, args=(), kwargs={}, nodeClass='Write')
Add code to execute before each frame of a render
source code
 
addBeforeRecording(call, args=(), kwargs={}, nodeClass='Viewer')
Add code to execute before viewer recording
source code
 
addBeforeRender(call, args=(), kwargs={}, nodeClass='Write')
Add code to execute before starting any renders
source code
 
addBeforeReplay(call, args=(), kwargs={}, nodeClass='Viewer')
Add code to execute before viewer replay
source code
 
addFilenameFilter(call, args=(), kwargs={}, nodeClass='*')
Add a function to modify filenames before Nuke passes them to the operating system.
source code
 
addKnobChanged(call, args=(), kwargs={}, nodeClass='*', node=None)
Add code to execute when the user changes a knob The knob is availble in nuke.thisKnob() and the node in nuke.thisNode().
source code
 
addOnCreate(call, args=(), kwargs={}, nodeClass='*')
Add code to execute when a node is created or undeleted
source code
 
addOnDestroy(call, args=(), kwargs={}, nodeClass='*')
Add code to execute when a node is destroyed
source code
 
addOnScriptClose(call, args=(), kwargs={}, nodeClass='Root')
Add code to execute before a script is closed
source code
 
addOnScriptLoad(call, args=(), kwargs={}, nodeClass='Root')
Add code to execute when a script is loaded
source code
 
addOnScriptSave(call, args=(), kwargs={}, nodeClass='Root')
Add code to execute before a script is saved
source code
 
addOnUserCreate(call, args=(), kwargs={}, nodeClass='*')
Add code to execute when user creates a node
source code
 
addRenderProgress(call, args=(), kwargs={}, nodeClass='Write')
Add code to execute when the progress bar updates during any renders
source code
 
addUpdateUI(call, args=(), kwargs={}, nodeClass='*')
Add code to execute on every node when things change.
source code
 
addValidateFilename(call, args=(), kwargs={}, nodeClass='Write')
Add a function to validate a filename in Write nodes.
source code
 
afterBackgroundFrameRender(context) source code
 
afterBackgroundRender(context) source code
 
afterFrameRender() source code
 
afterRecording() source code
 
afterRender() source code
 
afterReplay() source code
 
autoSaveDeleteFilter(filename)
Internal function.
source code
 
autoSaveFilter(filename)
Internal function.
source code
 
autoSaveRestoreFilter(filename)
Internal function.
source code
 
autolabel() source code
 
beforeBackgroundRender(context) source code
 
beforeFrameRender() source code
 
beforeRecording() source code
 
beforeRender() source code
 
beforeReplay() source code
 
filenameFilter(filename) source code
 
knobChanged() source code
 
onCreate() source code
 
onDestroy() source code
 
onScriptClose() source code
 
onScriptLoad() source code
 
onScriptSave() source code
 
onUserCreate() source code
 
removeAfterBackgroundFrameRender(call, args=(), kwargs={})
Remove a previously-added callback with the same arguments.
source code
 
removeAfterBackgroundRender(call, args=(), kwargs={})
Remove a previously-added callback with the same arguments.
source code
 
removeAfterFrameRender(call, args=(), kwargs={}, nodeClass='Write')
Remove a previously-added callback with the same arguments.
source code
 
removeAfterRecording(call, args=(), kwargs={}, nodeClass='Viewer')
Remove a previously-added callback with the same arguments.
source code
 
removeAfterRender(call, args=(), kwargs={}, nodeClass='Write')
Remove a previously-added callback with the same arguments.
source code
 
removeAfterReplay(call, args=(), kwargs={}, nodeClass='Viewer')
Remove a previously-added callback with the same arguments.
source code
 
removeAutoSaveDeleteFilter(filter)
Remove a previously-added callback with the same arguments.
source code
 
removeAutoSaveFilter(filter)
Remove a previously-added callback with the same arguments.
source code
 
removeAutoSaveRestoreFilter(filter)
Remove a previously-added callback with the same arguments.
source code
 
removeAutolabel(call, args=(), kwargs={}, nodeClass='*')
Remove a previously-added callback with the same arguments.
source code
 
removeBeforeBackgroundRender(call, args=(), kwargs={})
Remove a previously-added callback with the same arguments.
source code
 
removeBeforeFrameRender(call, args=(), kwargs={}, nodeClass='Write')
Remove a previously-added callback with the same arguments.
source code
 
removeBeforeRecording(call, args=(), kwargs={}, nodeClass='Viewer')
Remove a previously-added callback with the same arguments.
source code
 
removeBeforeRender(call, args=(), kwargs={}, nodeClass='Write')
Remove a previously-added callback with the same arguments.
source code
 
removeBeforeReplay(call, args=(), kwargs={}, nodeClass='Viewer')
Remove a previously-added callback with the same arguments.
source code
 
removeFilenameFilter(call, args=(), kwargs={}, nodeClass='*')
Remove a previously-added callback with the same arguments.
source code
 
removeFilenameValidate(call, args=(), kwargs={}, nodeClass='Write')
Remove a previously-added callback.
source code
 
removeKnobChanged(call, args=(), kwargs={}, nodeClass='*', node=None)
Remove a previously-added callback with the same arguments.
source code
 
removeOnCreate(call, args=(), kwargs={}, nodeClass='*')
Remove a previously-added callback with the same arguments.
source code
 
removeOnDestroy(call, args=(), kwargs={}, nodeClass='*')
Remove a previously-added callback with the same arguments.
source code
 
removeOnScriptClose(call, args=(), kwargs={}, nodeClass='Root')
Remove a previously-added callback with the same arguments.
source code
 
removeOnScriptLoad(call, args=(), kwargs={}, nodeClass='Root')
Remove a previously-added callback with the same arguments.
source code
 
removeOnScriptSave(call, args=(), kwargs={}, nodeClass='Root')
Remove a previously-added callback with the same arguments.
source code
 
removeOnUserCreate(call, args=(), kwargs={}, nodeClass='*')
Remove a previously-added callback with the same arguments.
source code
 
removeRenderProgress(call, args=(), kwargs={}, nodeClass='Write')
Remove a previously-added callback with the same arguments.
source code
 
removeUpdateUI(call, args=(), kwargs={}, nodeClass='*')
Remove a previously-added callback with the same arguments.
source code
 
renderProgress() source code
 
updateUI() source code
 
validateFilename(filename) source code
Variables [hide private]
  __package__ = 'nuke'
  _afterRecordings = {}
  _afterReplays = {}
  _beforeRecordings = {}
  _beforeReplays = {}
  afterBackgroundFrameRenders = []
  afterBackgroundRenders = []
  afterFrameRenders = {}
  afterRenders = {}
  autoSaveDeleteFilters = {'Root': [(<function onAutoSaveDelete ...
  autoSaveFilters = {'Root': [(<function onAutoSave at 0x7fada41...
  autoSaveRestoreFilters = {'Root': [(<function onAutoSaveRestor...
  autolabels = {}
  beforeBackgroundRenders = []
  beforeFrameRenders = {}
  beforeRenders = {}
  filenameFilters = {}
  knobChangeds = {'C_CameraSolver2_1': [(<function importKeysCal...
  onCreates = {'C_Blender2_1': [(<function genericCreateCallback...
  onDestroys = {'C_CameraIngest2_1': [(<function cameraIngestDes...
  onScriptCloses = {}
  onScriptLoads = {}
  onScriptSaves = {}
  onUserCreates = {'C_CameraIngest2_1': [(<function cameraIngest...
  renderProgresses = {}
  updateUIs = {}
  validateFilenames = {}
Function Details [hide private]

addAfterBackgroundFrameRender(call, args=(), kwargs={})

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

The context object that will be passed in is a dictionary containing the following elements:
id => The identifier for the task that's making progress
frame => the current frame number being rendered
numFrames => the total number of frames that is being rendered
frameProgress => the number of frames rendered so far.

Please be aware that the current Nuke context will not make sense in the callback (e.g. nuke.thisNode will return a random node).

addAfterBackgroundRender(call, args=(), kwargs={})

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

The context object that will be passed in is a dictionary containing the following elements:
id => The identifier for the task that's ended

Please be aware that the current Nuke context will not make sense in the callback (e.g. nuke.thisNode will return a random node).

addAutoSaveDeleteFilter(filter)

source code 

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

Look at rollingAutoSave.py in the nukescripts directory for an example of using the auto save filters.

Parameters:
  • filter - A filter function. The first argument to the filter is the current autosave filename. This function should return the filename to delete or return None if no file should be deleted.
Returns: None

addAutoSaveFilter(filter)

source code 

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

Look at rollingAutoSave.py in the nukescripts directory for an example of using the auto save filters.

Parameters:
  • filter - A filter function. The first argument to the filter is the current autosave filename. The filter should return the filename to save the autosave to.
Returns: None

addAutoSaveRestoreFilter(filter)

source code 

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

Look at rollingAutoSave.py in the nukescripts directory for an example of using the auto save filters.

Parameters:
  • filter - A filter function. The first argument to the filter is the current autosave filename. This function should return the filename to load autosave from or it should return None if the autosave file should be ignored.
Returns: None

addAutolabel(call, args=(), kwargs={}, nodeClass='*')

source code 

Add code to execute on every node to produce the text to draw on it in the DAG. Any value other than None is converted to a string and used as the text. None indicates that previously-added functions should be tried

addBeforeBackgroundRender(call, args=(), kwargs={})

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

The context object that will be passed in is a dictionary containing the following elements:
id => The identifier for the task that's about to begin

Please be aware that the current Nuke context will not make sense in the callback (e.g. nuke.thisNode will return a random node).

addFilenameFilter(call, args=(), kwargs={}, nodeClass='*')

source code 

Add a function to modify filenames before Nuke passes them to the operating system. The first argument to the function is the filename, and it should return the new filename. None is the same as returning the string unchanged. All added functions are called in backwards order.

addKnobChanged(call, args=(), kwargs={}, nodeClass='*', node=None)

source code 

Add code to execute when the user changes a knob The knob is availble in nuke.thisKnob() and the node in nuke.thisNode(). This is also called with dummy knobs when the control panel is opened or when the inputs to the node changes. The purpose is to update other knobs in the control panel. Use addUpdateUI() for changes that should happen even when the panel is closed.

addUpdateUI(call, args=(), kwargs={}, nodeClass='*')

source code 

Add code to execute on every node when things change. This is done during idle, you cannot rely on it being done before it starts updating the viewer

addValidateFilename(call, args=(), kwargs={}, nodeClass='Write')

source code 

Add a function to validate a filename in Write nodes. The first argument is the filename and it should return a Boolean as to whether the filename is valid or not. If a callback is provided, it will control whether the Render button of Write nodes and the Execute button of WriteGeo nodes is enabled or not.

autoSaveDeleteFilter(filename)

source code 

Internal function. Use addAutoSaveDeleteFilter to add a callback

autoSaveFilter(filename)

source code 

Internal function. Use addAutoSaveFilter to add a callback

autoSaveRestoreFilter(filename)

source code 

Internal function. Use addAutoSaveRestoreFilter to add a callback


Variables Details [hide private]

autoSaveDeleteFilters

Value:
{'Root': [(<function onAutoSaveDelete at 0x7fada4104f50>,
           (),
           {},
           None)]}

autoSaveFilters

Value:
{'Root': [(<function onAutoSave at 0x7fada4104e60>, (), {}, None)]}

autoSaveRestoreFilters

Value:
{'Root': [(<function onAutoSaveRestore at 0x7fada4104ed8>,
           (),
           {},
           None)]}

knobChangeds

Value:
{'C_CameraSolver2_1': [(<function importKeysCallback2_1 at 0x7fadfc14c\
5f0>,
                        (),
                        {},
                        None)],
 'C_ColourMatcher2_1': [(<function importKeysCallback2_1 at 0x7fadfc14\
c5f0>,
                         (),
...

onCreates

Value:
{'C_Blender2_1': [(<function genericCreateCallback2_1 at 0x7fadfc14c57\
8>,
                   (),
                   {},
                   None)],
 'C_CameraIngest2_1': [(<function genericCreateCallback2_1 at 0x7fadfc\
14c578>,
                        (),
...

onDestroys

Value:
{'C_CameraIngest2_1': [(<function cameraIngestDestroyCallback2_1 at 0x\
7fadfc14c488>,
                        (),
                        {},
                        None)],
 'C_GlobalWarp2_1': [(<function globalWarpDestroyCallback2_1 at 0x7fad\
fc14c230>,
                      (),
...

onUserCreates

Value:
{'C_CameraIngest2_1': [(<function cameraIngestUserCreateCallback2_1 at\
 0x7fadfc14c2a8>,
                        (),
                        {},
                        None)],
 'C_VerticalAligner2_1': [(<function verticalAlignerUserCreateCallback\
2_1 at 0x7fadfc14c500>,
                           (),
...