13 Replies Latest reply on Feb 5, 2018 10:13 PM by natashas12686874

    LoopOut Composition not working

    natashas12686874

      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.

        • 1. Re: LoopOut Composition not working
          Roei Tzoref Adobe Community Professional

          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.

          • 2. Re: LoopOut Composition not working
            Rick Gerard Adobe Community Professional & MVP

            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:

            1. Alt/Option + Ctrl/Cmnd + t to enable time remapping and extend the layer's out point to the length of the current comp.
            2. k to move to the last time remapping keyframe
            3. Ctrl/Cmnd + left arrow to move back one frame
            4. Click the Add Remove Keyframe diamond to insert a new keyframe at the start of the last frame
              timeRemap.png
            5. press k to move to the last keyframe
            6. Click the Add Remove Keyframe diamond to remove the last keyframe
            7. Alt/Option + click the Time Remapping stopwatch to add an expression
            8. type loopOut() and click anywhere to enable the expression

            If your looping comp is exactly the right length when you apply time remapping to the comp your loop will be perfect.

            • 3. Re: LoopOut Composition not working
              Roei Tzoref Adobe Community Professional

              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.

              • 4. Re: LoopOut Composition not working
                natashas12686874 Level 1

                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:

                Capture 1.JPG

                Capture 2.JPG

                Capture 3.JPG

                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.

                • 5. Re: LoopOut Composition not working
                  Roei Tzoref Adobe Community Professional

                  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.

                  • 6. Re: LoopOut Composition not working
                    Rick Gerard Adobe Community Professional & MVP

                    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.

                    • 7. Re: LoopOut Composition not working
                      Roei Tzoref Adobe Community Professional

                      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.

                      • 8. Re: LoopOut Composition not working
                        Rick Gerard Adobe Community Professional & MVP

                        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.

                        • 9. Re: LoopOut Composition not working
                          Roei Tzoref Adobe Community Professional
                          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.

                          • 10. Re: LoopOut Composition not working
                            Rick Gerard Adobe Community Professional & MVP

                            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. 

                            • 11. Re: LoopOut Composition not working
                              Roland Kahlenberg Adobe Community Professional

                              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.

                              • 12. Re: LoopOut Composition not working
                                Roei Tzoref Adobe Community Professional

                                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.

                                • 13. Re: LoopOut Composition not working
                                  natashas12686874 Level 1

                                  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.