Most pixel art games use spritesheets for their animations, but manually exporting from the animation timeline is a pain, effectively destroys your animation if you do it on the same file, and with every new modification you need to start all over again.
This plugin allows you to easily export the active animation as a spritesheet without modifying your current working document.
Tools > Scripts > Export As Spritesheet will export the animation from the currently selected document's animation timeline.
export name: if you type in "exportName", the name of the individual exported frames will be exportName_000.png, exportName_001.png, etc., and the spritesheet will be called exportName.png . If your name contains a comma, anything after the first comma will be ignored, and the file will still export as a png (for example, "exportName", "exportName.png", "exportName.pdf", "exportName.v12.final.finalfinal.xcf" will all export to the same name, see example just above).
export directory: select the folder in which the spritesheet will be exported (the frames will be exported in a subfolder of the export directory called exportName_sprites if no sprites export directory is set)
change export directory: Opens a file explorer to select the Export Directory
reset to current directory: Resets the export directory to the directory containing the currently active .kra document
write json texture atlas: Writes a json texture atlas file that can be used e.g. in the Phaser 3 game framework. The atlas filename will be "exportName.json"
The filenames in the atlas file will be set to the numeric index of the texture. Example:
{ "frames": [
{ "filename": 0,
"frame": { "x": 0, "y": 0, "w": 300, "h": 334 } },
{ "filename": 1,
"frame": { "x": 300, "y": 0, "w": 300, "h": 334 } },
...
If you want to import spritesheets, just use the built-in tools and simply (with your spritesheet open) go to Image > Image Split then (in a new file of the same dimensions as one frame), File > Import Animation Frames (official tuto with images here)
If you want to merge existing spritesheets, open the biggest one to get a document its size, then remove or hide it so your document is empty, then import each spritesheet on a different frame (File > Import Animation Frames) and export them as a spritesheet (Tools > Scripts > Export As Spritesheet); you probably want 1 column and 0 (default) rows if your individual spritesheets are each one line
If you have comments, suggestions, or need to contact me, send me an email at: noemie.scherer@gmail.com or open an issue at https://github.com/Falano/kritaSpritesheetManager (which is also where you can re-download it in case of need)