-
Loop keyframes gains over time
for example: I have a walk cycle of a character that bobs up and down between two keyframe as well as position move about 50 pixels to the left. Well I want that motion to loop again and again but at the same time move another 50 pixels every time it loops so it makes its way off screen. How would i go about creating a loop that gains over time? I have found an expression where you can choose which keyframes to loop and how many times, so i figured that would be a good start but how would i be able to have it gain every time it loops?
if (numKeys > 1){
nLoops = 5;
t1 = key(1).time;
t2 = key(2).time;if (time < t1)
value
else if (time < t1 + nLoops*(t2-t1))
valueAtTime(t1 + (time - t1)%(t2-t1))
else
valueAtTime(t2 + time - (t1 + nLoops*(t2-t1)));
}else
value