• Editor
  • Issue importing images from Affinity Designer

Related Discussions
...

I recently purchased spine and I'm having an issue with importing images which where exported via Affinity Designer. For my current test project I have four shapes I'm exporting, each are named Head, Torso, Left Leg and Right Leg. I go through affinity designer's export process by going to the export persona, slicing out all the images and exporting them via the 'spine json' option in batch builder. When I then try and import them into spine via the json file the images import okay with correct names but the positions of the images are not correct. Every image is spaced apart from what it was in Affinity designer. This is what affinity designer output as a .json file:

{"skeleton":{"images":""},
"bones":[{"name":"root"}],
"slots":[
   {"name":"Left Leg","bone":"root","attachment":"Left Leg"},
   {"name":"Torso","bone":"root","attachment":"Torso"},
   {"name":"Head","bone":"root","attachment":"Head"},
   {"name":"Right Leg","bone":"root","attachment":"Right Leg"}
],
"skins":{
   "default":{
      "Left Leg":{"Left Leg":{"x":1105.5,"y":548.5,"width":145,"height":405}},
      "Torso":{"Torso":{"x":1011.5,"y":933.5,"width":313,"height":445}},
      "Head":{"Head":{"x":1012.5,"y":1257.5,"width":231,"height":307}},
      "Right Leg":{"Right Leg":{"x":934,"y":546.5,"width":146,"height":405}}
   }
},
"animations":{"animation":{}}
}

Trying to think of some things that might be causing the issue and one thing I'm thinking is a difference in what affinity designer thinks is an images origin (center of the image) vs what spine thinks is the origin (maybe bottom middle)? Anyone else having this issue?

Hello boagz57, we don't maintain Affinity Designer's export script, you should contact them directly to solve this.
Here you can see the scripts we maintain: GitHub - EsotericSoftware/spine-scripts: Scripts to export from PhotoShop and other tools to Spine's JSON data format. if you're having problems with AD's one, you could maybe try to get your art in Photoshop and use our exporter instead, but probably the best solution would be to write to them.