Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions loopOut() with custom frame hold?

  • loopOut() with custom frame hold?

    Posted by James Ronan on January 31, 2018 at 4:22 pm

    Hey guys

    Not sure if this is possible… but I have a precomp 5 frames long. In it 5 Images, each a frame.

    I would like to time remap that precomp and add a loopOut() expression, but with an additional variable “frameHold” (could be linked to a slider but not essential) to adjust the time it holds on each frame.

    e.g:

    if “frameHold” was set to 1, each frame duration would be 1 frame – img1 is on frame 0, img2 is on frame 1, img3 is on frame 2 etc…
    if “frameHold” was set to 2, each frame duration would last 2 frames – img1 is on frames 0-1, img2 is on frames 2-3, img3 is on frames 4-5 etc…
    if “frameHold” was set to 5, each frame duration would last 5 frames – img 1 is on frames 0-4, img2 is on frames 5-9, img3 is on frames 10-14

    Hopefully that makes sense! It’s like a combination of loopOut() and the posterise Time effect….

    Any help much appreciated

    James

    James Ronan replied 8 years, 6 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    January 31, 2018 at 5:23 pm

    Try this:

    frameHold = 2;
    numImages = 5;
    f = Math.floor(timeToFrames(time)/frameHold)%numImages;
    framesToTime(f)

    Dan

  • James Ronan

    January 31, 2018 at 6:11 pm

    Dan! Amazing!

    This is working great! and if I change:

    numImages = 5;

    to

    numImages = thisLayer.source.numLayers;

    Then I don’t need to update every time I add a new image in.

    Thanks for the speedy reply!

    James

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