Dave Girard's 101 Autodesk® Maya® Tips is now available in Kindle, interactive iPad edition and DRM-free EPUB/PDF editions. Work faster, cry less. Read more about the ebook.




Follow cgbeige on Twitter

Topics by tag:



Recently published articles by Dave G:



Free downloads by Dave G:



Mac OS X-only downloads:

Interactive Command Line Nuke script

I made a simple shell script to use for interactively prompting start and end frames:

Same logic as the Maya one here. Here’s the download link:

http://www.can-con.ca/tumblrpics/nukeme.zip

Just set up your $PATH variable for Nuke or put an absolute path to the Nuke binary in your script. Works in OS X and Linux.

0 notes | Permalink

Denoise Filtering a GI Pass - I Feel Dirty but it Works

Last week, I had a limited time to render out 3600 frames of 1080p animation – and couldn’t use any light caching because of the moving lights and models. Even with a hyperthreaded 12-core Xeon Mac Pro and Sandy Bridge MacBook Pro as a slave, time was just too tight to meet the deadline, so I turned to a number of time-saving tricks to get the best balance of quality and low noise. I used a Viewport 2 playblast with baked ambient occlusion for my ambient occlusion pass:

That’s actually a mixed of a ZBrush cavity map and ambient occlusion.

But the real time-saving and quality came from Nuke X’s Denoise filter, which helped lower the per-frame render time while keeping noise down. Because I come from a print background and have art directed magazines that dealt with a lot of film footage stills as publicity images, I have a lot of experience with denoise filters like Noise Ninja and Neat Image. They are amazing at preserving detail while reducing chromatic and luminance noise and they’re far more mature than the noise filtering algorithms offered in renderers. So, with V-Ray set to Time Dependent to jitter the noise, V-Ray Nederhorst settings and a threshold setting that would otherwise be too low for production quality, I set up my render passes with this awesome Maya Python script…:

…and I filter the Raw GI pass to lower the noise:

You’ll need to watch that on a 1080p-capable screen to see the results clearly.

I may not be proud but I am pleased. If you are using Nuke without the Denoise filter or After Effects, give Neat Video a try. It’s the animation version of my favourite still image denoise filter and they have a demo for all platforms.

1 note | Permalink

Coming in V-Ray Tuner 2.2: Exposure Round-Tripping for Fast Lighting Tweaks

Some of you have probably seen me using the per-light rendering features of V-Ray Tuner, since it gives me a lot of control over a complex light setup without having to re-render, similar to Maxwell Render’s multilight feature. But, seeing it in action, you probably also thought to yourself “that seems slow and impractical for animation.” Well, I’ve finally implemented something I’ve been meaning to do to enable you to roll your exposure settings back into Maya from Nuke tweaks so that you can do a draft per-light rendering, hone your light balance and then take those exposure settings from Nuke or Photoshop and then input them to change each light’s value in Maya. Then you render a single final image that has perfect lighting. If you work on product shot type things, this workflow will save a ton of time in the long run:

In Nuke, you set the Exposure values to Stops to emulate F-stops, then adjust your exposure to make the lighting exactly as you want it and then, once you have a balance of lighting that you like, go back to Maya, select your V-Ray light and then run the Per-Light Render Exposure Tweak script from the Utilities menu and enter each exposure value into the field with the respective light selected.

As I mentioned above, it also works in Photoshop. Pick your per-light images in the File/Scripts/Load Images Into Stack dialog and they will all load into a layered document:

Set each layer to Linear Dodge (Add) and add a clipped Exposure adjustment to each (by alt clicking between the layer and the Exposure adjustment):

And the workflow is much the same as in Nuke:

That has the exact same exposure settings as the Nuke exposure and looks just like our final flat render. The cool thing about the Photoshop method is that you can flatten your Exposure tweaks into each layer and do another round of exposure edits without having to render out more per-light passes. Obviously, you need to use 32-bit renders for this to work effectively since 8- and 16-bit ones aren’t floating point and degrade with exposure edits.

I just need to update it to work with meshes and V-Ray Light Materials. Thanks go out to Will Earl who helped explain the math of the exposure conversion to me.

3 notes | Permalink

Using Nuke with Mudbox for V-Ray SSS Skin Conversion

I’ve been doing a lot of skin stuff lately and getting into the proper SSS workflows for V-Ray. While many people have different settings they prefer for a different type of look, some favouring ultra-realism, where I set mine to be slightly on the illustrated side, the workflow is the same between those two looks: you make a V-Ray blend mat with a V-Ray SSS2 base material with its reflectance set to black (none) and use a coat V-Ray Material with black diffuse (contributing nothing) but a mapped, glossy reflectivity for the shine. That is blended by a Fresnel material, which is extremely important – it handles all of your reflectance and gives your skin the healthy Palmolive shine that nosy witch Madge always carries on about. This shader softens your hands while your girlfriend asks you to do the dishes:

Here’s the general layout of the V-Ray Blend Mat shader network:

and a snapshot of what those three input textures within the V-Ray SSS2 material:

You can see which they drive in the title bar name of the image.

Since this workflow has you create at least four materials (diffuse, SSS, overall and specularity), one of the things I learned to do early was to use Nuke to convert my single Mudbox-painted skin texture to these four output textures that have completely different balance and contrast. Since most of my skins are pretty similar and I often revise things mid-project, this non-destructive workflow is a staple of all my skin pics (nyuk). Here’s a peek at the Nuke scene that I use as a template:

At the left is the flattened Mudbox texture and the right half is the SSS material generated from the adjustments to the Mudbox diffuse texture. The initial rotopaint is a dodge to lower contrast since any contrast with SSS textures will show up a lot. The second rotopaint at the right is a painting in of increased finger nail reflectance. All our textures done in one shot. Not bad.

3 notes | Permalink

3D Image Breakdown: Per-light Comp of 3D Illustration

I’m just putting the final touches on this 3D illustration and thought I’d show how I used the per-light rendering feature of V-Ray Tuner to render out light passes for all lights and the meshes with V-Ray Light Materials. This lets me really tweak the light contribution within Nuke (or Photoshop) for a well-honed studio lighting feel.

It also lets me add some roto tweaks to give the window reflections a more interesting reflection, instead of just white. That way I don’t spend too much time on trying to get my environment reflection to do that job.

Just have to touch up the ground and some small spots and it’s all done and ready for print. It may look lighter than it should on your screen because my monitors are set on a darker press-simulated setup (5000K white and 75cd/m^2 brightness).

I’ll be doing more talking about the other techniques used in the illustration over the next week or so.

1 note | Permalink

Using Frischluft Lenscare and Hand-painted Z-depth to Fix Photos

When you work on a magazine that does a lot of stories about real people – not celebs who have nice photos – you often have terrible photos that you are forced to deal with. The current magazine contract I’m on has one of these cases; there is a story about a man who ran a marathon to raise money for cancer research and all the photos are pretty rough looking and we can’t shoot him because he has unfortunately passed away. The best (meaning the least terrible) option was one shot that still had big problems: it was an over-compressed JPEG and it wasn’t clear who the subject was, since everything was in focus.

After jacking up the saturation to give the photo more life, the solution to the subject and quality problems was to hand-paint a Z-depth pass to simulate the depth add then apply a depth of field blur (I’m using the amazing Frischluft Lenscare). This served two purposes: you get to decide what the subject matter is by focusing on it and the high-quality bokeh blurring makes the photo sleeker and more film-like. Our terrible photo, while still no Cartier-Bresson, has graduated to publishable. The Z-pass:

The final comp:

Probably easier to see the focus if you look at it animated in Nuke:

If you look closely, you can see there are some edge halos that require touch-ups but that was pretty straightforward.

If you don’t have the money for Frischluft, Photoshop’s Lens blur has similar features. It’s not as nice as Frischluft and requires more touchups but the same technique can be used by pasting the Z-depth into an alpha channel and it will be picked automatically as the depth source when you open the plug-in:

1 note | Permalink

Magic Bullet for Nuke and V-Ray! Sort of!

A while ago, I wrote a how-to on making a 3D LUT (look-up table) in Nuke to accurately calibrate your colour, which is important because Nuke doesn’t support ICC (Colorsync) colour profiles automatically. Since V-Ray also supports .cube 3D LUTs, the same process can be used to create an accurate colour profile for the V-Ray Framebuffer, so that you can see your images without them being blasted out by a wide-gamut display. The settings are in the VFB’s Correction Controls:

But this .cube profile can also be used as a filter to see your render colour-graded within Nuke or the V-Ray VFB. The process is similar to the calibration method linked above but here you’re generating it from a filtered image from Photoshop and using it in Nuke…

…or the V-Ray Framebuffer:

But this method of “filter and generate” takes some added care: you have to make sure to turn off localized adjustments like vignetting, blur/sharpen and grain, so that only the colour treatment of the Nuke CMS image is affected. The process is much the same with AE, if you want to simulate a grading sample you have output from there. Just export a lossless conversion of the sRGB Nuke CMS image with the grading applied and then build the 3D LUT in Nuke. From there, you just use a Vectorfield node to apply the 3D LUT you’ve made:

If you’re here, just wanting a sample .cube LUT to play with, here’s the Kodak 5229 Vision2 Expression 500T 3D LUT.

Now, to deal with the elephant in the room: what happens if we want both a filter and a calibration? Well, the VFB does have support for both an ICC profile (your hardware-calibrated monitor profile) and a .cube file but currently the ICC correction doesn’t seem to work for me. In Nuke, the solution is much easier: use two Vectorfield adjustments and keep the calibration .cube outside of your Write nodes, just next to the viewer:

That ensures that the filter is applied in your Write but you’re not baking your monitor profile fix into an image that is fine otherwise.

I wanted to automate the process of making these .cube files since I plan to make a lot from Photoshop treatments and other video filters that I like. Nuke is pretty amazing and lets you use the app as a headless workhorse via Python in command line mode (nuke -t script.py), so I built a shell script that uses Nuke in Python command mode and then made an Automator script that makes the process even easier:

The Python script is here if you want it.

Finally, since I’m going to have a ton of .cube files that don’t have previews, the last step was to speed up the process of trying out these LUTs on a working image. So I took my Python script as a source and had a shell script read each .cube file I’ve made and use those as apply those to a variable image:

If you want the Python script to apply the LUT file like above, here it is. The syntax in the Terminal is “/Applications/Nuke6.2v1-32/Nuke6.2v1.app/Contents/MacOS/Nuke6.2v1 -t /path/to/nukeLUTapply.py /path/to/inputimage /path/to/output”. If you have a symlink to the Nuke binary in a $PATH, that’s:

nuke -t /Users/beige/Documents/nuke_scripts/LUT_apply/nukeLUTapply.py /Users/beige/Desktop/succession_hands26.exr /Volumes/HOME_RAID/STOCK/cube_3D_luts/colour_finesse_kodak/Kodak_5247_Vision_200T.cube /Users/beige/Desktop/out.tif

The script to batch apply them is a bit of a mishmash made for my folders:

#!/bin/bash

masterlist=`find /Volumes/HOME_RAID/STOCK/cube_3D_luts/ | grep \\.cube$`

for file in $masterlist
do
filenameOut=`basename $file -s .cube`
cat /Users/beige/Documents/nuke_scripts/LUT_apply/nukeLUTtester_template.py | sed "s%cubeListHere%$file%g" > /tmp/nuketempfile.py
nuke -t /tmp/nuketempfile.py $1
done

That’s the beauty (I use that term loosely here) of a Unix system: my crap Python skills combined with some decent shell scripting knowledge means that I can build a system that works without having to rely solely on Python. Pipe the Python to a filter and, while it may not be pretty, it’s pretty good for a guy who only learned how to declare a variable two years ago.

3 notes | Permalink

Reveal File in Finder App for Maya/OS X

I don’t use the FCheck or the View command for anything so I thought I’d put it to good use with an Automator utility to reveal the file in the Finder. It’s the World’s Simplest Automator Application but it’s pretty useful if you need to copy or work with the file other than just opening it in an editor:

It’s dead simple to make yourself with Automator but here it is to download if you want it. You’ll need Maya 2012 and up for this one though since there was a bug in 2011 that didn’t let you select .app bundles as valid applications.

Update: I made a similar Automator service for use with the clipboard path to files and apps like Nuke:

Also shown in that video is my Open Clipboard path service which launches the file referenced in the clipboard.

2 notes | Permalink

Extract Everything From Corrupt Nuke Files

I just had a Nuke scene script go bad for whatever reason and I am in the process of rebuilding my Time Machine backups so I was screwed until I realized that Nuke files are plain text (this is what makes the contents searchable with Spotlight in OS X). So I opened the script file in BBEdit and pasted the scene nodes into a new Nuke clipboard and then pasted the combined clipboard into Nuke.

I left out the main scene info so I’m guessing that’s where the problem was.

0 notes | Permalink

3D Illustration for Review/Tendances magazines.

3D Illustration for Review/Tendances magazines.

2 notes | Permalink