viniciusgerevini / godot-aseprite-wizard

Godot Editor plugin to help import Aseprite animations to AnimationPlayers, AnimatedSprites and SpriteFrames.
MIT License
891 stars 42 forks source link

Avoid AtlasTexture clones creation in SpriteFrames #48

Closed Mickeon closed 2 years ago

Mickeon commented 2 years ago

This PR makes sure that any generated atlas AtlasTexture in _add_animation_frames() is unique. It improves memory usage, especially when multiple frames are repeated across the same file, but nothing extraordinary,

Also slightly tweaks the code around to make it easier for me to visualize. Feel free to cherry-pick and adjust what's necessary if necessary. However, due of this, frames may appear consistently botched in SpriteFrames editor, more than before. This unfortunately is a known bug (godotengine/godot/issues/30302).

(Importer flow is really good for quick prototyping, it would be a shame to deprecate it by the way \o/ )

viniciusgerevini commented 2 years ago

Thanks @Mickeon . This looks like a good improvement. I'll just run some tests before merging it.

(Importer flow is really good for quick prototyping, it would be a shame to deprecate it by the way \o/ )

Yeah, it does have its value. Before dropping it I intend to give another try at fixing its bugs. Also, as long as it doesn't get in the way of the main features, I'm fine keeping it like this. The deprecation warning is mostly to alert about the current issues, and to make it clear that the other methods have preference over it.

viniciusgerevini commented 2 years ago

Heyo. I've run some tests, and it looks all good. I could see some size improvements in files imported via the wizard and dock, but it didn't really change the size when imported via the automatic import process.

Anyway, I'm talking about bytes here. My tests were more to guarantee the code improvement didn't surface any hidden bugs.

I'll include these changes in the next release, but I still want to bundle a few other changes together, so it might take one more week at least.

Thanks for your contribution again Mickeon. :)