amol lokare

Somehow I didn't check the spine version and save some animation files to 3.8.64 which was needed for 3.7.87
and now developer couldn't open these files in the unity project or export it as a previous version. please help me to save a lot of work :)
amol lokare
  • Posts: 1

Erikari

Hello!

In order to import a json exported with Spine v3.8 into v3.7 you will need to use the JsonRollback tool.

1. Export a json with "Nonessential data" checked in the export settings, otherwise the mesh information might be lost.

2. Download Skeleton Viewer from this page: Skeleton Viewer

3. Make sure to have java installed and up to date: http://www.java.com/

4. Copy skeletonViewer-beta.jar in the folder where you saved the json exports

5. Launch the command line, then type this command, structured as follows:
java -cp "skeletonViewer.jar" com.esotericsoftware.spine.JsonRollback "the-file-to-convert.json" "3.7" "the-file-destination.json"
For example, in my case I launched this command:
java -cp "C:\Users\Admin\Desktop\json\skeletonViewer.jar" com.esotericsoftware.spine.JsonRollback "C:\Users\ Admin\Desktop\json\oldfile.json" "3.7" "C:\Users\Admin\Desktop\json\3.7\newfile.json"
(you can also save this text in a file and rename it with a .bat extension, then double click it to execute it)

6. downgrade Spine to v3.7 and import the generated json

---

The command line is located in different places depending on your operating system: https://arian-celina.com/windows-cmd-macos-terminal-navigation/
User avatar
Erikari

Erikari
  • Posts: 2088

KWiebe

Hi! Not sure what I am doing wrong, but I am getting these errors.
PS C:\Users\kate> java -cp "C:\Users\kate\Documents\TESTESTESTEST\skeletonViewer.jar" com.esotericsoftware.spine.JsonRollback "PiggyButton.json" "3.7" "PiggyButton2.json"
Exception in thread "main" com.badlogic.gdx.utils.SerializationException: Error reading file: PiggyButton.json
at com.badlogic.gdx.utils.Json.fromJson(Json.java:758)
at com.esotericsoftware.spine.JsonRollback.main(JsonRollback.java:64)
Caused by: com.badlogic.gdx.utils.SerializationException: Error parsing file: PiggyButton.json
at com.badlogic.gdx.utils.JsonReader.parse(JsonReader.java:78)
at com.badlogic.gdx.utils.Json.fromJson(Json.java:756)
... 1 more
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Error reading file: PiggyButton.json (Absolute)
at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:150)
at com.badlogic.gdx.files.FileHandle.reader(FileHandle.java:169)
at com.badlogic.gdx.utils.JsonReader.parse(JsonReader.java:76)
... 2 more
Caused by: java.io.FileNotFoundException: PiggyButton.json (The system cannot find the file specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:146)
... 4 more
Any idea how to fix this? Cheers
KWiebe
  • Posts: 4

Erikari

Hi! It looks like the JsonRollback can't read the json. Did you export it from v3.8 with "Nonessential data" checked?
Did you use the latest version of the jar to launch it?
User avatar
Erikari

Erikari
  • Posts: 2088

KWiebe

That is correct. Exported with 3.8.72 and using Skeleton Viewer, v3.8.61. Attached is a picture of what my export settings look like...
You do not have the required permissions to view the files attached to this post.
KWiebe
  • Posts: 4

Erikari

You don't need to check pretty print in this case. Did you get any warning on export? did you use features not present in older versions of Spine, such as skin bones?
User avatar
Erikari

Erikari
  • Posts: 2088

KWiebe

There are other skeletons in the project that use skin placholders, but not on the specific skeleton I am using the json of... No warnings on export.
KWiebe
  • Posts: 4

badlogic

You need to run this command from the folder where your .json file is, or specify the full path to the input .json file. Taking a guess based on your info above, that path is likely C:\Users\kate\Documents\TESTESTESTEST\PiggyButton.json.
User avatar
badlogic

Mario
  • Posts: 2168

KWiebe

It worked!!! Thank you!
KWiebe
  • Posts: 4


Return to Editor