Nuke Knowledge Base

Nuke stuff I need the interwebs to remember for me.

Code

Create render folders if they do not exist

To prevent your write nodes throwing “no such file or directory” errors, paste this bit of code into the python – before render section of the write:

 

Split and use topnode’s filename

For file conversions or prep-jobs, if you want to use the original input’s filename in the final write node, you can use the following snippet of code.

 

random() function in tcl

Well. It goes like this:

Copy files on os level via python

This script copies the file of a Read node to a specific folder.

 

Disable knobs on a certain node with python

To do this for all knobs, just put it in a loop:

 

Execute writenode via python

 

Set keyframes in knobs with python

This example sets a knob to a defined value  in all frames .
nuke.Root()[‘first_frame’].getValue() returns float whyever…
So thats the reason i put it in “int()”

 

Create knobs with python

Syntax to create knobs (in this example a text-knob):

And here a short list of the most-needed knobs:

 

Hide unconnected inputs on selected nodes

Just a few lines to hide all not connected inputs. In this example the script touches all Beziers.

Sample image from within the expression node

To sample the incoming colour values, in an expression node type the following for the required channels:

Previous Posts Next posts