With the release of Maya 2009 the options available for render passes increased tremendously. This is usually a good thing. But in doing so, some of the easy methods for creating custom render passes, such as an Ambient Occlusion pass, no longer work as they did in Maya 2008. Apart from creating your own ambient occlusion shaders and lighting the scene manually the old-school way, this was becoming semi-annoying; I craved the easy way of yore that worked before. So today I bring to you: Jonathan R. Nelson's guide to Easy Ambient Occlusion in Maya 2009, or JRNG:TEAOIM2009 for short.
First you'll need a model, which I'm sure you won't have any problems producing one for today's demonstration. My lovely assistant for today will be Vanna, or at least her shoes. Here they are with no Ambient Occlusion.

Step 1: Select just the models in your scene, the ground plane, and nothing else. No lights. In the Render Layer Editor, create a new layer for these objects.


Rename this layer whatever you want, Bob comes to mind, or perhaps Ambient Occlusion RL would be more appropriate, but what ever works is good. Once created, right mouse button over the layer name and select Attributes. Once open select the Presets button and select Occlusion.

A surface shader is created automatically so close the Attribute Editor. In the Layer Editor, change the Blend mode for the Ambient Occlusion Layer to Multiply and activate the renderability of the masterLayer. We want to confirm that the layers are rendering correctly so open the render layer options, activate Render All Layers, then go into the Render All Layers Option Box and switch the mode to Composite and keep layers.



Render your scene. Here are the the three seperate renders:
masterLayer

Ambient Occlusion RL

Composited Image

Notice the ugly white border edge? This is created because of how the anti-aliasing is being calculated along the alpha channel. This can always be corrected in post, but if you want to correct this in Maya it will depend on your renderer.
If you are using mental ray: select the masterLayer in the Render Layer and open then render settings. Under the mental ray Quality tab scroll down to the bottom and expand Framebuffer. Change the Colorclip to Alpha and deactive Premultiply.

If you are using the Maya Software renderer: open the maya Software Tab, expand Render Options, and under Color/Compositing deactivate Premultiply.

Here is the final render:

©2009 Jonathan R. Nelson / www.jonathanrnelson.com