Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Loop a script with no keyframes

  • Loop a script with no keyframes

    Posted by Adam Haas on January 9, 2018 at 9:59 pm

    I have a script that moves a layer upwards. That works fine, but I want the script to repeat itself. If this were key frames, no problem. I’d add a loopOut and call it a day. How do I loop a script or tell the script to repeat itself from the beginning?

    t = .5;

    StartPos = [640,250];
    EndPos = [StartPos[0],StartPos[1]-50];

    ease(time,inPoint,inPoint + t,StartPos,EndPos);

    Adam Haas replied 8 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    January 9, 2018 at 10:09 pm

    Something like this, mabye:


    d = .5;
    t = (time-inPoint)%d;

    StartPos = [640,250];
    EndPos = [StartPos[0],StartPos[1]-50];

    ease(t,0,d,StartPos,EndPos);

    Dan

  • Adam Haas

    January 9, 2018 at 10:55 pm

    Woah, that worked. I don’t fully understand how (time-InPoint)%d is causing it to loop, but it sure does the trick.

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