ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

random duration of a holdTime

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Robert Paynter
random duration of a holdTime
on Jan 24, 2020 at 3:39:28 pm

I'm using an number odometer built . The count of this odometer is driven by a angle controller using with the expression below. I want the numbers to tick up more naturally. I'm using the expression below. I'd like to have a hold time duration be more random between .1 and .5. Any help would be much appreciated.

easeTime = .2;
holdTime =.5;
amt = 36;
period = easeTime+holdTime;
t = time - inPoint;
seg = Math.floor(t/period);
p = t%period;
seg*amt + ease(p,0,easeTime,0,amt)


Return to posts index

Dan Ebberts
Re: random duration of a holdTime
on Jan 24, 2020 at 8:20:37 pm

Varying the hold time will mess up the entire expression, so you would need to go to a more cumbersome model, like this:


easeTime = .2;
minHoldTime = .1;
maxHoldTime = .5;

seg = 0;
segStart = inPoint;
curT = inPoint;
while (curT <= time){
seedRandom(seg,true);
holdTime = random(minHoldTime,maxHoldTime);
period = easeTime+holdTime;
segStart = curT;
seg++
curT += period;
}
t = time - segStart
amt = 36;
(seg-1)*amt + ease(t,0,easeTime,0,amt)


Dan



Return to posts index

Robert Paynter
Re: random duration of a holdTime
on Jan 24, 2020 at 8:48:50 pm

Perfecto Dan. What would we do without you ?


Return to posts index


Robert Paynter
Re: random duration of a holdTime
on Jan 24, 2020 at 9:15:26 pm

This always starts at 0
What if I wanted to start the count on a bigger number?


Return to posts index

Robert Paynter
Re: random duration of a holdTime
on Jan 24, 2020 at 9:21:41 pm

nevermind figured it out

easeTime = .2;
minHoldTime = .01;
maxHoldTime = .5;

seg = 0;
segStart = inPoint;
curT = inPoint;
while (curT &lt;= time){
seedRandom(seg,true);
holdTime = random(minHoldTime,maxHoldTime);
period = easeTime+holdTime;
segStart = curT;
seg++
curT += period;
}
t = time - segStart
amt = 36;
(seg-1)*amt + ease(t,0,easeTime,0,amt)+(36*effect("Slider Control 2")("Slider"))


Return to posts index

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