Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Measuring time intervals from an irregular counter – and adding it to an expression.

  • Measuring time intervals from an irregular counter – and adding it to an expression.

    Posted by Simon Roberts on April 1, 2014 at 2:12 pm

    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]

    Simon Roberts replied 12 years, 1 month ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

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