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

loopOut("cycle",n) and loopIn("cycle",n) on Scale Cause Infinite Looping and Faster Animation i

New Here ,
Apr 21, 2025 Apr 21, 2025

Title: Bug: loopOut("cycle",n) and loopIn("cycle",n) on Scale Cause Infinite Looping and Faster Animation in After Effects 25.2

Body:

Hi everyone,

I'm encountering a strange issue with the loopOut("cycle",n) and loopIn("cycle",n) expressions applied to the Scale property in After Effects 25.2. Instead of looping the specified number of cycles, the animation loops infinitely, and the animation speed increases unexpectedly when the cycle count is increased. This behavior seems like a bug, as it doesn't align with the documented functionality of these expressions.

Details of the Issue

  • Goal: I want to animate a layer's Scale property with keyframes from frame 0 to 25, looping 5 times until frame 150 (5 seconds at 30 fps), then holding the Scale value at frame 25 until frame 180 (6 seconds).

  • Problem:

    • Using loopOut("cycle",2) (expected: 3 cycles = 75 frames):

      • The Scale animation loops infinitely instead of stopping after 3 cycles.

      • The animation feels faster than expected, appearing to complete sooner than 75 frames.

    • Using loopOut("cycle",1) (expected: 2 cycles = 50 frames):

      • Also loops infinitely, but slower than loopOut("cycle",2).

    • Using loopOut("cycle",3):

      • Loops infinitely and feels even faster than loopOut("cycle",2).

    • Using loopIn("cycle",2) (expected: 3 cycles backward before frame 0):

      • Loops infinitely from the start of the timeline.

      • Feels faster than loopIn("cycle",1), but doesn't stop after 3 cycles.

    • The increasing speed with higher cycle counts (e.g., 1 to 2 to 3) is noticeable and inconsistent with the expected cycle duration (25 frames = 0.833 seconds per cycle at 30 fps).

  • Expected Behavior:

    • loopOut("cycle",2): 3 cycles (75 frames), holds Scale value at frame 25.

    • loopIn("cycle",2): 3 cycles backward, holds Scale value at frame 25.

    • For my goal: 5 cycles (125 frames) until frame 150, then hold Scale value at frame 25.

Steps to Reproduce

  1. Create a new composition:

    • Frame Rate: 30 fps

    • Duration: 180 frames (6 seconds)

  2. Add a Solid layer.

  3. Animate Scale:

    • Frame 0: [100, 100]%

    • Frame 25: [200, 200]%

    • Ensure no keyframes beyond frame 25.

  4. Apply one of the following expressions to Scale:

    • loopOut("cycle",2)

    • loopOut("cycle",1)

    • loopOut("cycle",3)

    • loopIn("cycle",2)

  5. RAM Preview:

    • Observe: Animation loops infinitely instead of stopping after the specified cycles.

    • Note: Higher cycle counts (e.g., loopOut("cycle",3)) make the animation visibly faster than lower counts (e.g., loopOut("cycle",1)).

TOPICS
Expressions
169
Translate
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
Adobe Employee ,
Apr 21, 2025 Apr 21, 2025
LATEST

Hi there @Irakunicon,

 

What you're seeing is actually expected behavior. For loopOut(), the "n" value you're referring to is the argument called numKeyframes, and it's for defining the segment you want loop, not the number of times the loop occurs. In your first example, you're only looping from three keyframes before the last one; your animation appears to be going faster because you're only looping a portion of it.

 

If you want to hold your value, and easy way to do this is to loop the animation for as long as your want, then split your layer (handy shortcut is Ctrl/Cmd+Shift+D) when the animation reaches the correct value, remove the expression on the split layer, and make sure the desired value is selected. This is the same process as duplicating your layer, but splitting avoids the extra step of having to trim both layers.

 

Take a look at this screenshot showing a simple ball bounce on the y-axis. If you're not familair with the button the red arrow is pointing to, it toggles the "Post-Expression Graph." This is a very handy feature that displays the graph of your animation when driven by an expression. These values are represented as a dotted lines in the graph (where keyframed animation is represented as a solid line). Note: you don't always want this feature enabled as it takes extra work to caluculate this graph, and it can sometimes slow things down; but it's an amazing reference.

 

So, now you can see the numKeyframes argument is set to "2" in the expression, and only the last three keyframes are looped, as shown by the Post-Expression Graph. 

 

Screenshot 2025-04-21 at 9.32.26 AM.png

 

 

From the expression documentation:

loopOut(type="cycle", numKeyframes=0)

Return type: Number or Array.

Loops a segment of time that is measured from the last keyframe on the layer back toward the In point of the layer. The loop plays until the Out point of the layer. The specified number of keyframes determines the segment to loop. The numKeyframes value sets the number of keyframe segments to loop; the specified range is measured backward from the last keyframe. For example, loopOut("cycle", 1) loops the segment bounded by the last keyframe and second-to-last keyframe. The default value of 0 means that all keyframes loop. See the entry for loopIn for more information.

 

 

Thanks,
- David, After Effects Engineering Team

Translate
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