ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

loopOut pingpong doesn't work on a mask shape?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Naveen Mallikarjuna
loopOut pingpong doesn't work on a mask shape?
on Apr 11, 2012 at 12:45:21 pm

Hi all.

Long time AE user, new to expressions.

I'm trying to apply the loopOut("pingpong") expression to an animating mask. Doesn't seem to work. Is this an expression that does not apply to mask shapes?

(To be sure I was doing it right, after it didn't work, I used the expression on the Rotation parameter. When that worked, I copied and pasted the expression to ensure my syntax was correct.)

Thanks!

Naveen


Return to posts index

Dan Ebberts
Re: loopOut pingpong doesn't work on a mask shape?
on Apr 11, 2012 at 3:28:47 pm

I'm surprised it doesn't work. Well, you can "roll your own" ping pong expression. This should work:


if (numKeys >1 && time > key(numKeys).time){
t1 = key(1).time;
t2 = key(numKeys).time;
span = t2 - t1;
delta = time - t2;
seg = Math.floor(delta/span);
t = delta%span;
valueAtTime((seg%2) ? (t1 + t) : (t2 - t));
}else
value



Dan



Return to posts index

Naveen Mallikarjuna
Re: loopOut pingpong doesn't work on a mask shape?
on Apr 11, 2012 at 6:19:12 pm

Yeah, I'm surprised too. Here's what I get:

Bad method arguments: loop is not supported for custom properties
Expression disabled.

I guess the animation of the mask shape is something loop doesn't handle.

Naveen


Return to posts index


Navarro Parker
Re: loopOut pingpong doesn't work on a mask shape?
on Dec 31, 2012 at 9:49:08 pm

How would do you a normal (non ping-pong) loop for masks?


Return to posts index

Dan Ebberts
Re: loopOut pingpong doesn't work on a mask shape?
on Dec 31, 2012 at 10:07:49 pm

This should work:


if (numKeys >1 && time > key(numKeys).time){
t1 = key(1).time;
t2 = key(numKeys).time;
span = t2 - t1;
delta = time - t2;
t = delta%span;
valueAtTime(t1 + t)
}else
value


Dan



Return to posts index

Navarro Parker
Re: loopOut pingpong doesn't work on a mask shape?
on Jan 1, 2013 at 12:24:16 am

Thanks Dan! Works like a charm!

(And Happy New Years Eve!)


Return to posts index


Ed Stables
Re: loopOut pingpong doesn't work on a mask shape?
on Apr 9, 2016 at 2:37:19 pm

Thank you so much for coming up with this expression. Much appreciated


Return to posts index

Luis Merino
Re: loopOut pingpong doesn't work on a mask shape?
on Jul 13, 2018 at 4:41:03 pm

Hello,
I have a big question!

I'm trying to loop a path but i want the loop to be "Pingpong" after the first keyframe.
According to what I've read, this is the expression for looping paths but it only works for cycle loop.

Is there any way to make it work as a pingpong loop?

if (numKeys >1 && time > key(numKeys).time){
t1 = key(1).time;
t2 = key(numKeys).time;
span = t2 - t1;
delta = time - t2;
t = delta%span;
valueAtTime(t1 + t)
}else
value


Return to posts index

Dan Ebberts
Re: loopOut pingpong doesn't work on a mask shape?
on Jul 13, 2018 at 5:43:26 pm

Try it this way:


if (numKeys > 1 && time > key(numKeys).time){
t1 = key(1).time;
t2 = key(numKeys).time;
span = t2 - t1;
delta = time - t2;
seg = Math.floor(delta/span);
t = delta%span;
valueAtTime((seg%2) ? (t1 + t) : (t2 - t));
}else
value



Dan



Return to posts index

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