• Unity
  • How to automate version migration of binary assets?

Hello everyone.

We are working on a mobile game project that is using Spine heavily. It contains about 200 binary Spine assets of version 3.6.

Now we need to upgrade to Spine version 3.8 and were looking for a way to automate importing and then exporting of all of the assets while keeping same atlas sizes that we use now. Is there a way for us to do it with command line interface? If there is, we could write a script to upgrade all of these assets in a single batch.

Thank you.

Related Discussions
...

This post may help:
Spine 3.8 released - mesh tracing, polygon packing, and more

If the old version of Spine is too old, it may not support all the command line parameters needed. I'm afraid in that case it would be a manual process to import the binary data and save a Spine project.

Please be sure to keep your Spine projects after this process! Unlike JSON or binary data, you can always open a Spine project with any newer version of Spine.

Nate

Thank you. I tried to use Windows console to test importing from .skel to .spine using version 3.6.53 like this:

Spine.com -i C:\Bird.skel -o C:\Bird.spine -r

It just starts the Spine Editor with an empty project and overlay message
"The last loaded project could not be found: spineboy"

No Bird.spine file is created in C:\


If I instead do

Spine.com -u 3.8.95 -i C:\Bird.skel -o C:\Bird.spine -r

it creates the output .spine file, but the original binary file is exported using 3.6. That output .spine file can not load the skeleton data in the 3.8.95 editor.

If I import manually from Editor GUI of version 3.6.53 and then export that .spine from Editor version 3.8.95 it works fine.

Spine.com -i C:\Bird.skel -o C:\Bird.spine -r

What version are you running with this? It's best to specify a version. You'll need to specify the exact version the .skel file was exported with. Eg if that was 3.6.53:

Spine.com -u 3.6.53 -i C:\Bird.skel -o C:\Bird.spine -r

If that opens the editor UI instead of creating the C:\Bird.spine then it means the launcher validated the parameters for the latest Spine, but the 3.6.53 editor is too old to accept the parameters. I'm afraid you'll have to do the binary data import using the editor UI, sorry! Once you have saved .spine files for each of your .skel files you can use the command line to do the exports using 3.8 (or any version).

If I instead do

Spine.com -u 3.8.95 -i C:\Bird.skel -o C:\Bird.spine -r

it creates the output .spine file, but the original binary file is exported using 3.6. That output .spine file can not load the skeleton data in the 3.8.95 editor.

I would expect that to fail, as 3.8.95 is very unlikely to be able to read binary data from 3.6.xx. Do you mean it creates a C:\Bird.spine that won't open in the 3.8.95 editor? If so, that sounds like a bug.

What version are you running with this?

3.6.53 specified in the Editor settings. It notifies in the console output that it is 3.6.53 right after running the command.

If specify the version explicitly like this

Spine.com -u 3.6.53 -i C:\Bird.skel -o C:\Bird.spine -r

it opens editor UI same as without the version

Do you mean it creates a C:\Bird.spine that won't open in the 3.8.95 editor? If so, that sounds like a bug.

Yes, it creates Bird.spine without explicit error message, then file does not open in 3.8.95. I assume that the 3.8.95 importer recognizes binary stream of that Bird.skel file as valid but the actual deserialized values are not valid from the Editor perspective.

OK, thanks for the clarification. It should fail to parse the binary file and not create a bad project file. We'll look into it!

If that opens the editor UI instead of creating the C:\Bird.spine then it means the launcher validated the parameters for the latest Spine, but the 3.6.53 editor is too old to accept the parameters.

Does it mean that Editor of version 3.6.53 did not have a functionality to import binary files from console?
Or what you mean is it was capable of doing importing, just the console interface was different than what current documentation describes?

If latter, is it possible to send us older installation of Spine Editor and documentation for its console interface?

I mean that 3.6.53 does not have the functionality to import binary files from the command line interface. To do the binary data -> spine project conversion using the UI, you can do it like this:
1) Run the old version of Spine, eg 3.6.53.
2) Drag a JSON or binary file on to the Spine window. The "Import Data" dialog opens.
3) Press enter to import the data into a new project.
4) Press ctrl+S to save the project file.
5) Repeat steps 2-4 for each data file.
It's unfortunately still a bit tedious, but dropping a file and using keyboard shortcuts help a little. Once you have your Spine project files you won't need to go through this trouble again.