In Maya, Object IDs can be added as an Extra V-Ray Attribute. Two or more objects in the scene can share the same Object ID.
The Object ID Render Element creates selection masks based on Object ID that shows each object (by Object ID) in a solid unshaded color.
UI Expand
title
UI Path: ||Display Render Settings button|| > Render Elements tab > Object ID
Image RemovedImage Added
To use render elements, select from the Available render elements column and click the Add button to add the passes you wish to generate at render time. When you render the scene, the added render elements listed in the column on the right, will also render, which can be viewed from the VFB window's channel drop-down menu.
For more information on the parameters on this dialog, see the Render Elements tab page.