godot icon indicating copy to clipboard operation
godot copied to clipboard

The third argument of `SpriteFrames.add_frames()` is different in 3.x and 4.x, but is not processed by project converter

Open faulknermano opened this issue 6 months ago • 2 comments

Tested versions

Reproducible in 4.0.stable, 4.2.2stable, 4.3.stable Not reproducible in Godot v3.4.4

System information

Godot v4.2.2.stable - Windows 10.0.19044 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 (NVIDIA; 31.0.15.2756) - AMD Ryzen 9 5950X 16-Core Processor (32 Threads)

Issue description

  • When adding frames to SpriteFrames using code, i.e SpriteFrames.add_frames, the resulting playback is laggy.
  • However, when adding frames using the SpriteFrames Editori UI in the Godot Editor, the resulting playback is smooth/is as expected.

I've packaged 2 repro projects which contains everything that is needed to demonstrate the problem.

This GIF is an example of the laggy playback godot-animatedsprite2d-anim_lag-2

And this is an example of playback that is normal godot-animatedsprite2d-anim_lag-1

Steps to reproduce

  • Open the uploaded G4 project in Godot 4.x.
  • Run the project.
  • The initial walk animation (anim-2) you will see should be rather slow in playback.
  • Click on the screen; this will switch to another animation (anim-1) which would play back normally.

In the project itself you will see:

  • In the SpriteFrames of the AnimatedSprite2D node, the anim-1 animation set has been created and loaded.
  • This is the animation that plays back smoothly.

In the AnimatedSprite.gd script in the project, you will see:

  • anim-2 has been loaded into the SpriteFrames using SpriteFrames.add_frames()
  • anim-2 is the animation that plays back slowly.

There are 2 projects, one for G4 and one for G3. Please note that this bug does not exist in G3, and you can test it with the G3 project.

Minimal reproduction project (MRP)

bugreport-animatedsprite2d-add_frames_runtime-godot4-1.zip bugreport-animatedsprite2d-add_frames_runtime-godot3-1.zip

faulknermano avatar Aug 17 '24 20:08 faulknermano