Skip to content

Seamless looping animations stutter at the last frame before looping #65513

@alfredbaudisch

Description

@alfredbaudisch

Godot version

4.0 alpha 16 and also 3.5-stable

System information

Windows 10 Pro 64-bits, RTX 3080 Ti (516.94)

Issue description

  • Godot does not seem able to seamless loop skeletal mesh rotation animations that rotate from 0 to 360 degrees.
  • Godot stops for a frame in the last frame before looping.
  • To make sure it's not a problem with my animation, I tested the same animation in Blender, Unity, Unreal Engine, Godot 3.5 and Godot 4-alpha16, and only in Godot (both versions) that it doesn't loop perfectly, freezing at the last frame before looping.
  • Interpolation is set to Linear (everything as default).

sample-loopin11

  • After more investigation, I noticed Godot duplicate the 1st frame when importing animations where the 1st frame is the same as the last frame - this is what causes the apparent stutter:

image

Animation Setup

  1. The 1st setup I tried: animation composed of a bone where the 1st keyframe is at 0º and the last at 354º - this is the one looping seamlessly in the other engines.
  2. 2nd setup tried: 1st keyframe at 0º and last at 360º (wrong, because the last frame and 1st frame are at the same position).

Expected

The rotation animation should loop without pauses.

For example, in UE (in this GIF the animation loops 2 times before the end of the GIF, the freeze at the end is due to the GIF. You can follow the looping by moving your cursor on top of one of the blades and following it - see how it's seamless for 2 revolutions):

loopingue121

Biggest proof that it just works everywhere else. The wheel animation in my game trailer below (starts at 0:11) is EXACTLY the same unaltered in UE, it's the same mesh and Blender NLA action (the difference in the sample project attached below is that I removed the other parts of the mesh from the same .blend file):

https://twitter.com/PardallGames/status/1560658418431434753

Steps to reproduce

  1. In Blender, create an armature, add a bone and create a new animation (Action).

  2. Set the bone rotation to Euler Angles:
    image

  3. Set the 1st keyframe rotation to Y: 0º and last keyframe (60th frame) to 354º.

  4. Assign the bone to any kind of mesh, as long as you can see the mesh rotating.

  5. Push Down the Action as a NLA Track and export either as FBX or GLTF.

  6. Import the mesh and animation into Godot and play it looping. The last frame freezes for a frame before looping.

Minimal reproduction project

Godot 4-alpha16 project and Blend file:

LoopingMachineFreezing.zip

An additional project with a Humanoid with Mixamo animations, which loop correctly in Blender and Unity, but in Godot it has duplicate initial frames:
Godot4-LoopingHumanoid.zip

Regardless of it being Godot4-alpha16, THE SAME happens in Godot 3.5 - which is the worrisome part.

Temporary Solutions / Hacks

  1. Adjust every animation manually: Seamless looping animations stutter at the last frame before looping #65513 (comment)
  2. Use my Godot's editor option "Remove Duplicated First Frames" (no need to change meshes and animations): Seamless looping animations stutter at the last frame before looping #65513 (comment)

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions