Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Setting value of 2nd keyframe by null position

  • Setting value of 2nd keyframe by null position

    Posted by John Pritchett on July 4, 2019 at 2:08 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);

    John Pritchett replied 6 years, 11 months ago 2 Members · 2 Replies
  • 2 Replies
  • Andrei Popa

    July 4, 2019 at 8: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.

  • John Pritchett

    July 6, 2019 at 1:47 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?

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