TCL

There are already a number of resources available covering TCL commands inside nuke. For a deep dive check out the reference over at https://www.nukepedia.com/reference/Tcl/ . Or for a more guided adventure check out any of the TCL tutorials over at https://www.gatimedia.co.uk/ (I go here every time I need to remember the syntax).
Here I just want to add some use cases that I have found … well, useful


Linking
Taking the idea of updating a switch nodes label a step further based on input we can instead link the values to a backdrop node.
*When you change the switch nuke will not update the values until a new frame is drawn. So you will need to change frame in the timeline to see the results

This is the tcl command added to the label:

[if {[value Switch_Precomp_Chars.which]==0} {return Source[knob BD_Precomp_Chars.tile_color 0xbfbf50ff]} { return PreComp[knob BD_Precomp_Chars.tile_color 0x1abf50ff]}]

'autolabeling' cryptomatte

Often cryptomattes are used to mass select everything of a certain type. instead of individually selecting each element we can use wild cards * to quickly make selections.

Here the expression is looking for * in the mattelist. If it finds it the mattelist is used as the label.You can add additional information to the label as needed

[if { [regexp {\*} [value matteList]] == 1} {return [value matteList]} {return }] 


Previous
Previous

Create VEG

Next
Next

setRotoLifeTime()