I've been searching a while now for a solution to render out a flat colored map for masking out objects in photoshop.
I found this very helpfull topic: https://blenderartists.org/forum/showthread.php?387255-Surface-ID-Pass-in-Blender
Is there a way to combine this technique so that objects with the same material/object will use the same color?
The main benefit from this technique is that it's anti-aliased which makes it more suitable for masking.