/NukeStudioCompCleaner

Cleans up NukeStudio's "special comps" by deleting unnecessary nodes, setting root format and some other useful stuff.

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Nuke Studio Comp Cleaner

by Fynn Laue 2016

Thanks to Mads Hagbarth L. for code snippets and sparring.

DESCRIPTION:

tl;dr: Cleans up .nk files generated by Nuke Studio. The script 'cleans up' .nk files that Nuke Studio generates by making sure the project format is correct, removing some unnecessary nodes and adding a python snippet that creates the output folder if it doesn't exist. Run this script immediately after generating .nk files so the comps are ready to be worked on instead of manually having to fix every .nk file before it is ready.

INSTALLATION:

  • Copy the contents of "NukeStudioCompCleaner" to your ~/.nuke folder. You don't need to copy the LICENSE and README files.
  • Add the following code to the menu.py file (or copy it from the included nkstCC_resources/menu.py ):
import nkstCC_init
if nuke.env['studio']: nuke.menu("Nuke").addMenu("nkstCC").addCommand("Clean Comps",nkstCC_init.main)
else: nuke.menu("Nuke").addMenu("nkstCC").addCommand("Clean Comp",nkstCC_init.main)
  • Restart Nuke

HOW TO USE:

DO NOT RUN THE SCRIPT ON COMPS THAT HAVE BEEN WORKED ON!!! ONLY RUN IT ON NEWLY CREATED .NK SCRIPTS BY NUKE STUDIO!

Nuke Studio:
  • Select a bunch of "comp clips" in the timeline. (Items that are linked to .nk files)
    • If you don't have any 'comp clips' in your timeline, read this article.
  • Run the script from the menu nkstCC > Clean Comps
  • In the dropdown menu select the track that holds the footage you want to use as the root format in each .nk Script.
  • Enable/Disable other options
  • Click OK
  • The script will process all selected items and display a message when it's done.
Nuke:
  • Run the script from the menu nkstCC > Clean Comps
  • In the dropdown menu select the read node with the format you want to use as the root format.
  • Enable/Disable other options
  • Click OK
  • The script will process the currently open .nk file and display a message when it's done.

DETAILED BREAKDOWN OF FUNCTIONALITY:

Deletes nodes:

- Reformat
- AppendClip
- Copy
- Constants

Because: It's more annoying than useful to be unable to see the complete source material.

Set Project Format:

Reads the format of the selected "Main Plate" and uses it as the root's format.
In NukeStudio you'd select a track, in Nuke you'd select a Node.

Because: Nuke Studio uses the timeline's or the selected clip's format as the root and reformats all input-read nodes when generating comps. That is especially annoying when you've got different formats for each plate or if a plate gets formatted to a smaller format.

Auto Write Node:

It adds a small python snippet to the "before render" field in every write node in the script. 
The snippet checks if the selected folder in the write nodes 'file' field exists and creates it if not.
This is not really necessary but I found it to be a nice addition that you don't have to create version folders manually every time you increment the write node.

VersionUp:

I highly recommend leaving this checked. It's always nice to be able to go back.
It simply saves the modified scripts as a new version instead of overwriting.