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