Home Creators Posts Import Register Favorites Logout

Content

In the main Gaffer tutorial series we covered how to use Gaffer's powerful and flexible procedural tools to build complex 3D scenes and, with a single click, render them to disk. We can also use Gaffer to process those renders with similar efficiency. Here's how!

Gaffer includes quite a few nodes dedicated solely to image reading, writing, processing and basic compositing. I use Gaffer for rendering models, then I bring those renders back into Gaffer for grading, Cryptomatte and final export.

All my renders for this type of project follow the same naming convention: anim/anim.####.exr, close.####.exr, cover.exr and cover_crypto.exr. (Remember that #### is the four digit padded frame number.)

To recreate my workflow, the first thing to do is create a global variable in Gaffer (File > Settings > Variables) pointing to the root folder where the renders are saved.

We can now load all the images with Image Reader nodes:

I set up Image Readers for anim, close and cover. We can view our images by focusing the relevant node. Skip back and forth between frames using the forward and backward arrow keys, or Ctrl-forward to play. Pressing F fits the image to the Viewer.

Gaffer includes built-in Cryptomatte support. I've got one image that always needs to have the background replaced, so my setup is automated to do this. The relevant Cryptomatte layer is named the same in all my renders: "backdrop." One fantastic feature of Gaffer is that Cryptomatte layers show up in the Hierarchy View. Just drag and drop the one you want to the Matte Names parameter!

After the layer is selected, press A to view the resulting alpha.

This is actually the inverse of what I want, so I created a simple inversion operation using a Grade node, applied only to the A channel.

I copied this new alpha to the original cover.exr using a Copy Channels node. Then I used a Merge node to put it on top of a pure white background created with a Constant. There you have it, mini-Nuke right inside Gaffer!

I apply the same grade and saturation adjustment to each image in the set. We can use one Grade node and one Saturation node as a controller for all the others by linking parameters. To do this, simply open up another Node Editor pane so you can see two nodes at the same time, then drag the parameter from the parent node to the one you want to link:

A line appears showing the connection. Now, whenever we change values in the parent node every other child node will get updated.

After getting everything set up, we can automate rendering our final images to disk, just like we did our original renders earlier in this series. Attach Image Writer nodes and type in the output image filenames:

This is what the final node tree looks like (including a Frame Mask for the closeups since there are only 4, compared to 12 frames in the turntable):

Connect everything to a dispatcher and click The Button. Fresh final images out of the oven in just a minute or two!

To process another project all I have to do is change the path in the global variable. The new images instantly load, then I just check to make sure the color correction still looks good and press Dispatch. It's an incredible time-saver.

Conclusion

Gaffer also includes image tools for overlaying text, cropping, creating borders, contact sheets and more. For example, you might procedurally create text labels using variables and then save the labelled images to disk automatically. Play around with it and discover new solutions for your workflow goals!

Files

Comments

No comments found for this post.