Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Looping a mask path

  • Dan Ebberts

    March 28, 2013 at 1:23 pm

    I just tried the expression and it works for me. Does it do anything at all when you try it?

    Dan

  • Jesse Gibson

    April 3, 2013 at 1:45 pm

    Hi Dan

    I must be doing something wrong as it doesn’t seem to do anything at all. It doesn’t give me an error though so perhaps there is something I’m missing.

    I’ve attached a screenshot below which shows the expression and the keyframes as well as the mask path as it is halfway through revealing the arrow layer from AI. At the moment, when the keyframes end the path stops moving.

    Thanks
    Jesse

    5761_pathexpression.jpg.zip

    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 Ebberts

    April 4, 2013 at 1:06 am

    It’s hard to tell from what I can see. If you can isolate just that piece of your project and post the .aep, I’ll take a look at it.

    Dan

  • Jesse Gibson

    April 4, 2013 at 8:53 am

    Thanks Dan – I really appreciate you taking a look at this.

    I’ve attached the project and media below with the stock arrows mask expression revealed. I’m trying to use an expression to make the arrows reveal and conceal at a tempo I can easily tweak and then replicate for the second set of arrows (preferably by pick whipping the expression but otherwise just by adding the same frequency/time value).

    Let me know if you need anything else.

    Cheers
    Jesse

    5772_maskpathpingpongfolder.zip

  • Dan Ebberts

    April 4, 2013 at 1:48 pm

    You have a bunch of keyframes for that mask that are beyond the out point of the layer (around 12 – 14 seconds). If you delete those it seems to work fine.

    Dan

  • Jesse Gibson

    April 4, 2013 at 2:56 pm

    Aha – don’t know how I managed to do that. Rookie error.

    Thanks very much for sorting me out. Much obliged.

    Cheers
    Jesse

  • Rotem Lu

    May 22, 2016 at 7:40 pm

    Hi Dan,

    thanks for this post already helped me allot,
    wanted to ask if I want the loop to start after few number of keys
    how can i modify it ?
    thank you
    Rotem

    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 Ebberts

    May 22, 2016 at 9:32 pm

    If you wanted, for example, to start looping frome the 3rd key, you would just change the second line from this:

    t1 = key(1).time;

    to this:

    t1 = key(3).time;

    Dan

  • Rotem Lu

    May 23, 2016 at 6:44 am

    Hi Dan,

    Works great!

    Many Many Thanks!!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy