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:
Here is the dock in action:
The Animation Player field returns all AnimationPlayers from the current scene.
If the animation already exists in the AnimationPlayer, all existing tracks are kept. Only the required tracks for the Sprite animation will be changed (Sprite:frame).
Loop configuration and animation length will be changed according to the Aseprite file.
The plugin will never delete an Animation containing other tracks than the ones used by itself (Sprite:frame). In case the animation is removed from Aseprite, it will delete the track from the AnimationPlayer and only delete the animation in case there are no other tracks left.
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:
The flow is the same as the other one:
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:
Creating one Sprite node for each layer. How to verify if a node already exists? Groups? Name conventions?
Should I create an AnimationPlayer for each layer? Should I add all the layers to the same Animation Player? I'd probably have created a config for that.
What to do when a layer is deleted? Should I delete the existing nodes?
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:
Configuration Screen Improvements
Moved configuration window from dock to "Project > Tools > Aseprite Wizard Config".
Added "default layer exclusion pattern" option to configuration screen.
Importer is not enabled by default anymore. I intend to deprecate the importer in the next major version. (if you use it, speak now or forever hold your peace).
"Remove source files" is enabled by default.
Added button to test Aseprite command in the configuration screen, which returns Aseprite version.
Removed
Removed "Trim" and "Trim by Grid" options. Reason: Trimming didn't work as expected and fixing it defeated its purpose. When trimming an animation, each frame would have a different size, making the animation
boundary and position change constantly. This could be fixed in SpriteFrames by calculating the proper margin, however, the resulting file would be bigger than the one with trimming disabled.
Check issue #39 for more details.
Here is an example using "trim by grid":
Pending
I've been testing and bug fixing these changes for more than a day now in two different systems.
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:
Here is the dock in action:
Sprite:frame
).Sprite:frame
). In case the animation is removed from Aseprite, it will delete the track from the AnimationPlayer and only delete the animation in case there are no other tracks left.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:
The flow is the same as the other one:
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:
Configuration Screen Improvements
Removed
Here is an example using "trim by grid":
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.