ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression to trigger based on comp duration

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
John Pritchett
Expression to trigger based on comp duration
on Jul 1, 2019 at 3:02:18 am

Legends. I need a simple 2 keyframe position animation to start based on the comp duration. ie animation runs 1 sec, so I need to determine the comp duration, then subtract 1 sec so the animation always finishes at comp end..
Any help appreciated!!


Return to posts index

Dan Ebberts
Re: Expression to trigger based on comp duration
on Jul 1, 2019 at 6:17:25 am

It'll probably be something like this:

t1 = key(1).time;
t2 = key(2).time;
d = t2-t1;
t = linear(time,thisComp.duration-d,thisComp.duration,t1,t2);
valueAtTime(t)


Dan



Return to posts index

John Pritchett
Re: Expression to trigger based on comp duration
on Jul 1, 2019 at 8:05:18 am

Dan, you are truly a master.
Works almost perfectly!
The animation is not finishing completely 1 frame from the end of the comp..
I added a thisComp minus .1sec, and it works fine.

Thank you.

t1 = key(1).time;
t2 = key(2).time;
d = t2-t1;
t = linear(time,thisComp.duration-d,thisComp.duration-.1,t1,t2);
valueAtTime(t)


Return to posts index


John Pritchett
Re: Expression to trigger based on comp duration
on Jul 1, 2019 at 8:06:07 am

t1 = key(1).time;
t2 = key(2).time;
d = t2-t1;
t = linear(time,thisComp.duration-d,thisComp.duration-.1,t1,t2);
valueAtTime(t)


Return to posts index

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