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

JSON slice information unusable when combining multiple input files in CLI #4444

Open
Lommix opened this issue May 1, 2024 · 1 comment
Open

Comments

@Lommix
Copy link

Lommix commented May 1, 2024

When combining multiple input files into one big atlas, slice bounds in the json output file are relative to their original image and do not represent the bounds of the new atlas. There is an offset missing.

Example:

aseprite -b  first.aseprite second.aseprite --data atlas.json --sheet atlas.png --list-slices 

Aseprite and System version

  • Aseprite version: 1.3.6-dev
  • System: Linux
@Gasparoken
Copy link
Member

Thanks for this report. I was able to reproduce it.
This was requested on #1651 (#1651 (comment)) too. Anyway it's good to have a specific issue for this.

Test result:
bug.zip

{ "frames": {
   "spr_a.aseprite": {
    "frame": { "x": 0, "y": 0, "w": 32, "h": 32 },
    "rotated": false,
    "trimmed": false,
    "spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
    "sourceSize": { "w": 32, "h": 32 },
    "duration": 100
   },
   "spr_b.aseprite": {
    "frame": { "x": 0, "y": 32, "w": 16, "h": 16 },
    "rotated": false,
    "trimmed": false,
    "spriteSourceSize": { "x": 0, "y": 0, "w": 16, "h": 16 },
    "sourceSize": { "w": 16, "h": 16 },
    "duration": 100
   }
 },
 "meta": {
  "app": "https://www.aseprite.org/",
  "version": "1.3.6-x64",
  "image": "atlas.png",
  "format": "RGBA8888",
  "size": { "w": 32, "h": 48 },
  "scale": "1",
  "slices": [
   { "name": "Slice 1", "color": "#0000ffff", "keys": [{ "frame": 0, "bounds": {"x": 16, "y": 16, "w": 6, "h": 12 } }] },
   { "name": "Slice 1", "color": "#0000ffff", "keys": [{ "frame": 0, "bounds": {"x": 1, "y": 1, "w": 7, "h": 7 } }] },
   { "name": "Slice 2", "color": "#0000ffff", "keys": [{ "frame": 0, "bounds": {"x": 8, "y": 8, "w": 7, "h": 7 } }] }
  ]
 }
}

We need to fix each slice coordinate and include an extended name for each:
spr_a/Slice 1
spr_b/Slice 1
spr_b/Slice 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants