Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnimatedTexture should be 0 fps by default so it animates normally based on frame time #4742

Closed
filipworksdev opened this issue Jun 24, 2022 · 2 comments · Fixed by godotengine/godot#65188
Labels
breaks compat Proposal will inevitably break compatibility topic:animation
Milestone

Comments

@filipworksdev
Copy link

filipworksdev commented Jun 24, 2022

Describe the project you are working on

Importing and using AnimatedTextures

Describe the problem or limitation you are having in your project

The problem here is all animations are forced to 4 fps out of the box.

This 4 fps is not stored in the PackedScene and is reset on reload in some situations. You can force save the resource to a .tres or .res file which is incredibly expensive process for an AnimatedTexture. A .tres adds 10 seconds to project load and save time for a 15 frame animation that is around 600x600 pixels. This is because is saving every single pixel in every frame in plain text format.

The is a description on how the fps property works in the docs https://docs.godotengine.org/en/stable/classes/class_animatedtexture.html?highlight=AnimatedTexture#class-animatedtexture-property-fps

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Just default fps to 0 and let the animation run based on individual frame time instead. Seems strange that you're forcing all animations to run at 4 fps.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

This is the line in 4.0 https://github.com/godotengine/godot/blob/79fd068a10e9976bf76d16e7cdf749693c9d4200/scene/resources/texture.h#L934

In 3.x is found in texture.cpp in the constructor

If this enhancement will not be used often, can it be worked around with a few lines of script?

This cannot be worked around easily. The only work around saving it to a resource adds significant wait time every time you load, run or save a project.

Is there a reason why this should be core and not an add-on in the asset library?

It has to be a core modification. Allowing that fps to be 0 by default would allow animations to run naturally.

@Calinou Calinou added topic:animation breaks compat Proposal will inevitably break compatibility labels Jun 24, 2022
@Calinou Calinou added this to the 4.0 milestone Jun 24, 2022
@Mickeon
Copy link

Mickeon commented Aug 20, 2022

One argument can be made that it is set to 4 FPS to highlight the AnimatedTexture's main specialty as soon as loaded, but then... well, it does require setting up the frames in the first place, so this isn't readily noticeable anyhow.

@filipworksdev
Copy link
Author

I think is very likely it was used as a testing value and made it into the release and I found out by pure coincidence that it causes all my individually chosen frame times to be ignored and forced to a 4/frames. Had to do a fair bit of research to figure out that fps 0 means enabling individually chosen frame times. 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaks compat Proposal will inevitably break compatibility topic:animation
Projects
None yet
3 participants