ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

How to create a Random Hold Time expression between Ping Pong effect?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Kyle Balitz
How to create a Random Hold Time expression between Ping Pong effect?
on Feb 22, 2019 at 4:20:28 am

Hi does anyone know how to do a random hold time expression which I used a time remap ping pong effect? I want to the hold time to be random after the effect ping pongs?

I was looking on the forum and something looked similar to this:



if (numKeys > 1){
minDelay = 1;
maxDelay = 4;
t1 = key(1).time;
t2 = key(numKeys).time;
if (time > t2){
acc = t2;
i = 1;
while (acc &lt;= time){
seedRandom(i,true);
delay = random(minDelay,maxDelay);
prev = acc;
acc += delay + (t2 - t1);
i++;
}
if (time &lt; prev + delay)
valueAtTime(t2)
else
valueAtTime(t1 + time - (prev + delay));
}else
value;
}else
value


Return to posts index

Oleg Pirogov
Re: How to create a Random Hold Time expression between Ping Pong effect?
on Feb 24, 2019 at 7:12:23 am

So, what's the problem with the code?
If you animate one ping pong of yours with keyframes, the code seems to do exactly what you need.


Return to posts index

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