Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cstrachan88 opened this issue May 8, 2024 · 1 comment · May be fixed by #4475
Assignees
Labels
Milestone

Comments

@cstrachan88
Copy link

cstrachan88 commented May 8, 2024

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
@Gasparoken
Copy link
Member

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

@Gasparoken Gasparoken added this to the v1.3.x milestone May 17, 2024
@Gasparoken Gasparoken self-assigned this May 17, 2024
Gasparoken added a commit to Gasparoken/aseprite that referenced this issue May 17, 2024
…ity between CLI and Scripting (fix aseprite#4456)

Before this fix, the lua command:
app.command.ExportSpriteSheet
could not process a layer within a group when the layer name
was expressed using the layer hierarchy path, for example:
layer = "Group1/Layer1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In Progress
2 participants