Copy link to clipboard
Copied
I have a working loopOut and i'm trying to stop it at a certain time.
i tried:
timeToStop = 10; if (time > timeToStop) { value; } else { loopOut(); }
and also
if(time < 10){
loopOut()
}
else {
value
}
but both doesnt do the stopping trick, wel it stops right after one sequence...
What do I need to do to make this work? thanks!!
Copy link to clipboard
Copied
Both of those stop after 10 seconds for me, although it's not a very graceful stop unless the length of the loop goes evenly into 10.
Copy link to clipboard
Copied
Hi, dont know why, but it does stop now. But now i dont get it started at a certain time. But that will be for a new post.
Gracefully, no it is not. But this is a whole lot for me yet to get this working 😉
Can you put me in a direction to search for a smooth stop?
Copy link to clipboard
Copied
There are a number of different ways, but the simplest might be to either specify the number of loops, like this:
n = 3; // number of loops
if (numKeys > 1){
t1 = key(1).time;
t2 = key(numKeys).time;
if (time < t1 + n*(t2-t1))
loopOut()
else
key(numKeys).value;
}else
value;
or, have it stop at the last full loop before your specified time:
timeToStop = 10;
if (numKeys > 1){
t1 = key(1).time;
t2 = key(numKeys).time;
n = Math.floor((timeToStop - t1)/(t2 - t1));
if (time < t1 + n*(t2-t1))
loopOut()
else
key(numKeys).value;
}else
value;
Copy link to clipboard
Copied
Wow, thank you! I will have to learn a lot...
Trying to understand and to read what you did.
Will play with it and see what magical abracadabra you wrote to me!
Thanks, here I can work with
Copy link to clipboard
Copied
By far the easiest way to stop a loop animation is to go to the frame closest to where you want the animation to stop and make sure that frame matches the first frame of the animation. This is easily done using the Comp snapshot camera. Then split the layer (Shift + Ctrl/Cmnd + D) and disable the expression on the duplicate. You'll be done in about 15 seconds.
Copy link to clipboard
Copied
Thnx Richard
Not sure if I follow what your saying.
Snapshot, ok, split layer ok,
Dissable expression, you mean "stop loopOut thing" i think.
And from there Animate to the snapshot?
Copy link to clipboard
Copied
But how do you go from there? I dont get it yet.
No, i read it multiple times trying to figure it out. But i have to see it what you mean.
Copy link to clipboard
Copied
Here is a very simple example.
You should. have a metronome that clicks back and forth 4 times, then stops.
That is usually how I stop an expression at a specific time. If I need to change the speed of the loop I just pre-compose both layers and apply time remapping. As long as the first and last frames of any animation sequence are identical you can create a perfect loop.
Copy link to clipboard
Copied
Wow! Thank you so much, i will try this!!!
Really appreciate!
Copy link to clipboard
Copied
It's genious!!! Thank you)