Activity › Forums › Adobe After Effects Expressions › Script – to “wiggle” opacity of many layers
-
Script – to “wiggle” opacity of many layers
Posted by Michael Becke on July 14, 2006 at 9:37 amHi,
I need to randomly change the opacity levels of many layers, but don’t want to add a wiggle script to every layer since there are hundreds.
Mainly because if I want to change a setting later on I don’t want to have to change every layer.I am currently doing the above (terrible) solution but any help with a much quicker and more streamlined solution would be appreciated.
Thank you very much!!
MichaelAndreas Braendhaugen replied 15 years, 6 months ago 4 Members · 7 Replies -
7 Replies
-
Steve Roberts
July 14, 2006 at 12:30 pmCreate a null layer and apply the “slider” expression control effect twice. Name one “amp slider” and the other “freq slider”. Apply the wiggle expression to one layer’s opacity, just using freq and amp. You’ll probably get an error – ignore it. Select the word “freq” in the expression, and pickwhip it to the value of the “freq slider”. Do the same for the amp slider. Your wiggle expression should now be tied to the sliders. Change their values to test the wiggle.
Now select the opacity and edit>copy expression only. Select all the other layers and select edit>paste. They should all now have a wiggle expression. To change freq and amp, change the sliders.
Does that work for you?
-
Michael Becke
November 13, 2006 at 3:21 pmThanks Steve,
That was just what I needed… much appreciated!
And now I also know you can simply pick whip to add to the expression 😉Thanks,
Michael -
Andreas Braendhaugen
September 16, 2010 at 10:06 amI’ve found good use for this as well. Thank you, Steve!
I’m trying to do something slightly different with this expression – is it possible to have the layers fade in/out completely on each wiggle, instead of jumping to random values?
-
Dan Ebberts
September 16, 2010 at 8:45 pmIt would be very helpful if you could describe in greater detail, exactly the animation you’re trying to achieve.
Dan
-
Andreas Braendhaugen
September 16, 2010 at 9:01 pmHi Dan,
Sure!
I have a bunch of shape layers (dozens), that I want to fade in/out and have visible for random periods of time. The length of the fade in/out should be constant for all layers, but the duration of it should be random (between 2 and 20 seconds, roughly). Any suggestions/input would be greatly appreciated.
I’ve used expressions before, but I’m not quite there when it comes to writing my own.
-
Dan Ebberts
September 16, 2010 at 10:06 pmPlay around with this one:
fadeTime = .25;
minHold = 2;
maxHold = 20;seedRandom(index,true);
preRun = random(maxHold);
if (time >= inPoint + preRun){
t = inPoint + preRun;
t0 = t;
i = 0;while (time >= t){
t0 = t;
t += random(minHold,maxHold);
i++
}if (i%2)
ease(time,t0,t0+fadeTime,0,100)
else
ease(time,t0,t0+fadeTime,100,0);
}else{
0
}
Dan
Reply to this Discussion! Login or Sign Up