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 - CLI - Combination of parameters results in jumbled layer order. #1644

Closed
johanwendin opened this issue Jan 1, 2018 · 2 comments
Closed
Assignees
Labels
Milestone

Comments

@johanwendin
Copy link

@johanwendin johanwendin commented Jan 1, 2018

Hello.

While using the CLI, if you combine the options:
"--ignore-layer" (to ignore a specific layer, or multiple layers) as well as "--split-layers", the resulting json has the "--list-layers" layer-list order randomized.

Same thing happens if you combine "--split-layers" and specify which layers to include using multiple "--layer"

This also means that it's just not the "layers" meta block that's out-of-order, but the frames list them in the same order as the "layers" meta block, resulting in incorrect sprites if you render them in the order specified within the json.

i.e:

aseprite -b --split-layers --list-layers filename.ase --format json-array

gives: (correct order)

"layers": [
 { "name": "_bg", "opacity": 255, "blendMode": "normal" },
 { "name": "legs", "opacity": 255, "blendMode": "normal" },
 { "name": "back_arm", "opacity": 255, "blendMode": "normal" },
 { "name": "body", "opacity": 255, "blendMode": "normal" },
 { "name": "front_arm", "opacity": 255, "blendMode": "normal" },
 { "name": "head", "opacity": 255, "blendMode": "normal" }
]

whereas:
aseprite -b --split-layers --list-layers --ignore-layer _bg filename.ase --format json-array

gives: (examples, this will vary randomly)

(first run)

"layers": [
 { "name": "head", "opacity": 255, "blendMode": "normal" },
 { "name": "legs", "opacity": 255, "blendMode": "normal" },
 { "name": "front_arm", "opacity": 255, "blendMode": "normal" },
 { "name": "back_arm", "opacity": 255, "blendMode": "normal" },
 { "name": "body", "opacity": 255, "blendMode": "normal" }
]

(second run)

"layers": [
 { "name": "front_arm", "opacity": 255, "blendMode": "normal" },
 { "name": "legs", "opacity": 255, "blendMode": "normal" },
 { "name": "back_arm", "opacity": 255, "blendMode": "normal" },
 { "name": "head", "opacity": 255, "blendMode": "normal" },
 { "name": "body", "opacity": 255, "blendMode": "normal" }
]

(third run)

"layers": [
 { "name": "back_arm", "opacity": 255, "blendMode": "normal" },
 { "name": "legs", "opacity": 255, "blendMode": "normal" },
 { "name": "head", "opacity": 255, "blendMode": "normal" },
 { "name": "body", "opacity": 255, "blendMode": "normal" },
 { "name": "front_arm", "opacity": 255, "blendMode": "normal" }
]

Expected output:

"layers": [
 { "name": "legs", "opacity": 255, "blendMode": "normal" },
 { "name": "back_arm", "opacity": 255, "blendMode": "normal" },
 { "name": "body", "opacity": 255, "blendMode": "normal" },
 { "name": "front_arm", "opacity": 255, "blendMode": "normal" },
 { "name": "head", "opacity": 255, "blendMode": "normal" }
]

Aseprite and System version

  • Aseprite version: 1.2.6-x64, Steam
  • System: Windows
@dacap dacap added this to the v1.2 milestone Nov 5, 2018
@dacap dacap added low priority and removed critical priority labels Nov 5, 2018
dncampo added a commit to dncampo/aseprite that referenced this issue Nov 10, 2018
…d layer order.

This fix iterates over layers, no matter if are visible or not
@dacap dacap closed this in f6bb446 Nov 12, 2018
@aseprite aseprite deleted a comment from Brailoff Nov 12, 2018
@vovchisko
Copy link

@vovchisko vovchisko commented Dec 28, 2018

Can be also reproduced with:
aseprite -b --split-layers --all-layers --ignore-layer bg-grid player.f.ase --sheet player.f.gif

In this case, source .ase has 8 layers representing sides (N, NE, E, SE...) + 1 ignored layer "bg-grid". Each layer has 4 frames.
Messing layers order. 1st become 2nd, and the last one becomes first.
But if I remove --ignore-layers, it works. Also in both cases layers order is reversed.

@dacap
Copy link
Member

@dacap dacap commented Dec 28, 2018

@vovchisko are you using Aseprite v1.2.9? This should be fixed in v1.2.10-beta4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants