Tuesday, November 20, 2018

Nuke Viewer Interactive Bounding Box Warning message

Viewer Interactive Bounding Box Warning message.

Bounding box management is essential in compositing. This applies for all the compositing application. Compositor should have good knowledge in managing bbox in their workflow. Your script became more efficient and manageable by maintaining bbox as original format. Also, this help nuke to render your script much faster.

All the big studios teaching artists, how to manage bbox in their script. Even-though, Experienced artists fails to maintain their bbox when it comes deadline. Every compositor knows how an artist works a deadline’s. This is a common issue across the studio.

Came up with this small idea to warn the artist when their bbox goes beyond twice as original format. Bundled this tool with viewer LUT. When the bbox became 2times bigger than original format, Viewer pops warning message interactively. Warning message goes away once the bbox became normal.

          default sRGB LUT                                             sRGB bundled with bbox warning

Breakdown steps:

Creating a banner on top of the viewer:

"expression" node with basic math will create a red banner on top of the canvas. You can change the size of the banner as per your taste.


Created banner using an expression node. Now we need to add warning text on top of the banner.

Interactive warning "text" node:

Create a Text node with the desired warning message. Keep the text in center aligned and justified.

Now, the issue is when the canvas (project) size change. Text node alignment will change! of course. How do we fix this!

Hers is the way, parent the text bbox to project width*height.

Now alignment fixed. But there is one more issue! When the project size goes even smaller?

Not cool right! There is a fix to overcome this issue.

Parent text size with format width will help us.

Now, this is cool :).

How do we make this work in the usual way? Switch node will do the magic here.

Take a separate branch from your main tree, merge the banner as 'A' input. Add a switch node on the main spine, connect bbox warning setup in '1' input. Now add below expression to 'which' knob on the switch node.

Expression math for switch node:


This expression tells to switch node, when the bbox size 2 times greater then the original format, switch to input 1.

Here is the result:

Convert this setup as Group and connect anywhere in your script to make it work.

Can be used as VIEWER_INPUT.

How do we bundle this with Viewer LUT ?

Import your LUT from the colour grading department. Add bbox warning setup like Below image. Export it as Group node. Import the Group as Viewer LUT while nuke starts-up. Bingo.... 

Example script: download

Suggestions and feedbacks are welcome. Hope this will help you !!

connectCamera script for nuke

connectCamera python script for nuke connectCamera script helps users to connect with any camera from anywhere in their nuke script. W...