Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions How to make curved motion using my existing expression?

  • How to make curved motion using my existing expression?

    Posted by Darryl Torke on February 28, 2014 at 3:10 am

    Hi, I have a very simple expression that uses the ‘easeIn’ expression, and it looks essentially like this:

    A=[0,500];
    B=[2000,500];
    easeIn(time,0,2,A,B);

    As you can see, the motion moves in a line from point A to point B, however it moves straight. I was wondering if there was a way to make the movement *curved*? (something like this: https://img.tfd.com/mgh/Investopedia/Yield_Curve.png is what I had in mind). And ideally, if there is anyway I could adjust this curve slightly if I have to.

    A=[0,500];
    B=[2000,500];
    easeIn(time,0,2,A,B);

    Darby Edelen replied 12 years, 2 months ago 2 Members · 3 Replies
  • 3 Replies
  • Darby Edelen

    February 28, 2014 at 5:14 am

    Is there some reason you can’t simply use keyframe animation?

    Darby Edelen

  • Darryl Torke

    February 28, 2014 at 7:32 pm

    Yes, sorry, the example is just a loose understanding. I use constantly changing variables, and each time I apply the layer the origin point and end point change (however the end point is always diagonal from the origin point). The full code is below:

    L = thisComp.layer("Origin");
    G1 = L.toWorld(L.anchorPoint,inPoint);
    G2 = L.toWorld(L.anchorPoint,inPoint) + [2000, 500];
    easeIn(time,inPoint,outPoint,G1,G2);

  • Darby Edelen

    February 28, 2014 at 9:50 pm

    Use another “template” layer’s motion path between 0 and 1 seconds to define the path the layer should follow.


    origin = effect("Origin")("Layer");
    template = effect("Motion Template")("Layer");

    start = origin.toWorld(origin.anchorPoint,inPoint);

    t = linear(time,inPoint,outPoint,0,1);

    a = template.toWorld(template.anchorPoint, 0);
    b = template.toWorld(template.anchorPoint, t);

    start + b - a;

    You’ll also notice that I’m pointing to a couple of Effect > Expression Control > Layer Controls on the layer instead of to the layers directly. This allows you to easily apply different Origin/Template layers to each layer.

    Darby Edelen

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