Looping a Precomp

Beginners often ask how to loop layers in After Effects. While looping a footage layer can be done using the Interpret Footage option, looping an unrendered comp takes a little more work but is still easy. In this tip (no sound) learn how to use expressions to loop an After Effects precomp.

Discuss
  1. Paul
    Reply

    s’a great bit of knowledge too … I have used this so much since becoming “wiser”

    thanks again Johnneh!

  2. James
    Reply

    Thanks for the tip – its amazing this isn’t simpler in CS3 but this way’s very handy.

    Cheers,
    James

  3. Ashish
    Reply

    Hi JD! I d/l the quicktime movie and follow the steps as shown in movie..but could not get it to looping..i am on AE7 & on WinXp. The size of your clip is 01:11s i am not getting the steps after 00:44s ?? Where i am getting wrong? I made the comp size and Pre-Comp setting exactly as shown in your clip
    Warm Regards,
    Ashish

  4. JD
    Reply

    Hi Ashish, Email me your project and I’ll take a look. JD

  5. e11world
    Reply

    Nice tip! Thanks for sharing. This was really helpful

  6. CAB
    Reply

    I love the looping expressions. Thanks for making a simple tutorial I can send people to as opposed to explaining it. Question: are there instances you can think of using this method where you might still get a blank frame at the end of the loop? It happens to me every so often, and I can never figure out why.

    • John Dickinson
      Reply

      Hi CAB, the blank frame happens because After Effects starts comps at 0 frames. For example if you were to next a 25 frame comp into longer comp, frame 24 would be the last visible frame of the nested comp. This is a gotcha when time remapping comps. The trick is to set a keyframe for time remapping at frame 24 (1 frame earlier than the existing keyframe) and delete the next keyframe.

  7. Andrew
    Reply

    Hi john Dickinson,

    I ´ve been searching around to find a tutorial that could explains me how to loop a flv in after effects. I ´ve already tried, via time remaping, to use the expression “loop out()” but it doesn ´t work. The intention is to put taht looped flv inside flash for a website project. Could you please help me with any tip?

    Many thanks from Portugal

    • John Dickinson
      Reply

      Hi Andrew, try selecting the movie in the Project Panel and choosing Interpret Footage > Main. Here you can set a Loop value. Best, John.

  8. Andrew
    Reply

    Hi John Dickinson

    Thanks for your answer. I ´ve already tried that way, choosing interpret footage and seting a loop value to my flv. But that way the flv will only loop the times i ´ve inserted. right? Because my intention, if that ´s possible, is to have a constant loop.

    • John Dickinson
      Reply

      Try dropping your flv into a comp, apply time remapping and use the above technique…

      • Andrew
        Reply

        Hey John,

        Thanks again for your help. I ´ve followed your instructions. I ´ve droped my flv into a comp, applied time remapping and used the technics showned in your tutorial video, and then I render my project. But when I import that flv into flash and press enter, it doesn ´t loop at all. Am i missing something? Can you help me solve this problem?

        Many thanks

        • John Dickinson
          Reply

          Hi Andrew, perhaps it has something to do with Flash… an area I’m not familiar with.

          • Andrew

            Yes, maybe i has something to do with flash. But Would it be to much to ask you just to see the project? I could send you to your email. Once you ´re experiencied with the program, maybe I can have some wrong detail in the project that I ´m not seeing though. Cause I ´m desperated, I cannot find solution on the web or forums. It is a very smaall project, just the flv of 10 aprox seconds to loop.

            Many Thanks

          • John Dickinson

            send the file to support at motionworks dot com dot au and I’ll take a look. Is it a small file?

  9. Yahya
    Reply

    Thank you JD! Love how you reply to almost every post on your site. You are humble even giving the small man some attention. BEST.

  10. Manuel Matheu
    Reply

    Thanks a lot for this tip John, so useful!!

    • John Dickinson
      Reply

      Glad you found it useful Manuel. Best wishes, John.

  11. Eugenio
    Reply

    Thx so much for your precious help but i lose it when you move keyframes, what did you do exactly?

  12. Ajay
    Reply

    Hi John,
    Firstly,thanks a ton for the tip.I have a small problem looping an animation of a jellyfish.I would like it to continuously move upward in a certain manner.I have animated one cycle of it moving upward and added the loop expression.However,after the first cycle,when the loop starts, it moves back down to the first(Y)position(which makes sense).Is there any way to keep it moving upward?

    • John Dickinson
      Reply

      Hey Ajay, Animate the Y position using a Null Object and parent the Jellyfish to the Null. Best wishes, John.

      • Ajay
        Reply

        Thanks again John,
        I had done what you had suggested earlier.I,however, couldn’t manage to loop the upward movement cycle(had to do it manually through the null object).Is it possible to just loop one cycle(3 keyframes) to make it continuously go upward?Usually, when I put the loop expression,it goes back to the first keyframe position(Which is back down)

        I have rendered the animation and it looks okay.I will send it to you and hope you can have a look at it if you get the time!Did the animation manually and copied it many times manually after precomping many copies.

        I actually wanted to use the jellyfish loop as a custom particle in trapcode form to increase the number of jellyfish.But when i used random time sampling for the jellyfish particles,few particles disappear since its sampling at different time.Even if i use a long comp in terms of height, it didn’t seem to work.

        Thanks
        Ajay

  13. somedude
    Reply

    thank you man

  14. Barb Fitz
    Reply

    This is a great and simple tutorial! The one piece of info it leaves out that is handy for beginners is that after enabling time remap and going to add an expression, when clicking on the stopwatch it’s..
    Alt-click (Windows) or Option-click (Mac OS)

  15. stefan
    Reply

    where is the tutorial 🙁

    • John Dickinson
      Reply

      Hi Stefan, the click on the link, this has no audio.

  16. Tina
    Reply

    Hi Jon I am new to AE and am slowly getting the hang of things. I am lost with many of the filters but I am composing some simple animations intended for a fashion blog and I am going half crazy. I need an animated cat for the main character and I cannot figure out the looping thing. I watched the tutorial but for some reason it all operates off the screen after you have got the the enable time remapping. You go down to the bottom of the screen and I cannot see where you are clicking to get the looping option? I have clicked on everything and cannot seem to get the options that seem to come up for you? Please please help as I cannot waste another whole day trying to figure out this as I know it is a very simple thing??

    Thanks in advance

    Tina PS I am working in AE CS5 and mac OSX.

    • John Dickinson
      Reply

      Hi Tina, did you try downloading the video? After Time Remapping you need to alt click the stopwatch to turn on expressions, then click on the small black arrow in the light circle (expression language menu) and from “Property” choose LoopOut (type = “cycle”, numKeyframes = 0). Best wishes, John.

  17. Martin
    Reply

    Thanks John, great tutorial !

  18. Israel Hdz
    Reply

    Hello John!

    Thanks for such a clear tutorial!

    Nevertheless I do get a problem =S I do everything as the tutorial shows but when I delete the keyframe of the time remap is not working…

    When I enamble the time remapping in my precomp I only get one keyframe at the beginning… so I manually keyframe the end as well… I don’t know if this is why is not working…

    It seems to be working as a normal time rempapping.

    I select both keyframes (beginning and end) and enable the time remapping with the proper expression…

    So, say I get my first keyframe at “0” and my last one at “24” … then I do a new keyframe at “23” for it to loop to “0” and it just goes on to 24, 25, 26…. it doesn’t loop…

    What am I doing wrong? is it my AE version (AE CS4)? or is it because I am manually doing another keyframe at the end of my precomp before enabling the time remap? (I do this because it doesn’t make one at the end as it shows in the vid)

    Thanks a lot John!

    • John Dickinson
      Reply

      Time Remapping always creates 2 keyframes. The end keyframe is probably hidden because the layer you time remapped is longer that the comp duration. I’d check that first.
      Best wishes,
      John

  19. andy
    Reply

    Hey,

    Thanks very much for this – just what I was looking for.

    I want to take looped footage of a ball bouncing and then move that bouncing ball along a motion path. Is this possible with this technique?

    I’m worried it may be too complex…

    Any advice would be greatly appreciated.

    Thanks

    Andy

    • John Dickinson
      Reply

      You’d be better off bouncing the ball on the y axis (turn on Separate Dimensions in the timeline for Position, once the layer is 3D), then setting independent x axis keyframes to move the ball left/right. Set a couple of Y axis keyframes and use the cycle keyframes expression to have the y axis bounce loop.
      best wishes,

      John

  20. jonas
    Reply

    Thanks for this Tip.

    It’s working as it should without internal motion blur enabled. Did I miss something – in the moment I enable MB, it’s jumping at the point it loops.

    It would be really great if you’d have also a solution for this.

    Thanks and bye
    Jonas

  21. Joe
    Reply

    Thanks. Have been searching it for some time in the internet. One tricky point for me is you have to press option-click to enable the expression field. Your tip really help. I can loop my compositions finally.

  22. Martin
    Reply

    Hi, thanks a lot for this tip !! Just to share the experience I had on a 29 fps comp, I had

  23. Martin
    Reply

    a smoother result by going back 2 frames instead of 1. Maybe its only me. (AE CS6 mac, looping a video .mp4 footage)

  24. Roei Tzoref
    Reply

    Hey John how are you 🙂

    just stumbled upon your tutorial and I am sure you are aware of this but did not see you demonstrate it in the tutorial and wanted to argue a point that if you not copy paste the first keyframe to replace the original last kf, you will always miss the first frame that will accumulate in time.

    say you have one second precomp, so setting a keyframe one frame before the last keyframe and deleting the last keyframe will result in this:
    delete last kf
    1 – 00:00-01:00
    2 – 00:01-01:00

    as time progresses this delay will miss a frame each loop…

    you can see a drift you duplicated your precomp over and over back to back and place it below your TR precomp to compare

    as opposed to setting a keyframe one frame before the last keyframe and copying the first keyframe instead of the original last keyframe which will result in this:
    1- 00:00-01:00
    2 – 00:00-01:00

    and will be exactly like you pasted your precomp over and over back to back.

Leave a Comment

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>