Copy link to clipboard
Copied
First off, apologies as I am still getting the hang of After Effects.
So my project/main comp is 2 mins 54 seconds long (because of the song I have in it). I have a 6 second composition in it that loops perfectly - as in it loops perfectly within a 6 second period. I'm trying to get this to loop throughout the whole project. I used a guide that has helped me in the past with looping a composition, followed it by enabling time remapping, going to the last keyframe, going 1 frame backwards, setting a new keyframe, going back to the last keyframe, setting the time to 0 and deleting it, adding the expression loopOut(type = "cycle", numKeyframes = 0) to the 2 keyframes, then dragging the comp all the way to the end of my project. However this doesn't seem to work and I'm unsure why as this has worked for me in the past, only difference being (as far as I know, I keep looking but don't see anything else different) was that my last project was 60 FPS and this one is 29.97 FPS.
I'm not having a black frame issue, it's just not looping correctly. The end frame isn't the same frame that is at the end of the 6 second comp. Am I wrong to think 6 seconds comp looped into a 2 min 54 sec main comp should work perfectly? Going to feel stupid if my math was wrong since I've been trying to figure this out for hours. I have the project set to 29.97 fps so I'm wondering if that's my issue as well. Overall, I'm confused and would really appreciate some insight so I don't repeat whatever mistake it is that I'm making in the future.
Unsure what else to add aside from I'm running the latest version of After Effects.
Thank you.
then you want a loop over a loop and not a loop after a loop, and you should delete the last keyframe (as Rick suggested) and you will be fine.
this is loop over a loop (loopOut with 2 keyframes):
1st loop: 00:00-06:00 - precomp ranging from 00:00-06:00
2nd loop: 06:01-12:00 - precomp ranging from 00:01-06:00
3rd loop: 12:01-18:00 - precomp ranging from 00:01-06:00
as you can see, you are always skipping the first frame of your precomp.
this is loop after a loop (loopOut with 3 keyframes):
1st loop: 0
...Copy link to clipboard
Copied
to make a perfect exact loop do this:
1. create the TR keyframes
2. go to one frame before the last frame and create a keyframe
3. copy the first keyframe over the original last keyframe.
4. add this expression loopOut()
done.
Copy link to clipboard
Copied
Do what Roei said. You are over complicating things. I don't know where you got the idea you needed to reset the last keyframe to zero but it sounds like it was from somebody that did not understand AE. The frame rate of the comp has nothing to do with anything. Time remapping is based on time and loopOut() and the first frame of your loop as a keyframe and the last frame of your loop are all you need. The confusion happens because Time Remapping sets the last keyframe after the last frame has played back so you end up seeing it.
Using the keyboard:
If your looping comp is exactly the right length when you apply time remapping to the comp your loop will be perfect.
Copy link to clipboard
Copied
Rick, your suggestion and mine are different.
To make a perfect loop back to back you need to replace the original last keyframe with the first keyframe and not delete it as explained in my post. You are left with 3 keyframes in total.
This is different than the classic method you are suggesting which will create a loop over a loop and will actually remove the first keyframe on every loop.
Copy link to clipboard
Copied
Right so I did exactly as you said and it works perfectly right until the very end. I noticed something odd and I'm unsure how to explain it so I'll use images.
Result of 6 sec comp after doing what you said:
Then I noticed that at the very end of my main comp it's at this time/frame:
Shouldn't it be at 0;00;00;00? I'm assuming this is why it's not looping correctly? I thought that a 6 second comp would go into 174 seconds or am I looking at this the complete wrong way? Sorry to be a pain, just very confused. Thanks for both of your help.
Copy link to clipboard
Copied
then you want a loop over a loop and not a loop after a loop, and you should delete the last keyframe (as Rick suggested) and you will be fine.
this is loop over a loop (loopOut with 2 keyframes):
1st loop: 00:00-06:00 - precomp ranging from 00:00-06:00
2nd loop: 06:01-12:00 - precomp ranging from 00:01-06:00
3rd loop: 12:01-18:00 - precomp ranging from 00:01-06:00
as you can see, you are always skipping the first frame of your precomp.
this is loop after a loop (loopOut with 3 keyframes):
1st loop: 00:00-06:00 - precomp ranging from 00:00-06:00
2nd loop: 06:01-12:01 - precomp ranging from 00:00-06:00
3rd loop: 12:02-18:02 - precomp ranging from 00:00-06:00
this is as if you did this, all your frames in the precomp get played, but there is a shift in time because you are playing a sequence and right after playing another - there is a frame offset in the playback.
Copy link to clipboard
Copied
Roei, you are making things too complicated. A long time ago a perfect loop required 3 keyframes but it has not for a very long time.
If the first and last frame of an animation is exactly the same then loopOut() will work perfectly with just 2 keyframes. Whether it is time remapping or simple animation, there is no longer the need for fiddling around with a third keyframe.
For example: Animate the hand of a clock by setting a keyframe at 0 - 0º on frame zero and 1 - 0º on frame 30 and add a loopOut() expression and the clock hand will rotate perfectly every time. Trim the layer at frame 30, pre-compose, time remap, go to the last keyframe and the clock hand will disappear, back up one frame and the clock hand will reappear. Set a new time remapping keyframe, press the K key to move to the last time remapping keyframe and delete it and add a loopOut() expression and the clock hand will animate perfectly. It works every time.
The only time you need 3 keyframes to create a perfect loop would be if the animation was set up so the action would end one frame before the cycle was complete. Say the clock hand was set up to rotate 1º per frame and the last frame was at 359º instead of 360º. Only then would you have to copy the first keyframe and paste it one frame after the first keyframe to get a perfect loop.
Maybe this will help.
Copy link to clipboard
Copied
Rick, Your example is not perfect for this issue since your first and last keyframe are the same. I can assure you I have varified this issue to the fullest. If you want to see where the problem is with the classic 2 Keyframe TR try this example: place a shape on the first frame and Create a KF, move it to the right at the last frame and create a KF and let it interpolate from 00:00 to 06:00. Now precomp and create a TR with the classic method. To compare, duplicate the same precomp with no TR and place duplicates back to back one instance after the other. Set it to difference if you wish. You will see the TR don't match the back to back precomp and this is because you are overlapping a frame each time. You are playing a loop overlapping another loop in 1 frame. You can see that the first frame in the second loop of the TR is 00:01- meaning you skipped 00:00. If you want a perfect loop meaning that all the frames of your precomp will be shown, you must use 3 keyframes. If you want a loop to be overlapping the previous one, you can use the classic method.
Copy link to clipboard
Copied
In hour example the first and last frame are not identical. You don't have a loop, you have a repeating pattern. If you want a repeating pattern where the first and last frames are not identical, then you need 3 keyframes. The copied first keyframe makes the first and last frame of the loop identical.
Let's talk about a 10 frame animation. loopOut() starts the loop at the 10th frame, not the 11th as most folks would expect. This means that the 11th frame is already one frame into the action and the action seems to jump. The loopOut() function continues to operate from 11 through 20 and the 20th frame is identical to the first frame. The second loop starts and runs to frame 29 then on frame 30, as it should be the first frame is repeated. This means the original last frame of the action is never shown. The jump shifts from the 11th frame to the 19th frame, which makes perfect sense. That is why loopOut() works perfectly if the first frame and last frame of an animation are identical and why you need a 3rd keyframe when you want a repeating pattern with different first and last frame. It is a lot easier to design a loop where the first and last frames are identical. Particles, rotation, opacity, moving gradients all work perfectly if you have identical first and last frames. Repeating patterns are a lot harder to make look seamless.
Grammatically there is a difference between a seamless loop and a repeating cycle. I man have incorrectly assumed that natashas12686874 was looking for a Loop when instead he was looking for a repeating cycle.
Copy link to clipboard
Copied
In hour example the first and last frame are not identical.
they are in the sense that visually they are the same - the first frame is set to 0x0 and the last is 1x0. that's why your seamless loop works because you have 2 identical keyframe as you explain yourself further in your post.
You don't have a loop, you have a repeating pattern. If you want a repeating pattern where the first and last frames are not identical, then you need 3 keyframes.
one could say they are synonyms. we can agree that these are two different kinds of loop. seamless is a good way to explain the 2 kf approach. let's settle for seamless loop (2kf) vs repeating loop (3kf)
I may have incorrectly assumed that natashas12686874 was looking for a Loop when instead he was looking for a repeating cycle.
I think Op actually meant he is looking for a seamless loop where the math adds up so at 00:02:54, the precomp would show 00:00 because it's 174 seconds which is 6 seconds x 29. I was just being picky on what a perfect loop is. now I think I should use the term repeating loop vs seamless loop to differentiate between the two ways of doing this.
Copy link to clipboard
Copied
If it a seamless loop (identical first and last frames identical) and the two keyframe loopOut() method works then it does not how many frames are between the first and last frames. You can change the timing of the loop using time remapping. If he has a seamless loop comp that is 4 seconds long and he wants to repeat the loop exactly 10 times in a 20-second comp then all he has to do is a little math. 10 loops in 20 seconds is one loop every 2 seconds. Grab the last TR keyframe and drag it to 2 seconds and the timing is perfect. If he has a 2 minute 27 second comp and he wants 5 loops then, to make things easy, change timecode to frames, go to the out point of the comp and count the frames (for a 29.97 fps comp that is 3527 frames), divide by 5 (705.4), move the CTI to the nearest whole frame number (705), and the loop will repeat 5 times. It does not have to be any harder than that.
Copy link to clipboard
Copied
Render the short animation. Then import it and use the Interpret Footage dialog to set the number of loops you require. This should be standard procedure if you want to loop something numerous times.
Copy link to clipboard
Copied
thanks Roland, that's a good workflow if you wish to render or the best method if you already have a render. making sure and comparing this way to my original 3 kf suggestion proves my point - they match perfectly whereas using the 2kf method will skip the first frame in the second loop and skip the last frame in all following loops and won't match the interpret footage loop feature. 3kf = perfect loop, 2kf = overlapping loop.
Copy link to clipboard
Copied
Thanks so much Rick! loopOut expression glitch has been a long time mystery for me, so evertime after spending hours into solving the jump issue I used to resort to Roei's old school method. But your clock animation example has finally solved this for me and I now totally understand how loopOut() expression work in AE.
@Roei Tzoref the trick I was missing previously is having your base animation comp 1 frame longer with 1st and last frame same (in Rick's example the hand animation comp is 6.01 sec, with 1st and last frame the same). This means in the base comp the loop won't be seamless, but when you use this comp with loopOut() expression it works perfectly and you have very tidy comp with minimal amount of layers.
cheers!
Copy link to clipboard
Copied
@Hitesh5C41
that is also a way to go about it. do what is easier for you to follow and be consistant with. will try this method also.
Copy link to clipboard
Copied
Thank you very much for your help. It's working perfectly now and I have learned a lot from all of the replies. It's very much appreciated.
Thank you all.
Copy link to clipboard
Copied
Sir, you've been posting this a lot of forumns, and I might add you've been quite aggresively bashing other editors. But your assesment is wrong. The correct procedure is to simply time remap, and add the loopout expression on the last frame of the time remap... That's as simple as it gets... Adding a keyframe to the frame before the last keyframe in the time remap and deleting the last keyfreame might get rid of the "black frame" but it starts the loop back at the second frame of the composition hence messing with the loop consistency. It might appear as if it's looping, but your missing a the first frame of the composition. It's just not as noticable as a "Black screen."
This is not a user error. This problem is caused by a data leak in after effects and can be solved by purging your data cache.
For example, you want a looped texture overlay, you have 4 different variations, 2 frames per layer, 8 frames in the composition. You add the time remap and then loopout. The last frame appears black. Now, If you follow your instructions, you will be eliminating the first frame of the composition by messing with the time remap properties. The first keyframe is the start of the loop, the second keyframe is the end point, by going back and adding that keyframe and deleting the last keyframe, you are shifting the timeline by 1 frame, this presents in a missing frame.
Solution:
To fix the data leak error presenting in a black frame in your loop:
1. click on your precomp, enable time remapping.
2. alt click stopwatch, click the dropdown menue for expressions, select property>loopout.
(black frame now appears in looped sequence) * data leak
3. go to dropdown menues located at the top of after effects, edit > purge > All memory and disk cache
(the black frame is now corrected and your loop should not be missing any frames, or presenting a false black frame)
Thank you and I hope this helps everyone who is struggling with this error. Also, try to be nicer. You presented a solution that is simply a work around for a data error, at the compromise of the integrety of the composition.
Copy link to clipboard
Copied
Now, this annoying thing, is that the solution is not consistent, sometimes it works, other times it doesn't and ive had it work your way, but most of the time it misses a frame. This grouping of effects is very annoying to deal with and has many bugs, ive even had it change upon closing and opening the project. the adobe team really needs to address this issue more than anything.
Copy link to clipboard
Copied
For the last two years Ive been waiting for a sollution to that problem, yet nothing happened. I did run into that problem over and over and over again during the time and considering the (wrong) answers are from 2018 it seems as if the problem never got solved neither did anyone care to do so.
Every time I have to loop an animation, I have to do it by hand which – frankly – is a really poor solution, but the only way it works consistently. This is not a good way to ensure trust into your product.