FORUMS: list search recent posts

How To Offset Start Frame of a Loop

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mark Walczak
How To Offset Start Frame of a Loop
on Nov 12, 2015 at 11:54:51 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!

http://vimeo.com/explosivegraffix


Return to posts index


Dan Ebberts
Re: How To Offset Start Frame of a Loop
on Nov 13, 2015 at 12:05:58 am

Something like this maybe:

s = Math.round(effect("Slider Control")("Slider")); // start frame
f = timeToFrames(time);
d = timeToFrames(source.duration);
framesToTime((s+f)%d)


Dan



Return to posts index

Mark Walczak
Re: How To Offset Start Frame of a Loop
on Nov 13, 2015 at 4:28:45 pm

Dan,

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!

http://vimeo.com/explosivegraffix


Return to posts index


Dan Ebberts
Re: How To Offset Start Frame of a Loop
on Nov 13, 2015 at 5:33:49 pm

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

Dan



Return to posts index

Mark Walczak
Re: How To Offset Start Frame of a Loop
on Nov 13, 2015 at 5:50:51 pm

Ah - perfect!

http://vimeo.com/explosivegraffix


Return to posts index

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