An Aseprite script that allows you to export JSON files containing animation data to be used for MOTHER: Encore. It includes things such as Tags, Frame Lengths, Repeats and Animation Directions.
Firstly, you will need to set up the script in order to use it in Aseprite. To do so, follow these simple steps:
-
Open Aseprite.
-
In the navbar menu at the top navigate to File > Scripts > Open Scripts Folder.
- Take the _modules folder and the EncoreJsonExporter.lua file and move them into the Aseprite scripts folder which you have opened previously.
- In Aseprite, rescan the scripts by pressing File > Scripts > Rescan Scripts Folder.
- (OPTIONAL) Finally, you can add a keyboard shortcut to the script to use the script a lot faster. Just press "CTRL+ALT+SHIFT+K", and search for "EncoreJsonExporter" to find the script.
Awesome! So you have set up the script, but how do we use it? Well luckily, using the script is pretty simple.
Firstly, you will need to add Tags to your Aseprite animation. Each Tag will represent one Animation present in the Spritesheet you export.
If you don't know how to make a Tag on Aseprite, highlight the frames you want in the animation timeline, right click, and select "New Tag".
The script will be able to detect animation data such as the Animation Direction as well as the Repeat count. So make SURE those are set correctly.
If you have multiple tags of the same name, each tag will represent a different direction that the character will face. In order from left to right, these tags will be:
- Down
- Left
- Right
- Up
- Down + Left
- Down + Right
- Up + Left
- Up + Right
However, if you only have two tags of the same name, it will be:
- Left
- Right
After setting up your tags correctly, you can then use the script to export the json.
To use the script, go to File > Scripts > JsonExporter. Then it's as simple as filling in the fields.
Json Path: The path of the exported JSON.
Horizontal Frames: The number of columns on the exported spritesheet.
Vertical Frames: The number of rows on the exported spritesheet.
X/Y Offset: The offset of the sprite.
Merge Duplicate Frames: Whether the JSON should use the same index for duplicate frames or not. If you choose to merge duplicate frames, make sure to export the sprite sheet with duplicate frames merged as well.
Finally, right now Encore reads animation data from YAML files, so you'll have to convert the exported JSON into a YAML file. Usually you can just search "JSON to YAML converter" online and convert it there. We'll probably change it in the future so that you don't need to convert it to YAML.