ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

loopOut() with custom frame hold?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
James Ronan
loopOut() with custom frame hold?
on Jan 31, 2018 at 4:22:25 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


Return to posts index

Dan Ebberts
Re: loopOut() with custom frame hold?
on Jan 31, 2018 at 5:23:08 pm

Try this:

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


Dan



Return to posts index

James Ronan
Re: loopOut() with custom frame hold?
on Jan 31, 2018 at 6:11:43 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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]