ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression to use the time between two keyframes?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
David Cabestany
Expression to use the time between two keyframes?
on Jul 24, 2019 at 4:15:04 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.


Return to posts index

Dan Ebberts
Re: Expression to use the time between two keyframes?
on Jul 24, 2019 at 7:02:25 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



Return to posts index

David Cabestany
Re: Expression to use the time between two keyframes?
on Jul 30, 2019 at 3:44:20 pm

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


Return to posts index

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