The image above shows the Render Elements tab in the vray render settings window. If you've used it before you may notice some cosmetic differences, and that's because I've modified one of the vray mel scripts to add some functionality that makes render elements easier to use with render layers.
This mel script creates a renderLayer that can be used to quickly render mattes for selected objects or groups of objects with the VRay for Maya renderer.
As you can see from the screen shot, djVRayCreateMatteLayer.mel looks very similar to the mentalray mattePassMaker.mel script which I wrote about in my previous post. In fact djVRayCreateMatteLayer.mel is an attempt to emulate the mentalray matte pass functionality using "VRay Render Elements".
At this point in time I am fairly new to vray and vray is relatively new to maya so djVRayCreateMatteLayer.mel should be viewed as a work-in-progress, but one you may find useful if you ever need to create mattes using vray. (more...)