• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How can I successfully use the Loop expression?

New Here ,
Jan 18, 2018 Jan 18, 2018

Copy link to clipboard

Copied

I'm still fairly new to After Effects and I'm working on a project that requires a lot of animations to loop, but using the Loop expression is completely racking my brain at the moment because I'm consistently encountering issues with it. Would any of you please help me figure out what I'm doing so horrendously wrong?

Just to illustrate the problem I'm having with a simple example, I've made a basic animation consisting of only three frames, displaying the numbers 1 to 3. I want to create a loop so that the numbers will play in the following sequence: 1 > 2 > 3 > 1 > 2 > 3...ad infinitum.

I've created a comp with this animation called "numbers".

screen1.png

Here's the animation where the numbers go from 1 to 3 rapidly, with each number lasting just one frame. This is how I want the loop to look.

video1.gif

I created a new comp and called it "loop", and placed the above comp into it. This is where I want to create the loop.

screen2.png

I've enabled Time Remapping and stretched out the clip to fill the timespan of the comp.

screen3.png

I added the Expression and typed in loopOut();

I know this part is finicky because it makes the last frame disappear in the first segment of the loop. I understand the trick is to go to the penultimate frame in the Time Remapped clip, and create a new keyframe in Time Remapping there. Then I'm supposed to delete the last keyframe. So I went ahead and did that.

screen5.png

And this is where I invariably encounter problems. For example, here's the animation that results. In this case, it seems to start with playing the first two frames, and then it just holds on the first frame for the rest of the "loop". The third frame is nowhere to be seen.

video2.gif

Since I've carefully laid out the steps in my process, can anyone figure out what I've done wrong here?

Thanks a lot for the help! I really need to overcome this hurdle with the Loop expression because it's the only real issue keeping me from completing my project.

Views

2.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 18, 2018 Jan 18, 2018

Copy link to clipboard

Copied

if you use the K key to go to the last time remapping keyframe you will see that it has been placed after the end of the video. The first thing you need to do is move back to the start of the last frame where the 3 is visible and set a keyframe there, then delete the last one.

Screen Shot 2018-01-18 at 8.43.13 AM.png

Careful examination of the timeline and actually checking each keyframe would have shown you the problem instantly. Time remapping works this way on purpose so you get every frame and the time values for each frame are correct. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jan 18, 2018 Jan 18, 2018

Copy link to clipboard

Copied

when you've set up time remap and have your two keyframes - one at the start and one at the end,

you need to:

1. add one time remap keyframe at the current value one frame before the last keyframe.

2. COPY the first time remap keyframe and PASTE IT over the LAST time remap keyframe.

and add loopOut().

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 18, 2018 Jan 18, 2018

Copy link to clipboard

Copied

Hi Mike, thanks for your reply also!

I've never come across your method before -- I've always read that I need to make a keyframe on the penultimate frame of the Time Remapping, and then delete the last keyframe, as Gerard above also mentions. I tried your method and it worked with my numbers loop, so I finally managed to get that one looping properly. Thanks!

Unfortunately when I applied your method to an animation I'm working on, the loop just holds on the first frame. It seems like the results can vary every time I try to make a loop -- either it holds on a frame, or it loops without the last frame, or sometimes even two layers show up in the same frame creating an overlap. At the moment it really feels like if I actually get a loop working properly it's a complete fluke!

Thanks again for all the help.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 18, 2018 Jan 18, 2018

Copy link to clipboard

Copied

You don't need to add the extra keyframe, you just need to be accurate. Here's how to do it in under 30 seconds:

Here's a project file: Dropbox - Loop Timne Remapping.aep

(Note: If your browser adds a .txt extension to the .aep file just delete it)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 18, 2018 Jan 18, 2018

Copy link to clipboard

Copied

Thanks for sharing your project file. I was able to easily replicate the loop you made in your project without any problems whatsoever, I now know for a fact that I have the process down correctly.

When you mention that I need to be "accurate", I assume you're referring to whether or not I'm selecting the correct frame to make the new keyframe. Considering I'm working with a frame-rate of just 12 fps, and the animation loop I'm trying to make consists of only three frames, there's an extremely limited number of frames I'm working with here. Given all that, it is very straightforward for me to find the penultimate frame in the clip.

Considering I'm not having much luck at 12 fps, I'll try making a loop in a comp at 29.97 fps like yours to see if that makes any difference.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 18, 2018 Jan 18, 2018

Copy link to clipboard

Copied

LATEST

Use the J and K keys to move between visible keyframes. Ust Ctrl/Cmnd + left or right arrow to move one frame at a time. Hold down the Alt/Option key and scrub in the timeline to zoom in and out of the timeline. Hold down the Shift key to get keyframes and in and out points to snap to the CTI.

As long as your composition frame rate was not modified after you set keyframes they will always be at the start of a frame.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 18, 2018 Jan 18, 2018

Copy link to clipboard

Copied

Thanks for the reply!

That's precisely what I had done. After enabling Time Remapping, I pressed the K key which took me to the last keyframe, then I moved the Current Time Indicator backward one frame, added a keyframe there, and deleted the last keyframe.

Unfortunately this method resulted in a failed loop, as can be seen in the final image I posted.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines