ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Setting value of 2nd keyframe by null position

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
John Pritchett
Setting value of 2nd keyframe by null position
on Jul 4, 2019 at 2:08:58 am

All.
Im stuck on what I thought was a pretty simple expression.
I have a simple 2 keyframe position animation.
I need Key1 to be the value it is currently, but the value of Key2 set by the position of a Null object.

This will set the animation go from a set point to wherever the null is positioned.
I have this expression currently, but it's not working.
Where have I gone wrong?

TIA

p = thisComp.layer("END POINT").position;
v1 = key(1).value;
v2 = key(2).value;
linear(value[2],v1[2],v2[2],v1,p);


Return to posts index

Andrei Popa
Re: Setting value of 2nd keyframe by null position
on Jul 4, 2019 at 8:21:21 am

This may work.
p = thisComp.layer("Shape Layer 2").transform.position;
v1 = key(1).value;
v2 = key(2).value;
linear(value[1],v1[1],v2[1],p,v1);


Andrei
My Envato portfolio.


Return to posts index

John Pritchett
Re: Setting value of 2nd keyframe by null position
on Jul 6, 2019 at 1:47:29 am

Thanks, but this seems to be giving the position of both keyframes, hence no animation...
I need it to affect only the second keyframe...
Any other guesses?


Return to posts index

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