How to output ID masks as seperate files for compositing?
Object ID passes


Assign a unique 'Pass Index' value to each object
Enable Object Index pass (Properties > Render Layers > Passes > Object Index)
Create a 'File Output' node in the compositor via Add > Output > File Output
Create 'ID Mask' nodes via Add > Converter > ID Mask per object
Create the desired output sockets to connect the 'ID Masks' and the 'Beauty Pass'
Make sure your File Path of the 'File Output' node is correct



Click to enlarge

Result:







Material ID passes

It's basically the same for 'Material ID passes'. Assign a unique 'Pass Index' value to each material and enable Material Index pass (Properties > Render Layers > Passes > Material Index):

 
Click to enlarge





Related Questions


How to use index passes in other compositing packages?
Accurate IndexOB and IndexMA passes