Jump to content

[2.2.1] Created Spine JSON file currupt when chosing SVG + No Spine JSON created when chosing JPG


Recommended Posts

When chosing SVG the Spine JSON files generated by Affinity are corrupt.
[edit] When chosing JPG the Spine JSON file will not even be created (see next post)!


TLDR;
When chosing to export SVG-files the Spine JSON batch exporter doesn't work as supposed to; no x, y, width and height values are written for the assets to the json. This not only makes the Spine JSON corrupt, but even as a plain JSON it is now corrupt as format and so can't be read by JSON parsers.

I understand the Spine editor itself cannot handle SVG files (yet), but other applications using the format can, so there is no reason to limit this output to raster only. Also I recently published an importer script for Moho animation software which uses this Spine JSON output to automatically import assets from Affinity into Moho via the Spine JSON Format. I am working on support for vectorgraphics too in order to import vector graphics from Affinity into Moho with the script, but because of this issue that currently isn't possible unfortunately.

All measurement data luckily is already known by the Affinity software, so could this please get a fix? That would be awesome!

Thanks in advance!

image.png.126f8e1fe33040f79f7b5693f976d0b4.png

image.png.3d48abbee6237e4f4e0c53aa7cd073e3.png

 

image.png.ef26464fcb9605ba6a322b618f7adc3c.png

 

 

Link to comment
Share on other sites

To add to the above; when chosing JPG the Spine JSON file isn't even created!!

 

TLDR;
To add to the above; I just tried the same, but now with JPG. To my big surprise when chosing the 'Single JPEG (High Quality)' export preset, Affinity doesn't even write the Spine json file... But JPEG files are without a doubt supported by Spine and also here I don't see any reason why this shouldn't output a spine json file when the Spine JSON is chosen in the Batch Builder dropdown.

Link to comment
Share on other sites

  • 2 weeks later...
On 11/4/2023 at 3:53 PM, Lee_T said:

Hi MmmMaarten,

I've not been able to recreate this, could you possibly supply a file and full recipe to recreate this issue?

Lee

It's very straight forward and always reproducable here, so you must have done something differently. There's nothing special about the files and the results are always the same.

I just found that also when picking the default SVG exports in the slice-exports it sometimes not even generate the Spine JSON file, while after some clicking around without changing anything suddenly that works. Feels totally unpredictable and unstable tbh.

I also reported months ago already that spine JSON files aren't updated when things change and you export again. That's also an issue here.

But with my own svg preset it seems to create the spine JSON the first time, but creates a corrupt one; as seen in the video.
For the rest it's easy to reproduce the other scenarios too, as written about above.

 

 

Link to comment
Share on other sites

  • 3 weeks later...
On 10/24/2023 at 5:20 PM, MmmMaarten said:

To add to the above; I just tried the same, but now with JPG. To my big surprise when chosing the 'Single JPEG (High Quality)' export preset, Affinity doesn't even write the Spine json file...

FWIW, certainly the same issue when creating Spine JSON files for SVG on macOS but no issues writing the Spine JSON file for JPEG files or with the Spine JSON files being updated when things change and you export again...

Affinity Designer 2.5.5 | Affinity Photo 2.5.5 | Affinity Publisher 2.5.5
MacBook Pro M3 Max, 36 GB Unified Memory, macOS Sonoma 14.6.1, Magic Mouse
HP ENVY x360, 8 GB RAM, AMD Ryzen 5 2500U, Windows 10 Home, Logitech Mouse

Link to comment
Share on other sites

12 minutes ago, Hangman said:

files being updated when things change and you export again

Make a dir with just a Spine.json file and then export a file/spine into that dir

It will ignore the previous Spine.json and just export the first time, but then it will ask you the second time because the other file exists

Link to comment
Share on other sites

11 minutes ago, Ezbaze said:

Make a dir with just a Spine.json file and then export a file/spine into that dir

It will ignore the previous Spine.json and just export the first time, but then it will ask you the second time because the other file exists

I see what you mean, it overwrites the original Spine JSON file on the first export without asking but then asks on the second attempt... not good...

Affinity Designer 2.5.5 | Affinity Photo 2.5.5 | Affinity Publisher 2.5.5
MacBook Pro M3 Max, 36 GB Unified Memory, macOS Sonoma 14.6.1, Magic Mouse
HP ENVY x360, 8 GB RAM, AMD Ryzen 5 2500U, Windows 10 Home, Logitech Mouse

Link to comment
Share on other sites

1 minute ago, Ezbaze said:

Indeed, especially as the file could be completely unrelated

Exactly...

Affinity Designer 2.5.5 | Affinity Photo 2.5.5 | Affinity Publisher 2.5.5
MacBook Pro M3 Max, 36 GB Unified Memory, macOS Sonoma 14.6.1, Magic Mouse
HP ENVY x360, 8 GB RAM, AMD Ryzen 5 2500U, Windows 10 Home, Logitech Mouse

Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.