Steps

smartRescue offers multiple steps out of the box. These can be used to get a certain range or specific nodes of your working file selected and handle them by disabling, deleting or disconnecting them from the stream. Additionally, a few steps let you create additional information about your working file. Creating new steps, is possible as well and gets discussed here. All steps are discussed in the following.

Step ‘AllNodes’

Handle all nodes in the DAG but skip all nodes of specified node classes.

Widgets

  • mode: Choose how to handle matching nodes.
  • skip: List of node classes to skip processing.

Examples

1) Disable all nodes

_images/disable_all_nodes_01.jpg

Will disable all nodes.

2) Delete all Nodes except of Read nodes

_images/disable_all_nodes_02.jpg

Will delete all Nodes except of Read nodes.

Step ‘CopyLines’

Copy all lines between first_line and last_line to a backup file.

This is useful to debug at which node of a working file the file itself gets corrupt and will possibly crash when opening the working file. Keep in mind that you should set the first line at the beginning of a node and the last line at the end of a node to prevent from generating working files with incomplete node structures. For that you will need to view the working file using a text editor (all .nk files are simply ascii files that you can view with your text editor).

Widgets

  • first_line: The first line to include in the new file.
  • last_line: The last line to include in the new file.

Examples

1) Keep only lines 1 to 37

_images/copy_lines_01.jpg

This will store the content of line 1 to 37. All lines afterwards will be removed.

2) Copy everything except the last X lines

_images/copy_lines_02.jpg

Inserting negative values for the ‘last_line’ is possible as well. This will then copy until the last x lines: first line: 1 and last line: -100. This will copy line 1 until the last 100 lines. For instance, when the working file contains 500 lines, then it will copy line 1 till line 400. The last 100 lines won’t be copied.

Step ‘NodesByClass’

Handle all nodes of the configured node classes in the DAG.

This processes recursively, meaning we include also all nodes being nested inside Group nodes.

Keep in mind that some node classes are versioned inside Nuke, e.g. Merge2, Camera2, Tracker4, etc. If in doubt about the node class, create a node and press ‘I’ to show the node info window. In this window you can also see the node class of the selected node.

Widgets

  • mode: Choose how to handle matching nodes.
  • node_classes: Node classes to include handle.

Examples

1) Delete all Viewer nodes

_images/nodes_by_class_01.jpg

This will delete all nodes of the class ‘Viewer’.

2) Disable all ‘Reformat’ and ‘Write’ nodes

_images/nodes_by_class_02.jpg

This will disable all ‘Reformat’ and ‘Write’ nodes in the DAG.

3) Disconnect all ‘Defocus’ nodes from the stream

_images/nodes_by_class_03.jpg

This will disconnect all ‘Defocus’ nodes from the stream.

Step ‘NodesByKnobValues’

Handle nodes in the DAG matching one of the knob rules.

This will search all nodes in the DAG. If any node contains the following knob and the operator matches the given value then we handle the node as configured.

The following operators are supported:

== equal != not equal < less than <= less than or equal > greater than >= greater than or equal

Widgets

  • mode: Choose how to handle matching nodes.

    disable: Will disable nodes. delete: Will delete nodes. disconnect: Will disconnect the nodes from the stream.

*knob_rules: Rules to apply to the process:

  • node_class: Name of the class to consider
  • knob_name: name of the knob
  • operator: operator to use for a match
  • knob_value: knob value to match

Examples

_images/nodes_by_knob_values_01.jpg

Delete all nodes of node class ‘Defocus’ where the ‘size’ knob is ‘greater than’ the value of ‘50’.

_images/nodes_by_knob_values_02.jpg

Disable all nodes of the node class ‘Merge2’ where the ‘mix’ knob’s value is ‘equal’ to ‘0.3’.

_images/nodes_by_knob_values_03.jpg

3) Disconnect all nodes of the node class ‘Defocus’ where the ‘defocus’ knob’s value is ‘greater than’ the value of ‘100’ and all nodes of the node class ‘Blur’ where the ‘size’ knob’s value is ‘greater than’ the value of ‘100’.

Step ‘NodesByKnobValuePattern’

Handle all nodes in the DAG that knob names match one of the patterns.

This will iterate over all nodes and check if the given key (knob name) exists and checks if the pattern for that knob matches in the knob’s value. To check the node name itself, we can use the node’s ‘name’ knob, which contains the name of the node.

Widgets

  • mode: Choose how to handle matching nodes.

  • patterns: List of knob names and patterns to match: in the

    • knobname: Name of the knob
    • pattern: Pattern to match

Examples

_images/nodes_by_knobvalue_pattern_01.jpg

Disables all ‘Text’ nodes (i.e. current ‘Text2’ node) and legacy ‘Text’ nodes (i.e. ‘Text’) as well as all Tracker nodes (i.e. current ‘Tracker4’ node) and all legacy Tracker nodes (i.e. ‘Tracker’, is there no ‘Tracker2’?), ‘Tracker3’):

_images/nodes_by_knobvalue_pattern_02.jpg

Deletes all ‘IBKColour’ and ‘IBKGizmo’ nodes:

_images/nodes_by_knobvalue_pattern_03.jpg

Deletes all nodes that have ‘heavy’ in their label. Explicitly kept open by not using ‘^’ at the pattern beginning and not using ‘$’ at the pattern end, so that ‘heavy’ and ‘lorem ipsum heavy dolor sit amet’ will both match.

Step ‘NodesByName’

Handle all nodes in the DAG where the node’s name is one of the following.

This will search for all nodes that contain one of the configured names and will handle these nodes.

Widgets

  • mode: Choose how to handle matching nodes.
  • nodes: All node names that will be considered a match.

Examples

_images/nodes_by_name_01.jpg

Disable the nodes that are called ‘Write1’ and ‘Write2’:

_images/nodes_by_name_02.jpg

Delete the node that is called ‘Write3’:

Step ‘RemoveNonAscii’

Remove non ASCII characters from the working file.

ASCII (American Standard Code for Information Interchange), is a character encoding standard for electronic communication and represents text in computers. All Nuke working files should only contain characters within the ASCII table of 1-127. When using external gizmos and third-party plugins, chances are given that the authors include ASCII characters in their tools that are outside the ASCII table of 1-127 - especially if the authors live in non english speaking countries and are not aware of this fact. Characters outside the legal range will stop Nuke from parsing the working file, resulting in not loading the whole Nuke script. For more information about ASCII have a look at: https://en.wikipedia.org/wiki/ASCII

This step removes all illegal character from the working file that fall outside the legal character table range of 1-127.

There is nothing to configure in this step.

Step ‘ReplaceByPattern’

Replace sections in the working file by using regular expression patterns.

This will search the working file for given patterns and will replace it with the given substitution.

Widgets

  • replace: Input that will be replaced to the given output:

    • input: Input to search for.
    • output: Value to replace the match to.

Examples

_images/replace_by_pattern_01.jpg

This will change the colorManagement from ‘Nuke’ to OCIO and the ‘workingSpaceLUT’ from ‘Cineon’ to ‘linear’.

_images/replace_by_pattern_01.jpg

Replace all sections where finding the word ‘robot’ followed by any number and a dot and a file extension to ‘robot.jpg’:

_images/replace_by_pattern_03.jpg

Remove all custom custom knobs that contain the label ‘reveal in explorer’.

Step ‘ScriptInfo’

Generate text file containing info about the working file.

This info includes:

  • Working file name
  • Number of nodes in the dag
  • Total number of nodes including nodes in Group nodes
  • All footage paths
  • First frame and last frame
  • Number of nodes within a class that can be configured

Widgets

  • number_nodes_by_class: These nodes will be counted in the generated report.
  • root_info: Names of the root’s knobs that we want to include in the generated report.

Examples

_images/script_info_01.jpg

For the example file “my_workfile.nk” this will create a “my_workfile.nk_info.txt” with information about the working file and will include the amount of ‘Blur’ and ‘Merge2’ nodes:

_images/script_info_02.jpg

2) This example is similar to the first example. For the example file “my_workfile.nk” this will create a “my_workfile.nk_info.txt” with information about the working file but now also including information about the knob values of the nuke.root that are configured in ‘root_info’. As the ‘count number nodes from class’ list is not specified, this will now create a list of -all- used node classes and their amount of nodes, sorted alphabetically:

  • root:

    • format
    • fps
    • project_directory
    • colorManagement
    • OCIO_config
    • onScriptLoad
    • onScriptSave
    • onScriptClose