PDA

View Full Version : alpha bbox



bwanaghana
November 12th, 2010, 01:00 PM
I'm trying to create a script that creates a bounding box around a node's alpha channel. Does anyone know if there is a way to isolate the nonzero area of a node's alpha channel (preferably without using sample()) in order to get its bbox coordinates?

Void
November 12th, 2010, 01:23 PM
Curvetool. There's also a python command to run it.

lucjulien
November 12th, 2010, 03:42 PM
this feature is already integrated in nuke.

press X select TCL type autocrop

bwanaghana
November 12th, 2010, 04:54 PM
Now I just need to figure out a way to make it auto-update whenever the alpha map is changed upstream. Would nuke.addKnobChanged work for something like that? I'll have to experiment.

Void
November 13th, 2010, 05:09 AM
Not sure if that possible. You might have to just get the user to update it. Not sure what exactly that you're doing but making everything automatic often leads to stupid users.

bwanaghana
November 13th, 2010, 09:46 PM
I was hoping to incorporate it into a rather complicated gizmo in order to improve processing performance by limiting the area of the image being calculated to everything within the alpha bounding box. I guess the manual recalculation will have to do for now. Sometimes it's relieving to hear that it might not be possible. Thanks for your help. :D