Skip to main content
Participant
July 16, 2020
Frage

Looking for a way to control opacity of multiple layers with a slider. BUT WITH A TWIST! Help?

  • July 16, 2020
  • 2 Antworten
  • 3540 Ansichten

Hello! I know I can pickwhip opacity to a slider control to amke a universal controller, but I really need to also control each layer's opactiy independently of the slider as well.

 

Basically, I want to be able to have all the opacities work independantly and then all the layers turn off at the same time. I would like to use a slider control so I can mess around with what time all the layers turn off easily, instead of going into each layer individually. 

 

Is there an expression that can help? Is there an effect or something else I can use that can fade layers out?

 

Thanks!!!

Dieses Thema wurde für Antworten geschlossen.

2 Antworten

Community Expert
July 16, 2020

The quick and dirty way:

 

 

ctrl = thisComp.layer("Master Controller").effect("Opacity Slider Control")("Slider");
value + ctrl

 

 

Start with the slider at 100, then animate it to zero with a couple of keyframes.

 

If you want things proportional then the code can be modified like this:

ctrl = thisComp.layer("Master Controller").effect("Slider Control")("Slider")/100;
vFactor = linear(ctrl, 0, 1);
value * vFactor

 

With this expression, if a keyframe value is 50 and the slider value is 50 then the net result will be 25. If the slider is raised to 100 then the value will be 50 but it cannot go higher than 50. If you have a bunch of layers with this expression and you set up different opacities for each layer then the relationship and the look will stay the same. With the first expression, the more opaque layers will fade faster than the more transparent ones. 

 

(edit - removed an expression that didn't work, that's what I get for writing expressions without having AE open to check them)

 

Justin Taylor-Hyper Brew
Community Expert
Community Expert
July 16, 2020

Sure, you can set the max limit at your control slider so you can adjust the opacity individually as long as it's under the master control, but once the master control goes down, so does everything else:

 

Math.min(value, thisComp.layer("Control").effect("Master Opacity")("Slider").value);