Nuke Knowledge Base

Nuke stuff I need the interwebs to remember for me.

Mirroring animation timing using tcl

To mirror your animation curves, you can use some simple expressions. Let’s say you animated an object from frame 0-50, and now you want to mirror it to frame 51-100.

Just write the following in your specific knob:

This uses the command:

which will hold the animation on frame x. So what the above example does, it checks if the current frame is 50 or above. If this is true, it frameholds 50-(frame-50), which at frame 52 for example is …

So on frame 52, it frameholds frame 48. If the frame is under 50, is just gives you your current animated value.

This is pretty useful for creating walk-arounds or anything symmetrical, when you’re too lazy to animate everything. :-)

, , , ,

Restrict number of decimals when working with float and tcl

Say, you need to animate a number and want one decimal. You link a text node to a floating point slider to get the job done, however, it will output a never-ending string of digits that nobody really cares about. You can format this, however. Have no fear.

, , , , ,

Copying rendered files to a different folder via python

If you do some versioning on a shot, and want to keep those files in your version-folders, but also want to have a folder that always contains the latest renders, you can do this with python, and don’t have to add a second Write-node in your script.

Just add the following in the after each frame field in your Write-Node.

What this does is the following:

It thinks you render everything in your e.g. “…/output/001/…” – folder.
Then it splits the path and exchanges the 001 by “VLATEST”. If this folder doesn’t exist, it creates the folder.
Then it copies everything over via shutil.copy2().

This script assumes that you don’t have versioning on the filename at the moment. If you want to edit this, you have to adjust your destFile.

 

, , , , ,

Creating Procedural Textures via UV-Map with Expression-Node

To create cool procedural textures in nuke, there is a pretty simple way to do that, all you need is an input image, a STMap-node and an Expression-node.  (more…)

, , , , , , ,

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:

expoglow

Simple setup of blur nodes with exponentially increasing size, added back to the input successively. State: production-tested. expoglow features a pre- and post-grade section, colour shift settings and a mask input, that behaves the way it should – masking the input, not the glow itself. (more…)

Copy files on os level via python

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

 

Welcome

Howdy, stranger.
This is a collection of tips and tricks, code snippets and home-brewed gizmos, set up as a personal go-to library among friends. Feel free to browse and use whatever you find here. If you know something that’s missing in this database and would like to contribute, you can simply shoot me an e-mail to julian@yellow-ant.net. I’ll make sure to give you proper credit.
Resident contributors: [php snippet=1]

Previous Posts Next posts