Activity › Forums › Adobe After Effects Expressions › Stop loopOut!
-
Stop loopOut!
Posted by Matt Larson on November 11, 2009 at 5:45 pmI 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 RAIDYoan Boisjoli replied 1 month ago 10 Members · 12 Replies -
12 Replies
-
Kevin Camp
November 11, 2009 at 10:28 pmi 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 -
David Cabestany
March 6, 2014 at 12:45 amHey 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. -
Mahdi Mehrabi
August 27, 2015 at 5:07 am -
Mahdi Mehrabi
August 27, 2015 at 7:00 am -
Søren Nowakowski
September 2, 2015 at 9:34 amAlternatively, 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). */ -
Pete Burges
November 7, 2017 at 3:49 amHi 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. 🙂
Reply to this Discussion! Login or Sign Up