Skip to content

exporting data from aseprite (en)

nklbdev edited this page Sep 15, 2023 · 5 revisions

About importing data from Aseprite/LibreSprite

en ru

Aseprite logo

Aseprite is a wonderful application for working with pixel-art graphics and animation. It has many handy drawing tools, the ability to change palettes and a table of layers and frames. On the frame line, you can highlight ranges using tags, in which you can specify the direction and number of repetitions of the animation. For each frame, you can individually set the duration. Layers can be of 4 types: regular raster layer, reference layer, tile map layer and layer group.

It has a simpler but free counterpart - LibreSprite. It has been founded by a group of independent developers since Aseprite changed its license and ceased to be free software, although it remained in the status of open source software. LibreSprite has been forked from the latest Aseprite commit released under a free software license.

LibreSprite has a lot less features but can replace Aseprite for Importality. But with some restrictions. For example:

  • It doesn't recognize "ping-pong reversed" animation direction. It will do "forward" instead.
  • It does not recognize the number of repetitions of the animation. Instead, all animations will be infinite.
  • It may not recognize many of the new features that Aseprite has introduced since then, such as tilemaps. It can also have problems with layer groups, as it only supports individual layers.

The direction of the animation and the number of repetitions can be overriden using suffixes in the tag names:

<animation_name> [-d:<direction>] [-r:<repeat_count>]

Where:

  • direction - animation direction. Possible values:
    • f (forward)
    • r (reverse)
    • pp (ping-pong)
    • ppr (ping-pong reverse)
  • repeat_count - the number of repetitions of the animation (default 1). If set to 0, the animation will loop indefinitely

For example:

Idle -r:0
Walk -r:0
Jump -r:1
Crouch -r:1
Hurt -r:1
Die -r:1
Special -d:pp -r:0

Aseprite allows you to flexibly configure export to different formats, specify which layers and tags will be involved in the export, and most importantly, create animation atlases, the so-called sprite sheets. It also has a rich API for Lua and CLI (command line interface).

In order not to have to manually call the export from Aseprite/LibreSprite manually and then configure the import of its results into the Godot project, you can configure the import of *.aseprite files using Importality. To do this, in the project settings in the "Importality" section specify the temporary files directory and specify the path to the Aseprite (or LibreSprite) executable file (Aseprite/LibreSprite). Then select the *.aseprite file in the Godot file system tree, select the required import format in the "Import" tab, configure its parameters and click the "Reimport" button. If you change the import format, the engine may require a restart.

If you import a *.aseprite file as an image, only the first frame of the image will be imported. If you import it as a set of animations, then one animation will be created for each tag on the frame table. The plugin recognizes the direction of the animation and the number of iterations.

Settings

Import options

If there are any errors during the import, carefully read the messages in the "Output" console and check if the paths in the addon settings (in the project settings) and the import parameters are filled in correctly. Removing the *.import file next to the *.aseprite file and files of the same name from the hidden .godot/imported folder can also help. If these steps don't help, create an issue about your problem in this repository, and describe your problem there. Specify in it your operating system, version of Aseprite, its distribution method and version of the Godot engine. Attach screenshots and other materials that will help you reproduce and fix your problem. You will greatly help this development of the project!

Clone this wiki locally