Material ID and glass - how to get good colors in CPU mode

The default material ID option is removed and it is recommended to use the random material ID output. Now I have the problem that I need to render masks of objects behind glass (wristwatches) and the strong glass mat ID color makes that the mask colors behind the glass looks bad. In the past I set the mat ID color of the glass to black or a very dark color. What can I do now?

Is the only way to manual add the MatID option to every material? Could it be done per script? If yes, please post a script. :wink:

Hey Micha, have you considered switching to Cryptomatte? Just add and configure Cryptomatte channel, install Exr-IO plugin into Photoshop and you get nice clean black nad white mask for every material in the scene.

Or wait… actually… there’s been a way to get material ID behing glass before and now?

Cryptomatte is to much for my clients and would cause a lot of unwanted data. A simple color mask would make my clients and me happy. During my projects I render dozen of images - I wouldn’t like to handle big exr files. I’m sure my clients don’t want to learn a new, more complex method for a simple task. :wink: