Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression to use the time between two keyframes?

  • Expression to use the time between two keyframes?

    Posted by David Cabestany on July 24, 2019 at 4:15 pm

    I’m trying to link a property in a layer to the time elapsed between two keyframes, so instead of defining the duration as .5 seconds for example, I define it as whatever the time lasts in between regardless of how I move those keyframes in the timeline in different compositions.

    Any ideas?

    Thanks.

    David Cabestany replied 7 years ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    July 24, 2019 at 7:02 pm

    Something like this, probably:

    prop = thisComp.layer(“Layer 1”).position;
    t1 = prop.key(1).time;
    t2 = prop.key(2).time;
    dur = t2 – t1;

    Dan

  • David Cabestany

    July 30, 2019 at 3:44 pm

    Thanks Dan, yes, I figured it almost right away, felt pretty silly afterward, I thought a more complex expression was needed.

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