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 · 0 comments

Comments

Projects
None yet
3 participants
@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

Fixing bug aseprite#1644: Combination of parameters results in jumble…
…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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment