In Cinema4D, each object can be assigned an Object ID with the V-Ray Compositing Tag Comp Properties. This value is also sometimes called the G-Buffer value. Two or more objects in the scene can share the same Object ID.
The ObjectID Channels Render Element creates selection masks based on Object ID. This render element either shows each object (by Object ID) in a solid unshaded color, or stores the Object IDs as integer values within the EXR format or V-Ray Image Format file.
The Color (with AA) method supports antialiasing at the edges of objects. The Integer (no AA) method, which assigns an Object ID to each pixel in the render element, does not support antialiasing as each pixel either has an integer assigned to it, or it does not.
More than one V-Ray ObjectID Channels pass can be generated for a single rendering if desired; for example, if you wish to have both solid-shaded color and integer-based render elements for maximum flexibility during compositing.

Common Uses

The ObjectID Channels Render Element is useful for isolating geometry in a scene based on the Object ID. This means that items can be isolated by use of a matte created from the solid colors within the Object ID pass. In the example below the sofa has an Object ID of 1, the dangling light has an Object ID of 4 and the sideboard has an Object ID of 2.

ObjectID Channels Render Element

Matte created in composite by using only the blue channel

Original beauty render

Dangling lamp color-corrected using matte created from Object ID Render Element blue channel (as a mask in composite)