- Create a custom RGB AOV.
- Use aiWriteColor to write the object mask to the custom AOV. The Input color of the aiWriteColor is the mask color, and you have to enable Blend to get the opacity blended into the Input.
- Connect the Out Color of the aiWriteColor to the Color of a Standard shader. That sends the aiWriteColor beauty to the Standard.
- Make sure Enable AOV Composition is turned on in the Render Settings.
If you need to change the same Arnold attributes on many nodes, use the Attribute Spreadsheet. For example, suppose you wanted to turn off the Opaque attribute on a number of objects in your scene. Here’s how to do it:
AOV Composition allows opacity and transparency to carry forward into AOVs. It works only for RGB AOVs, so you won’t see it in the render region (because the xsi display driver always outputs RGBA AOVs).
For example, suppose you have a textured grid with an opacity map:
In the render region, the Main AOV is fine, but the Arnold Direct Diffuse doesn’t have the opacity, even if you enable AOV Composition:
However, if you render out the image (with AOV Composition enabled and the Direct Diffuse format set to RGB), you’ll get what you expected: