Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Dynamically control x,y property of keyframe

  • Dynamically control x,y property of keyframe

    Posted by Matt Miller on March 17, 2021 at 4:41 pm

    I was hoping someone could help me create an expression to accomplish the following. I have a simple two keyframe animation and I would like to control the x,y values of the second keyframe by using values from a separate text layer. So basically I could input something like 0,20 in my source text layer and it would adjust the the position values of my second keyframe to match (0,20).

    Thanks in advance!

    Matt Miller replied 5 years, 2 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    March 17, 2021 at 5:15 pm

    Maybe something like this, unless you need to preserve your easing, which is a whole different story:

    t1 = key(1).time;

    v1 = key(1).value;

    t2 = key(2).time;

    txt = thisComp.layer("text").text.sourceText.split(",");

    x = parseInt(txt[0],10);

    y = parseInt(txt[1],10);

    linear(time,t1,t2,v1,[x,y]);

  • Matt Miller

    March 17, 2021 at 6:23 pm

    This worked perfectly! As always, thank you so much for your help!

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