ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

switching AE Layers randomly on (within a given time)

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Baba Luba
switching AE Layers randomly on (within a given time)
on Feb 18, 2019 at 12:51:51 pm

Im looking for a Script witch set the opacity of a layer randomly to 100% (starting with 0)
I found this within the forums:

----------------------------
holdTime = .5; //time to hold each position (seconds)
seed = Math.floor(time/holdTime);
seedRandom(seed,true);
hmm = random(0,10);
if (hmm >5){
transform.opacity=100};
else {transform.opacity=0};

its kind of what I want, but I want the layers to stay on.
-------------------------------

If I could make a wish it should do this:

switch the opacity of a layer on within a given time (a variable) say a second (randomly within this second switch on)

then stay on for a given time (3,5,10 sek another variable)

than switch back off within a given time

on within a second
stay on for 5 sekonds
off after (in this case) 6 seconds within a second
together 7 seconds

any idea, I'm not good at coding ;O)


Return to posts index

Dan Ebberts
Re: switching AE Layers randomly on (within a given time)
on Feb 18, 2019 at 1:56:46 pm

This might be close:


minOnTime = 0;
maxOnTime = 1;
holdTime = 3;
minOffTime = 0;
maxOffTime = 1;
seedRandom(index,true);
onTime = random(minOnTime,maxOnTime);
offTime = random(minOffTime,maxOffTime);
if (time < onTime){
0;
}else if (time < onTime+holdTime+offTime){
100;
}else{
0;
}



Dan



Return to posts index

Baba Luba
Re: switching AE Layers randomly on (within a given time)
on Feb 18, 2019 at 3:47:49 pm

thank you very much !!!

I just tried it and it seems to work
very much appreciated


Return to posts index

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