ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression for random fade-in opacity for multiple layers

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Al Mach
Expression for random fade-in opacity for multiple layers
on Feb 4, 2016 at 6:55:51 pm

I'm trying to randomize a short opacity fade-in from 0 to 100 on many different layers. Basically I just want 64 different boxes to randomly fade in over 10 frames or so (i've broken up these layers into rows, so there are 8 pre comps with 8 layers each). I've tried searching for the answer but seems like all of the posts are about randomly turning opacity on and off. I just want a simple fade-in,

Any help would be much appreciated!


Return to posts index

Dan Ebberts
Re: Expression for random fade-in opacity for multiple layers
on Feb 5, 2016 at 4:22:02 am

Play around with this and see if it's close to what you're looking for:

fadeDuration = thisComp.frameDuration*10;
maxDelay = .5;
seedRandom(index,true);
delay = random(maxDelay);
t = time -(inPoint + delay);
linear(t,0,fadeDuration,0,100)


Dan



Return to posts index

Al Mach
Re: Expression for random fade-in opacity for multiple layers
on Oct 1, 2018 at 11:02:52 pm

I'm returning to this message because I have to use this expression again, except to randomly fade opacity from 100 to 0. For some reason, the expression above is not randomizing the layers (all the laters are fading at the same time. Can you help?

Thanks in advance.


Return to posts index


Dan Ebberts
Re: Expression for random fade-in opacity for multiple layers
on Oct 1, 2018 at 11:21:23 pm

It works for me if I change the last line to:

linear(t,0,fadeDuration,0,100)


Dan



Return to posts index

Al Mach
Re: Expression for random fade-in opacity for multiple layers
on Oct 1, 2018 at 11:25:35 pm

So this is the expression I'm using:

fadeDuration = thisComp.frameDuration*10;
maxDelay = .5;
seedRandom(index,true);
delay = random(maxDelay);
t = time -(inPoint + delay);
linear(t,0,fadeDuration,100,0)


The last line has the opacity going to 0, because this is what I need in this animation. Unfortunately it's not randomizing like I need it to (all the layers are fading out at the exact same time). Can you help with this?


Return to posts index

Dan Ebberts
Re: Expression for random fade-in opacity for multiple layers
on Oct 2, 2018 at 12:36:54 am

That should work unless the expression is inside a precomp and you're duplicating the precomp layer.


Dan



Return to posts index


Al Mach
Re: Expression for random fade-in opacity for multiple layers
on Oct 2, 2018 at 5:48:36 pm

Then expression is on a slider, and the layers below (vector layers from Illustrator) are linked to the slider (their opacity). The opacity is working, just not the randomness. I don't understand what I'm doing wrong. I've attached a screenshot to show you how the opacities of the different layers are fading at exactly the same time.



Return to posts index

Dan Ebberts
Re: Expression for random fade-in opacity for multiple layers
on Oct 2, 2018 at 6:10:28 pm

If you want the timing to be different for each layer, you'd have to apply the expression to each layer's opacity property, not link them all to the same slider.


Dan



Return to posts index

Al Mach
Re: Expression for random fade-in opacity for multiple layers
on Oct 2, 2018 at 6:24:28 pm

Amazing, thanks so much!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]