ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Stop loopOut!

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Matt Larson
Stop loopOut!
on Nov 11, 2009 at 5:45:33 pm

I have been searching and searching, but I can't seem to find an answer to what I would think would be an easy question:

Is there an expression that I can add to loopOut that will stop a loop at a certain time on the layer (rather than loop to the out point) and hold that position?

I know I can precomp and time-remap to 0, but I figured there would be an expression that I don't know about.

Any ideas?

2 x3Ghz Quad MacPro
9 GB RAM
Mac OS X 10.5.5
QT 7.5.5
FCP 6.0.5
AJA Kona 3 (6.0.1 drivers)
G-Speed XL 12 RAID


Return to posts index

Kevin Camp
Re: Stop loopOut!
on Nov 11, 2009 at 10:28:19 pm

i would use a layer marker to set the stop point (with layer selected, hit * on the numbers pad to add a marker) this would make it easy to edit the stop point.

then try this expression:

stop = marker.key(marker.numKeys).time;
loopDur = key(numKeys).time;
if (time > stop){
stop%loopDur;
}else{
loopOut();
}


if you want to enter a specific time value, just set the stop value to a number (in seconds).

Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW


Return to posts index

David Cabestany
Re: Stop loopOut!
on Mar 6, 2014 at 12:45:03 am

Hey Kevin, this works nice for a one dimension loop, like rotation, but could you help me to adapt the expression to work with a 3 dimension array, like position x,y and z?

Thanks,
David.


Return to posts index


mahdi mehrabi
Re: Stop loopOut!
on Aug 27, 2015 at 5:07:26 am

I can use this expression
Every time I see the error



loopOut(type = "cycle", numKeyframes = 0)
stop = marker.key(marker.numKeys).time;
loopDur = key(numKeys).time;
if (time > stop){
stop%loopDur;
}else{
loopOut();
}


Return to posts index

Dan Ebberts
Re: Stop loopOut!
on Aug 27, 2015 at 6:37:18 am

You'll get that error if the layer has no markers.

Dan



Return to posts index

mahdi mehrabi
Re: Stop loopOut!
on Aug 27, 2015 at 7:00:25 am

thanks dear Dan Ebberts

The problem was solved by creating markers

But I get another error in scale parameter


loopOut(type = "cycle", numKeyframes = 0)
stop = marker.key(marker.numKeys).time;
loopDur = key(numKeys).time;
if (time > stop){
stop%loopDur;
}else{
loopOut();
}


Return to posts index


Søren Nowakowski
Re: Stop loopOut!
on Sep 2, 2015 at 9:34:59 am

Alternatively, you could link the loopOut to a checkbox controller.

That way, you keyframe the switch, to stop it at a point in time of your choosing. Checkbox controls utilizes hold keyframes.

Just add a checkbox controller to the layer you want the loopOut to happen on.

And put this code in all the properties you want to have looped.

s = effect("Stop LoopOut")("Checkbox"); // Parent to Checkbox controller. Rename the controller "Stop LoopOut" if you want :)

if (s == 0) {
loopOut("cycle")
} else {
value
}

/* If the checkbox is off (0), then loop it. Loop it good.
Otherwise, just use the value (your keyframes). */


Return to posts index

mahdi mehrabi
Re: Stop loopOut!
on Sep 3, 2015 at 10:31:47 am

I can only really thank you Søren Nowakowski


Return to posts index

Derin Denizli
Re: Stop loopOut!
on Sep 2, 2016 at 6:34:54 pm

getting same error even i assigned 2 markers to layer :(


Return to posts index


Dan Ebberts
Re: Stop loopOut!
on Sep 2, 2016 at 7:13:37 pm

which error?



Return to posts index

Pete Burges
Re: Stop loopOut!
on Nov 7, 2017 at 3:49:28 am

Hi All

I've been using this expression a lot when I have multiple animating layers and I simply want to trigger the animations on or off rather than key every single one, so thanks for that!
However, I was wondering...is it possible to stop and start a looping animation where it holds at the current frame when you stop and then continues from there when you start again? Like toggling 'pause' on a video player.
I am not great with scripting so I can't seem to figure this out by myself...I tried throwing in a frameAtTime but I just broke it.
I know I can do it with time remapping, and keying a pause in by hand- but over 50 layers with different pause times... I hope someone might have a more elegant solution. :)


Return to posts index

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