ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Loop out defined set of keyframes

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jason Jantzen
Loop out defined set of keyframes
on Apr 6, 2014 at 4:13:51 am

Is there a way to loop just a set of keyframes, like maybe with markers or something? My basic set up has 3 keyframes and I'd like to loop out, but not include the first keyframe. Any ideas?

Jason Jantzen
vimeo.com/jasonj


Return to posts index


Dan Ebberts
Re: Loop out defined set of keyframes
on Apr 6, 2014 at 5:53:06 am

The second parameter of loopOut() controls how many keyframes get looped. This will loop the last two:

loopOut("cycle",1)


(the parameters specifies the number of keyframes in addition to the last one).


Dan



Return to posts index

Jason Jantzen
Re: Loop out defined set of keyframes
on Apr 7, 2014 at 2:42:30 pm

Thanks Dan! So if I understand this correctly, "numberKeyframes" defines which keyframe is the looping point, or simply how many are looped? Because with a value of 1, I'm a little confused that it's looping only 1 keyframe, since it's looping after the 1st keyframe, but not including it. Is there a number 0 keyframe in consideration with AE?

Jason Jantzen
vimeo.com/jasonj


Return to posts index


Dan Ebberts
Re: Loop out defined set of keyframes
on Apr 7, 2014 at 4:46:11 pm

For loopOut(,)the count is the number of keyframes to be looped, counting backwards from the last keyframe, but the last keyframe is not included in that count (it is included in the loop though). So if you have 3 keyframes, loopOut("cycle",1) loops keyframes 2 and 3. It is a little confusing.


Dan



Return to posts index

Jason Jantzen
Re: Loop out defined set of keyframes
on Apr 7, 2014 at 5:51:04 pm

Thanks Dan, that does help make sense of it.

Jason Jantzen
vimeo.com/jasonj


Return to posts index

Anton Frolov
Re: Loop out defined set of keyframes
on Dec 3, 2016 at 5:18:46 am

Hello Dan!
But what if I need to loopOut("cycle",-2) (tried to joke in IT)
I mean if I need the FIRST 3 keyframes to be looped until we reach the 4th keyframe (then goes the animation 5,6,7kf ...)?

Thanks!

Also tried to stop the lO(); with markers and continue ->
failed to insert reference to the property itself so it stops loopOut and reads the current Kframes. Only constant values work here =(
=====
stop = marker.key(marker.numKeys).time;
loopDur = key(numKeys).time;
if (time > stop){
stop%loopDur;
}else{
loopOut();
}


Return to posts index


Dan Ebberts
Re: Loop out defined set of keyframes
on Dec 3, 2016 at 11:27:15 pm

It's hard to decipher exactly what you're looking for, but it might be something like this:


if (numKeys >= 7){
if (time < key(1).time){
t = time;
}else if (time < key(4).time){
t = key(1).time + (time - key(1).time)%(key(3).time - key(1).time);
}else if (time < key(5).time){
t = time;
}else{
t = key(5).time + (time - key(5).time)%(key(7).time - key(5).time);
}
valueAtTime(t);
}else
value


It should loop keyframes 1 through 3 until it gets to keyframe 4, then when it gets to keyframe 5, it loops 5 through 7.
Hopefully there's enough there to get you headed in the right direction.


Dan



Return to posts index

Darby Edelen
Re: Loop out defined set of keyframes
on Dec 5, 2016 at 3:30:20 am

I can't decipher the expression you included, but based on your description it sounds to me like you just need:

loopIn("cycle", 2);

Darby Edelen


Return to posts index

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