If we change this object variation to object name, it's actually going to render the same color for objects that have the same name. Right now the material is rendering a separate color for each individual object. Now we get a separate color for each material and each individual object and if we want to change the colors that are applied and make them a little bit more random, we can always go in and adjust the random seed. So let's go ahead and render this pass and see what it looks like. We do want to make sure to leave the lens distortion effect enabled so that the matte is distorted in the same way as our final beauty render. Because this is a simple matte pass, we can go ahead and disable global illumination and switch the renderer into the standard render engine so things render a bit faster. We'll go ahead and disable the option to preserve transparency so that the transparent materials are rendered with a solid matte. And now we can just drag the variation material into the custom material slot and now that material will be used in place of all the existing materials in this scene. But first we want to create a new child render setting so we don't affect the beauty pass and we'll go ahead and rename this "Matte Pass." I'll go ahead and enable the matte pass and make sure it's selected and we want to go ahead and enable the material override. Now we need to apply this material as an override within the render settings. And that way your color won't be mixed with any other color. When using the variation shader to generate solid colors like we want for our matte, we need to make sure that we switch the random color mode here in the options from normal to replace. We only need the luminance channel here so we'll disable color and reflectance and in the luminance channel I want to go ahead and add a new variation shader. So let's go ahead and create a new material and we'll double click to open that material in the material editor and I'm going to go ahead and rename this variation. To do this we'll use the take system and the variation shader. One of my favorite uses of material override is to generate special map passes like a single pass identifying all the materials in this scene. We can switch the mode to include and now only the deck material will be replaced with Cinema 4D's default material and all of the other materials will render as they were originally defined. So now you can see that we're getting the orange texture here on the deck while all the other textures are being replaced with Cinema 4D's default material. If you want to highlight a specific material you can just drag it into the materials list here in the material override settings and as long as the mode is set to exclude, that material will be excluded from the override, meaning that material will render while all the others are replaced. Or maybe you want to send a client a preview but the texturing just isn't done yet. This functionality can be handy if you want to focus on the lighting of a scene without the textures. So if we uncheck transparency and displacement and render again you'll see that the skateboard wheels are now going to render completely solid with no displacement. If we want to override those channels as well, we can simply uncheck the box to preserve that channel. And that's because by default Cinema 4D will preserve the transparency, bump, normal, alpha and displacement channels because those channels often define the shape of an object. Now you'll notice that the transparency and displacement is actually still being retained from the original materials. If I do just this and nothing else Cinema 4D will replace all of those materials with its own default material. But now I can simply open the render settings and enable the material override option.
In this scene we've got lots of materials spread throughout the hierarchy of the skateboard and replacing all these materials would be a tedious job. With global material override you can easily override all the materials in your scene or just specific materials and you can even choose which channels you want to override.