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?
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It only takes a minute to sign up.Sign up to join this community
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.
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 )
In your object properties, on the last foldout click "add" to add a new custom property.
Now for ease of use you can access it in the N panel on the right of the viewport.
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.
Tweak the new prop to change the opacity of all the materials at once.
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.
Go into the object properties, viewport display, and adjust the value of its viewport color to modify the opacity.
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.
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.default_value = .3
You can get this specific part
["Principled BSDF"].inputs by right-clicking on a property in the node editor and choosing Copy Data Path.