ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Make Holdtime a variable

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Tayla Frances
Make Holdtime a variable
on Aug 25, 2017 at 10:38:17 am

Currently I am using the below code and I was wondering if just as the effect itself varies in intensity with a min and max val if I could do the same for the holdTime, so for instance it could hold anywhere between .5 sec to 5 sec.

effect("Minimax")(2)
holdTime = 3;
minVal = 20;
maxVal = 100;

seed = Math.floor(time/holdTime);
seedRandom(seed,true);
random(minVal,maxVal)


Return to posts index

Dan Ebberts
Re: Make Holdtime a variable
on Aug 25, 2017 at 3:58:53 pm

Like this:


minVal = 20;
maxVal = 100;
minDur = .5;
maxDur = 5;
seedRandom(index,true);
tNext = tPrev = 0;
while (tNext <= time){
tPrev = tNext;
tNext += random(minDur,maxDur);
}
seedRandom(tPrev,true);
random(minVal,maxVal)


Dan



Return to posts index

Tayla Frances
Re: Make Holdtime a variable
on Aug 26, 2017 at 8:59:33 am

Thanks Dan worked like a charm!


Return to posts index

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