Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions How To Offset Start Frame of a Loop

  • How To Offset Start Frame of a Loop

    Posted by Mark Walczak on November 12, 2015 at 11:54 pm

    Hi Everyone,

    This seems like a very simple task, but I could use some help thinking through it.

    Basically, I have a clip of a 10 second loop that is being used three times in my comp. I would like to add some variety, and have each instance of the loop start at a different frame and loop seamlessly.

    When dealing with pre-rendered clips, I simply loop the clip in the interpolation settings and slide it in my timeline. When dealing with comps, however, things get a bit more complicated.

    My question is whether or not it’s possible to insert an expression into a layer’s time remapping attribute that allows you to simply slide the start frame of a loop and have it play out.

    Let me know if this isn’t making sense, and I’ll be happy to clarify.

    Thank you!

    Mark Walczak replied 8 years ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    November 13, 2015 at 12:05 am

    Something like this maybe:

    s = Math.round(effect(“Slider Control”)(“Slider”)); // start frame
    f = timeToFrames(time);
    d = timeToFrames(source.duration);


  • Mark Walczak

    November 13, 2015 at 4:28 pm


    This is EXACTLY what I needed. Thank you so much!

    I follow your logic through the expression, but could you tell me what “%” does in the last line?

    Thank you!

  • Dan Ebberts

    November 13, 2015 at 5:33 pm

    % is the JavaScript modulus operator. It gives you the remainder of a division operation, so it’s what generates the looping value.


  • Mark Walczak

    November 13, 2015 at 5:50 pm

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