aseprite / aseprite

Animated sprite editor & pixel art tool (Windows, macOS, Linux)

Home Page:https://www.aseprite.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[bug] [scripting] Exporting a Sprite Sheet with Group name has different functionality between CLI and Scripting

cstrachan88 opened this issue · comments

Exporting a sprite sheet using the CLI has the expected behavior when specifying a group name. When using a lua script, the group name is lost and instead, all layers and groups are exported.


I have an aesprite file laid out as shown below. All of the layers share the same tagged sections.

sprite.ase

  • group1
    • layer1
    • layer2
  • group2
    • layer1
    • layer2

Using the following cli command, I am able to export the correct layer:

aseprite -b --sheet-type rows --split-tags --list-tags --split-layers --list-layers --layer "group1/layer2" --filename-format "{tag}_{tagframe00}" sprite.ase --sheet "group1_layer2.png" --data "group1_layer2.json"

I want to export all layers without having to specify the names of each layer individually. Using a lua script for this is trivial, however, the app.command.ExportSpriteSheet does not behave correctly when passing a "group/layer" string into the layer parameter. It instead exports all layers concatenated into a single png and json file no matter what group / layer combo is specified.

app.command.ExportSpriteSheet({
    ui = false,
    askOverwrite = false,
    type = SpriteSheetType.ROWS,
    splitTags = true,
    listTags = true,
    splitLayers = true,
    listLayers = true,
    layer = "group1/layer2",
    filenameFormat = "{tag}_{tagframe00}",
    textureFilename = "group1_layer2.png",
    dataFilename = "group1_layer2.json",
})

Is there another way to export each layer as its own spritesheet without flattening my aseprite hierarchy? Currently the json matches (besides the meta object) since all layers share tags, so getting the pngs files is the problem.

Aseprite and System version

  • Aseprite version: Aseprite 1.x-dev
  • System: Windows 11 x64

Thanks for this report. I was able to reproduce it.