2
$\begingroup$

I have an object with multiple materials assigned to its various faces and want to adjust the global opacity of said object. So far I can only adjust the materials individually.

Can anyone help figure this out?

Cheers, Dan

$\endgroup$
4
  • $\begingroup$ Hello, is this for Cycles, Eevee, or in the 3D viewport ? Or all three ? $\endgroup$ – Gorgious Aug 28 '20 at 13:53
  • $\begingroup$ Hi, this is for Eevee $\endgroup$ – Dan Abel Aug 28 '20 at 13:56
  • $\begingroup$ Add a driver to the alpha/transparency channels of all the materials you want to control $\endgroup$ – Ron Jensen Aug 28 '20 at 14:07
  • $\begingroup$ hi Ron thanks for your message although I'm fairly new. How do I do this? $\endgroup$ – Dan Abel Aug 28 '20 at 14:37
1
$\begingroup$

Here are two solutions.

Make sure each material has a blend mode set to alpha Blend or Hashed (Or clip if you don't want the material to be semi transparent before going into full transparency). These settings will only appear if Eevee if set as your render engine.

enter image description here

enter image description here

First solution (with a driver)

Create a value node and put it into a node group with Node > Make Group (CTRL G).

Rename the group and plug it into the principled BSDF of each of your materials. (To add in a material, choose Add > Group > group name )

enter image description here

In your object properties, on the last foldout click "add" to add a new custom property.

enter image description here

Now for ease of use you can access it in the N panel on the right of the viewport.

enter image description here

Get back into your node group by clicking on the icon on its top right. Right click in the "prop" field and choose "Copy as new Driver". Right click in the "Value" node's field and choose "Paste Driver". The field should now be purple.

enter image description here

Tweak the new prop to change the opacity of all the materials at once.

enter image description here

Second method : With the object color

The method is the same as the previous one, but you have to replace the value node by an "Object info" node and plug its "Color" output into the group output.

enter image description here

Go into the object properties, viewport display, and adjust the value of its viewport color to modify the opacity.

enter image description here

Conclusion

Use the first method if you want to control the opacity of your materials across several objects, use the second one if you want to control the opacity of your materials on a specific object.

$\endgroup$
1
$\begingroup$

If you want a quick fix, without a need to restructure your project, you could write a simple Python script to change given object (or multiple objects by wrapping it in another loop).

import bpy 
 
for material_slot in bpy.data.objects['Cube'].material_slots:
    material_slot.material.blend_method = 'BLEND'
    material_slot.material.node_tree.nodes["Principled BSDF"].inputs[19].default_value = .3

You can get this specific part ["Principled BSDF"].inputs[19] by right-clicking on a property in the node editor and choosing Copy Data Path.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.