 | 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);
 | 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
 | 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.