Hi guys,
I'm fairly new to compositing, but basically I am making a scene where the background used is actually a jpeg (or static-camera footage) of a real environment, and i am compositing an animated character into it, running from the distance. It's a flat surface so in maya i'll create a floor that matches the geometry of the real floor in the picture from that camera angle, and then can render the character with an alpha behind it etc etc, but i would like to render the shadows from the maya scene on their own with an alpha so that i can composite these underneath the final character layer in AE but over the top of the eventual background image. I just dont know how to (1) render shadows without showing the character too and (b) render these shadows without showing the floor etc (i literally just need the shadows alone). This is probably a simple foundation of compositing but i've never done it before, could anybody explain the process to me? I'll be using mental ray for the render. Thanks in advance!
Tom
Use use background shader it creates alpha for shadows and possibly refrections but doent otherwise interact with the scene at all and has transparent alpha.
ah thats cool, so should i apply the use background shader to both the character and the floor in maya? will the shadows still render out as the floor will be using the background behind it? sorry am new to it all lol, cheers!
Tom
Hey,
Anybody reading his now that didn't totally get what joojaa meant (i.e. didnt understand how 'use background' shader is designed to work and therefore how to use it), I found a great gnomon explanation for us multi-pass noobs:
Shadow Pass -
There are two types of shadows when rendering passes. The shadows an
object casts onto itself (self-shadows) and the shadows the object
casts onto other objects (cast-shadows). Usually just the shadows being
cast on other objects are rendered as a pass, and the self-shadowing is
included in the beauty pass.
To render a shadow pass, turn off 'primary
visibility' on the object's shape node, but leave 'casts shadows' on.
One can also assign the 'Use Background' Shader to objects receiving
the shadows so that only the shadow is rendered (to the alpha channel).
Nice!
Cheers to joojaa for getting me on the right track 
In addition to Tom's note, you will want to set the casting light intensity to 1 and its color to white (for creating a compositing matte). Plus, likely you will want to create a shadow matte pass like this for each of the shadow-casting lights you are using.
Tom, if what you want is just to create a regular shadow, Jojaa put you in the right direction.
You don't need any contribution passes for that, but just the -Use background- shader that you can find in the -Create Maya Nodes- tab in Hypershade.
Just create a plane that match in perspective with your real photo, and assign the material -Use Background- which's created for that purpose (for catching reflections too).
If you want just the shadow, set reflectivity and reflection limit to zero (keep shadow mask to 1. You always can remove opacity to your compositing layer)
Additionally, if you want to "substract" elements from the scene (i.e. the character) then create a -Surface Shader-, set Out Matte Opacity to black, and assign it to the element/s that you want to remove.
It's quite easy in that way.
Cheers,
Carles