viniciusgerevini / godot-aseprite-wizard

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

Animation player support and improvements #44

Closed viniciusgerevini closed 2 years ago

viniciusgerevini commented 2 years ago

This is a big change. I usually split changes better, but I've got carried away (I laugh at the face of danger)

New feature #37

Feedback about the workflow is welcome.

Added AnimationPlayer support via Sprite Inspector dock.

When selecting a Sprite node, you should see this dock:

Sprite dock

Here is the dock in action:

animation_dock

Added AnimatedSprite Inspector import section, similar to the new AnimationPlayer support.

This dock shows when selecting an AnimatedSprite. It has the same fields as the other one, but the AnimationPlayer list:

Sprite dock

The flow is the same as the other one:

Animated Sprite dock

The wizard dock is still available for creating SpriteFrames resources and using the split feature.

Considerations and caveats

Using Editor Description to store metadata

In the GIFs above, you may have noticed some "gibberish" in the Editor Description field.

This is a base64 encoded config for the options you selected for that node. This is not required for the animation to work, however, it does improve the development flow, as you won't need to fill all information up again when re-importing your animations.

It's encoded in base64 just to stop the urge of trying to change configs manually (I'm watching you).

If I were to have the new fields persisted without using the "Editor Description", I'd have to create custom nodes extending the Sprite/AnimatedSprite nodes, which goes against my intention to keep this plugin a dev dependency only.

Another possible workaround would be saving temporary or support files, which would add complexity and flakiness to the plugin, and possibly pollute your repository.

The "Editor Description" was the best compromise from the options available. If it bothers you and you don't mind filling the fields up when re-importing, feel free to delete that text after each import.

Focused Layer instead of Split

One major difference between the wizard screen and the Inspector dock is the "Split layers" option vs the "Layer" field.

In the wizard, you can create one SpriteFrames resource for each layer, which is quite handy for bulk operations.

In the dock, though, this behaviour would make the flow over-complicated. I would have to handle scenarios like:

To avoid this complexity I decided to create the "Layer" field. This field lists all layers available in the Aseprite source file. You can choose the one you want to import. If you want more than one, you can duplicate the node and just change that field. It does require a little bit extra work, but it gives you more flexibility.

Here is an example: Layer example

Configuration Screen Improvements

Removed

Here is an example using "trim by grid":

trim issue

Pending

I've been testing and bug fixing these changes for more than a day now in two different systems.

I'll keep running these tests till the end of the week. If everything goes as planned, I might release the new version by the weekend.

There are certainly improvements to be made, but this looks good for a first release.