Nuke Knowledge Base

Nuke stuff I need the interwebs to remember for me.

vlatest

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.

 

, , , , ,