Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions automated looping expression?

  • automated looping expression?

    Posted by Weston Jones on October 13, 2012 at 12:31 am

    Hello,

    Have a looping problem for all you expression masters. Thanks in advance.

    So I have a video layer. I would like to loop 6 frames of it, then scrub the in/out point of that loop down in time of the footage. To elaborate:

    Lets say my footage is 10 seconds long. What would be happening is the first 6 frames would loop, then after a determined number of cycles of the loop (lets say 5 times, or for 1 second), it would then start looping on frame number 2 of the 10 second clip, again for 6 frames (so it’s now looping frames 2-7). Then frames 3-8, etc. This would continue.

    I’m trying get functionality akin to something you might find in a VJ software, where you set a loop duration, then can move that loop throughout the clip.

    Hopefully this makes sense! My brain is slogged trying and failing all day.

    Thank you!

    Dan Ebberts replied 13 years, 10 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    October 13, 2012 at 1:57 am

    I think this works:

    numFrames = 6;
    numLoops = 5;

    f = timeToFrames(time)
    startFrame = Math.floor(f/(numLoops*numFrames));
    fOffset = f%(numLoops*numFrames)%numFrames;
    framesToTime(startFrame + fOffset)

    Dan

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