Nuke's Expression Language - Making Burnins with Tcl
This post is about creating guides in nuke for vendor-side VFX internal reviews. Full demo here and Git Repo with Script here
Introduction
The VFX for Spike Lee's film Highest 2 Lowest were done in large part at Baked Studios in New York City. The film had a long list of camera formats used during shooting and each camera had its own crop factor from plate to what was in the edit. This presented us with a challenge to manage aspect ratios with letterboxing along with these overall crop factors programmatically from shot to shot.
Tcl (Pronounced "Tickle") is a scripting language that Nuke modifies to create an expression language specialized for compositing math. Nuke's Tcl expressions can be used to great effect for simple modifications to knob parameters via mathematical expressions with its syntax.
Baked Studios by the time I left, had a robust python based pipeline integrated with ShotGrid toolkit. Largely built by U.K company Nodes & Layers, this pipeline allowed us to pull data from ShotGrid into nuke for slates, burnins, and various Tcl expressions if needed. The details of this workflow are largely proprietary and out of the scope of this blog post, but I encourage people to reach out to both Baked Studios and Nodes & Layers for details and or services.
Utilizing the ability to pull information from ShotGrid into a render template, we opted to add a "Shot Scale Factor" field in SG that would be the basis for how each rendered EXR would be scaled for DNxHD Quicktime reviews.
The reviewer would see a high res quicktime version of the below image, with the whole plate in view and then a "what the client will see" overlay:
Denzel Washington crossing the Brooklyn Bridge. Shows overlay with letterboxing and scale factor over the rest of the plate.
Here's what the node graph looks like:
The Pipeline Information Node
At our facility, we had an ever growing PIPELINE_INFORMATION
node. We used it with the SG toolkit and some python hooks with nuke's own API to replace the knob values with fields from ShotGrid.
Not pictured above, but had these knobs (and many more removed for this article):
The expressions you're seeing in cut in and out are just default in case no value is set in SG (defaulting to 8x8 frame handles):
Cut in = read_in.first_frame+8 e.g 1001+9=1009
Cut out = read_in.last_frame-7 e.g 1030-7=1023
The important knob to take note of for now is Shot Scale Factor
-- that knob connected to a field in shotgrid by the same name.