Nuke – The Hidden AutoCrop Script

This a great little script that can help to optimise your comp tree by setting the Bounding Box in an image stream.

Selecting the node your want to set the Bounding Box on.  Hit ‘X’ (to start the Script Command window) and change the script language to Python.  Then enter the following…

nukescripts.autocrop(first=None, last=None, inc=None, layer="rgba")

Nuke will run the CurveTools AutoCrop function, copy the autocropdata in to a Crop node and then delete the CurveTool.  Genius!

‘first’ and ‘last’ refer to the frame range you want to analyse.  If NONE is set it will use the Project Settings.  ‘inc’ is the increment.  ‘layer’ is the layer or layers you want to analyse.  It’s good to set it to ‘a’ (alpha) for any premulted CG you receive so you can be sure your getting all the data down stream.

I’ve created an python script to help with running this command.  It can be downloaded from Nukepedia.


Here’s a great video from The Foundry on understanding the Bounding Box…

Bounding Box – NUKE Basic Workflows





Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s