[Script] Export all combinations of layers in groups

Export Combinations

Generate and export every combination of layers inside groups. Only one layer
inside each group will be exported at a time. Commissioned by AnomuraGame.

Introduction

Hello again!
This time I bring a new script once again to save your precious time which does the repetitive tasks that you should not do. What this script does is export every possible combination of layers inside different groups. For example, if you have 3 groups with 3 layers inside each group, the script will export all 3x3x3 = 27 combinations. This is especially helpful as you make more and more layers and groups, as the number of total combinations grows quickly.
The script was commissioned by AnomuraGame, so thanks for that!

Usage

Keep your layers organized in groups. For every group there is, only one layer
at a time will show in every exported file, and one layer of every other group. All possible
combinations will be exported.

Layers outside groups will be ignored. Nested groups are undefined behaviour.

Options

  • Output directory: The folder where to export. Note that you will specify a
    file, not a folder. This is because Aseprite’s API doesn’t support folder
    selection.
  • File name: The name of every exported file. The possible formatters are:
    {spritename}: The name of the sprite to export.
    {combination}: The combination number.
  • Export format: File format of exported files.
  • Export scale: The scale at which to export. The resolution of the file will
    be multiplied by this number. Useful for media sharing.
  • Save sprite: If checked, the full sprite will be saved in the output
    directory.

Example

  • In a sprite with 3 layer groups, and 4 layers inside each group, the script
    will create and export a total of 4x4x4 = 64 combinations.

Download

You can download my scripts from here: GitHub - PKGaspi/AsepriteScripts: My collection of Aseprite Scripts.

Installation

  1. Download or clone this repository.
  2. In Aseprite, go to File → Scripts → Open Scripts Folder.
  3. Copy the content of this repository’s script folder into the opened script
    folder.
  4. In Aseprite, go to File → Scripts → Re-scan Scripts Folder.

Changelog

  • v2.0 - Added name formatting option.
  • v1.0 - Initial release.

I hope you find this script useful and thank you very much for using it!
Any comment, feedback or suggestion is appreciated!
And again, thanks to AnomuraGame for the commission!

1 Like

this somehow does not work for me. idk if im doing something wrong. it only saves one picture of one combination for me (which is the currrent combi im on before saving) D:

Hi! If you can, please provide a .ase file with which I can test that and I’ll take it a look :slight_smile:

Hey, I am trying to use this and for some reason it isn’t working. I have all my different layers separated into groups, but when I run the script it says, “Success! Exported 0 Combinations.” Not quite sure what is causing this.