Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Possible to execute sequential linear calls

  • Possible to execute sequential linear calls

    Posted by Josh Peters on March 8, 2016 at 5:17 am

    Basically I’m trying to templatize some really simple moves for a bulk project. The concept is to use linear to build in animations based off the in/out point of a layer. The code below is just playing around at the moment but I can’t figure out a way to get it to execute more than one linear command, is this possible?

    key1=inPoint;
    key1end=inPoint+.3;
    key2=outPoint;
    key2end=outPoint-.3;
    Width=width*scale/100;
    posx=640-(Width[0]+Width[0]/2);

    linear(time, key1, key1end, [posx, 360],[640,360]);

    linear(time, key1end, key2end, [640, 360],[850,360]);

    Josh Peters replied 10 years, 2 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    March 8, 2016 at 7:28 am

    You have to combine them such that only one of them executes, so the last part would be like this:


    if (time < key1end)
    linear(time, key1, key1end, [posx, 360],[640,360])
    else
    linear(time, key1end, key2end, [640, 360],[850,360]);

    Dan

  • Josh Peters

    March 8, 2016 at 4:28 pm

    Thanks Dan! I needed to get multiple else if statements in there and I think I was just structuring my conditionals incorrectly, what I posted below seems to be working pretty well. Now it’s just a matter of building in some variables for positions.

    key1=inPoint;
    key1end=inPoint+.3;
    key2=outPoint;
    key2end=outPoint-.3;
    Width=width*scale/100;
    posx=640-(Width[0]+Width[0]/2);

    if (time &lt;= key1end && time>=key1)
    linear(time, key1, key1end, [posx, 360],[640,360])
    else if (time>key1end && time&lt;=key2end)
    linear(time, key1end, key2end, [640, 360],[850,360])
    else if (time>key2end && time&lt;=key2)
    linear(time, key2end, key2, [850, 360],[1050,360])

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