-
Measuring time intervals from an irregular counter – and adding it to an expression.
Any help greatly appreciated on a problem I’m having.
I have a slider control which is key-framed to count up a number of times (this itself is irregularly timed). This controls a series of different parameters but the one I’m having most issue with is the anchor point. I want the anchor point to move from one side to the other over the time a loop lasts.
I’m flummoxed. I’ve posted what I have below.
What I think I need to do is to automatically measure how long the current loop lasts, add that length of time to all the previous loops and then insert it as a variable to the “ease” expressions.
// VALUES FROM LOOP
loop = effect("LoopSpeed")("Slider");
loop_no = Math.round(loop-0.5); // number loop
loop_dec = loop - Math.round(loop-0.5); // get decimal out of the loop// POSITIONS
maxY = thisLayer.width;
minY = 0;// TIMINGS
if (loop_dec < 0.5)
y = ease(time, 0/25, 20/25, minY, maxY); // first half of loop
else
y = ease(time, 20/25, 40/25, maxY, minY); // second half of loop// RESULT
x = transform.anchorPoint[0];
[x, y]
Sorry, there were no replies found.