Temporarily reassign all materials to one material type?

I have a complex model with multiple material groups but it is often very helpful for me to view the model with just one material setting such as a chalk or clay sculpture. Is there a known way to make a temporary switch so that I could render out the model with simply this one overall material.

The real trick is I would also like to keep my displacement and bump maps applied. I really just want to view the current model as if it were composed of entirely the same material, then when I’m done switch back to the more complex material assignments.

render layer properties have a material override option

Yes, this is helpful, however it will not allow for displacement and bump maps that would contribute to the look of the shape of the model to be maintained with each material. A more specific override allowing for other attributes to flow through would be very useful.

Since Displacement is part of the material, the only way to override parts of it is to use Python…


import bpy
for m in bpy.data.materials:
    if m.node_tree:
        if m.node_tree.type=='SHADER':
            onode=m.node_tree.nodes['Material Output']
            nnode=m.node_tree.nodes.new('Bsdf_Diffuse')
            m.node_tree.links.new(nnode.outputs[0], onode.inputs[0])

note, you may need to change the script if you want something else beside the diffuse, or if you have volume shaders.

Note 2, this script does not restore the original materials. You should full copy your scene, and use the script in the copy, or adapt the script for storing the original link to the ‘Material Output’ sockets.