When using the mib_amb_occlusion shader to perform an occlusion pass, you can choose to exclude one or more objects from the occlusion calculations.
Do one of the following:
Method 1: Hide
In the object's transform node, expand the mental ray section. In the Flags section, disable Derive From Maya and turn on Hide.
Method 2: Adding miLabel
For example, assuming that $targetTransform is your transform, set the miLabel as follows:
addAttr -at short -longName miLabel -defaultValue <your value> $targetTransform;
Set the miLabel to a value that is unique to your scene. In other words, select a value that is not currently being used for other mental ray labels in your scene.
For example, if you set your id_inclexcl value to 8, then only transforms with a miLabel of 8 are included in the occlusion render.
If you set your id_inclexcl value to -8, however, then all transforms with a miLabel of 8 are excluded from the occlusion render.
See mental ray for Maya nodes for more information about the mib_amb_occlusion node.