| loopOut pingpong doesn't work on a mask shape?
• | | | |
 | loopOut pingpong doesn't work on a mask shape?
by Naveen Mallikarjuna 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
| | | | |
• | | | |  | Re: loopOut pingpong doesn't work on a mask shape? by Dan Ebberts 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
| | | | |
• | | | |  | Re: loopOut pingpong doesn't work on a mask shape? by Naveen Mallikarjuna 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
| | | | |
• | | | |  | Re: loopOut pingpong doesn't work on a mask shape? by Navarro Parker on Dec 31, 2012 at 9:49:08 pm |
How would do you a normal (non ping-pong) loop for masks?
| | | | |
• | | | |  | Re: loopOut pingpong doesn't work on a mask shape? by Dan Ebberts 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
| | | | |
• | | | |  | Re: loopOut pingpong doesn't work on a mask shape? by Navarro Parker on Jan 1, 2013 at 12:24:16 am |
Thanks Dan! Works like a charm!
(And Happy New Years Eve!)
| | | | |
| |
|