ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Loop a script with no keyframes

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Adam Haas
Loop a script with no keyframes
on Jan 9, 2018 at 9:59:16 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);


Return to posts index

Dan Ebberts
Re: Loop a script with no keyframes
on Jan 9, 2018 at 10:09:58 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



Return to posts index

Adam Haas
Re: Loop a script with no keyframes
on Jan 9, 2018 at 10:55:05 pm

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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]