steffan.weber

I would love to use the new updated version 3.8, but I would have to re export every animation I have, since we keep updating our games online, again. we are talking years of work, on countless projects, with settings I no longer remember. since all our games are updated at the same time, we would have to upgrade to newest version, then in a mad panic try to find, and re export all of 3 years of animations again. is there another way, please?

it is becoming a problem, and that problem will only grow.

also, what happens the next time you decide to do an update that doesn't support older version of exports, and we are 5, 7 or 9 years in? will you just as calmly ask us to export everything again?
steffan.weber
  • 記事: 13

Nate

puzzler さんが書きました:It will be great to have some tool to migrate json 3.6 to latest json 3.8 ... is it possible somehow? It's too hard to reexport whole 500 files to latest version. Any solution to simplify life?
You can do all your exports from the command line:
Export - Spine User Guide: Command line
It's not hard to write a script that exports all your project files in one go. Please create a new topic if you'd like assistance with this.
steffan.weber さんが書きました:I would love to use the new updated version 3.8, but I would have to re export every animation I have, since we keep updating our games online, again. we are talking years of work, on countless projects, with settings I no longer remember. since all our games are updated at the same time, we would have to upgrade to newest version, then in a mad panic try to find, and re export all of 3 years of animations again. is there another way, please?
Sorry, there isn't another way. The JSON data is intended for use at runtime, not for long term storage.

It should not be a terribly difficult problem since there are very few settings for exporting JSON/binary, which is all you need to re-export. You don't need to export your atlases again. However, if you wanted to, for a long time now export settings are stored in the project file, so that is likely easier than you might expect.
steffan.weber さんが書きました:also, what happens the next time you decide to do an update that doesn't support older version of exports, and we are 5, 7 or 9 years in?
To import data into the editor, you need to use the version of the editor that exported the data. Newer editors do not officially support importing data from older versions, though sometimes that does work coincidentally. You can import the data then save a project file. Once you have a project file, you can open that with any newer version of the editor.
steffan.weber さんが書きました:will you just as calmly ask us to export everything again?
Whenever you update your runtime version (excluding patch releases, where version numbers are major.minor.patch), you will need to export your project files to JSON or binary again. This can be automated using the command line interface. You can write a script to re-export all your projects at once. If needed you can even write a script to load an old version of Spine, import old data, save a project file, load that project file in a new version of Spine, and do an export.
アバター
Nate

Nate
  • 記事: 9395

puzzler

Nate, this is insane to re export whole project files to migrate from 6 to 8 ... I know command line tools. It took several years to develop animations, different path, different export names, renames and etc. It's impossible just to use "command line tool". Need a better way to support old formats on SDK side.
puzzler
  • 記事: 108

Nate

What is insane about it? You don't need to export atlases. Exporting JSON or binary has very few settings. If the .spine file was lost, you can import into the older version, then export with the new version.

It is unreasonable for us to bloat all of the many runtimes so they can load data from any older version. Still, I do agree there is more we can do to make things easier and we have some plans for that soonish. It won't be allowing runtimes to load older data though.

One solution for now may be that you copy SkeletonJson or SkeletonBinary from an old runtime into the latest runtimes and fix up any errors. This would allow you to load the older JSON or binary data, if you really must go that route.
アバター
Nate

Nate
  • 記事: 9395

puzzler

I don't know location for all original Spine files. Also, some of them was changes, adjusted ... a lot of versions, tests, and latest version is not obvious. It's TOO MANY spine files, versions. Also, names of json does not match Spine files or skeletons. It's very hard to redo whole this job again. It's near impossible to use latest version of Spine because of this.

The alternative solution I can think of is - tool to convert json/binary directly (without using original .spine file).
puzzler
  • 記事: 108

Erikari

You can always just import the json/binary in Spine, save a new project, upgrade Spine to the latest version and export the project. If you import all the old jsons in a single spine project it's also convenient as you'd export them all at once.

If you exported your files with nonessential data checked you should definitely be good to go :D but likely that may be also true if you haven't as you already have atlases exported.

Import - Spine User Guide
アバター
Erikari

Erikari
  • 記事: 2206

puzzler

Could you please make a sample script of how to convert old version to the latest?
puzzler
  • 記事: 108

Nate

This runs Spine 3.6.53 and imports old.json (which must be JSON exported from 3.6.53) into the project.spine project file:
spine -u 3.6.53 -i old.json -o project.spine
You would of course change 3.6.53 to the actual version of the JSON data, which is in the JSON data (unless it is very old data).

You can specify more actions in one run of Spine:
spine -u 3.6.53 -i old1.json -o project1.spine -i old2.json -o project2.spine -i old3.json -o project3.spine
If you are writing a shell script, Windows batch scripts are pretty nasty to deal with. On Windows I prefer to install Cygwin and use a bash script. For example, here is the script we use to export all the example projects:
spine-runtimes/export.sh at 3.8
As seen there, in a bash script you can escape the newline character using blackslash, so the command above can be written a bit more nicely:
spine -u 3.6.53 \
-i old1.json -o project1.spine \
-i old2.json -o project2.spine \
-i old3.json -o project3.spine
There are many ways to write a script that runs a command like this on all files in a folder. If each JSON file can be any version, you could write a little application that reads the version from the JSON to use the correct -u parameter. If your JSON is so old it doesn't have the Spine version it was exported from, you may need to do some trial and error to see which Spine version it can be imported into.

Please note that if you are moving from < 3.0.00 to >= 3.0.00 that how scale is applied has changed. Such a big change in behavior across versions is very rare and something we try to avoid.

Now that you have project files, you can simply open them with any new version of Spine (eg, the latest). If you want to export the project files to JSON using the command line or a script, that is done like this:
spine -u 3.8.83 -i project.spine -o project.json -e settings.export.json
The settings.export.json file can be saved from the export dialog in Spine.

The command line interface (CLI) documentation has more detailed information:
Export - Spine User Guide: Command line
アバター
Nate

Nate
  • 記事: 9395


Return to Spine