Global materials override for the Blender EEVEE render engine

Some times we need to make a render of the scene with the single material, for example, for clay or wireframe renders. Blender has the global materials override option for the Cycles render engine in the “View Layer Properties” – “Override” but not for the EEVEE render engine.

Quick materials override for the EEVEE rendering engine can be made with a small script, as shown in the following video:

Script and video by Vitaly Sokol.

The following script is used to make a quick global materials overriding system:

When executed, this script creates a node group and inserts it into each material before the “Material Output” node.

Any material before script execution:

The same material after script execution:

There is the “Diffuse” node linked to the “Mix” node and the external input linked to the same “Mix” node which translates the main object material into the node group. The “Diffuse” node is the shader that will override the main object material. Instead, you can create your own node combination to make the proper material for the override. But it should be located only inside this node group.

To start this working – replace the main object material with the material from the group, we just need to change the “Factor” value of the “Mix Shader” node from 0 to 1. The “Mix Shader” node works as a switcher: Factor = 0 – we render objects with their own materials, Factor = 1 – the single material of the group is used for all objects in the scene.

Switching the “Factor” value to 1, we will see that absolutely all objects in the scene change their materials from their own to the material of the group (Diffuse). This works because the node group works as an “instance” or “pointer” – its contents remain the same all the time, regardless of the material in which the node group is placed.

Since the script placed this node group in each material, we get the opportunity to easily replace all scene materials with the single material and back just changing the “Factor” value of the “Mix Shader” node inside the group.

Nikita

Author: Nikita

Blender add-ons developer and articles writer.