3
$\begingroup$

In Blender I have been wanting to create an effect where an object with multiple textures disappears evenly. I have figured out how to do this individually, but I would like to be able to decrease opacity for multiple materials. I have just started with blender, Sorry if this is a stupid question.

Thanks, John

$\endgroup$
  • $\begingroup$ One way to do this would be placing all of the objects you want to disappear on a separate layer and use the compositor to control the opacity for that particular layer. $\endgroup$ – cegaton Jul 12 '16 at 23:01
  • 1
    $\begingroup$ I would do this using drivers. Have you worked with drivers before? $\endgroup$ – PGmath Jul 12 '16 at 23:05
  • 1
    $\begingroup$ You could keyframe the transparency value for each material individually, or you can use drivers, as @PGMath suggested. $\endgroup$ – Anthony Forwood Jul 12 '16 at 23:21
  • 1
    $\begingroup$ What render engine are you using? $\endgroup$ – PGmath Jul 12 '16 at 23:26
1
$\begingroup$

You can do this fairly easily by using some simple drivers. Drivers are a way of controlling one property based on the value of another property or properties. If you have never used them before drivers can seem a bit daunting, but simple driver setups like this are actually pretty easy to set up.

First, add an empty to your scene. This will serve as a "fader" to adjust the opacity of your materials. This way you can just animate the movement of the empty, and in turn it will control all the transparency. (It is not necessary, but somewhat convenient to add a couple Limit Location constraints to the empty to only allow it to move in a straight line like a real fader.)

enter image description here

Next, right click on the opacity setting for your material and select Add Driver. This will make the field turn pink, indicating that it is now being controlled by a driver.

Now jump over to the Graph Editor and select Drivers under the Mode selector.

enter image description here

Now find the driver on the hirearchical list on the left and select it. (I am using the Cycles render engine, so yours may be a little different than mine if you are using Blender Render. Basically it will just be at the bottom of the hirearchy.)

Now look at the panel on the right side (if it's not there just hit N) and scroll down to the Drivers rollout. Near the top here is a field called expr, this is the expression that determines the actual value of the driven property. Just type "var" here, as that is the default name of the default variable and it will work fine for us (in more complex situations when you are dealing with multiple variables it is usually good practice to name them something more useful). Now go down to the variable named "var" and select the empty you added for the Ob/Bone field and select Y Location for the type.

enter image description here

Now as you move the empty up in the y-direction the opacity of all your materials should change accordingly!

$\endgroup$
0
$\begingroup$

There is another, slightly simpler way you can do this (as opposed to my other answer) if you are using the Cycles render engine by using a node group.

A group node is a set of nodes combined into one. To turn a set of nodes into a group node, select them and hit Ctrl+G. You can edit a group node by selecting it and pressing Tab, press Tab again to leave the group node's editing mode.


First add a Transparent shader and a Mix Shader node and plug the Transparent node into the top input of the Mix Shader. Then select the two nodes and hit Ctrl+G to group them into one. This will automatically bring you into edit mode for the new node group.

enter image description here

You will notice that there are two more nodes inside the node group, a Group Input and a Group Output node. This is how information is passed into and out of the node group. By default the node has no inputs or outputs, making it pretty useless. To fix this, drag a node wire from the socket on the Group Input node and plug it into the bottom socket on the Mix Shader. Then connect the output of the Mix Shader to the Group Output node.

enter image description here

This group node can now be added to any of your materials under the Shift+A > Group menu.

Now you can add this group node at the very end of all your material node trees. When you go into the group node and adjust or animate the mix factor it will adjust the opacity of all the materials you have added this node to.

$\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.