1

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.

Delagone
  • 2,078
  • 4
  • 20
  • 39

1 Answers1

1

Each material can have it's own Pass Index set up in the Properties Window > Material > Settings > Pass Index

If you set them up correctly after rendering, using a Compositor you can use an ID Mask node to mask out each part of the image according to material.

It can be directly from the Render Layers node or from an Image node through a multi layer file format like EXR.

See the Blender Manual on how to

You an then use the compositor to extract one mask for each material and save it as an image.

This technique has the advantage that since it uses a black and white mask for each layer pass you can get full anti-aliasing for each mask, without running the risk of 'ID Collision' when the mixed anti-aliased colors match a different object from another pass.

Duarte Farrajota Ramos
  • 59,425
  • 39
  • 130
  • 187
  • 2
    I don't believe the ID masks are anti-aliased? The ID node in the compositor has some sort of "anti alias" option but it's never worked well for me. – JtheNinja Sep 26 '16 at 16:25
  • related: http://blender.stackexchange.com/questions/28917/accurate-indexob-and-indexma-passes – p2or Sep 26 '16 at 17:06
  • Hum never really tested it myself, but there seem to be some nice workarounds in the answer linked by poor – Duarte Farrajota Ramos Sep 26 '16 at 19:53
  • Thanks for the input but unfortunately I'm not looking for a workaround. Also I'm not so much looking to isolate every single object into a sepperate black and white mask because this would be extremely time concuming if you have a complex scene with lots of objects. I only want to render out a collored map wich in turn could be used in photoshop to quickly mask out parts of the image. End use: Architectural visualisation – Delagone Sep 27 '16 at 11:18
  • Maybe you could set it up in the compositor in such a way that the per-material masks would be automatically combined into a color mask of your choice. It still takes some work to set up, but you only have to do it once, then all you have to is re-save it whenever you update your scene. – Duarte Farrajota Ramos Sep 27 '16 at 13:25