对比其他的skel 看了好几次都没问题 但就是导入失败 :
不知道为什么skel无法导入 版本为3.6.52
Sorry you are having trouble. It is difficult when there is a bug in such an old version. We investigated your binary file and found a clipping attachment named SK_XD_ZZ
is the problem. The end slot was set to -1
which is not valid. We were able to modify the data to set it to zero, and now the data can be loaded. Please find it attached:
After importing this data, you may want to change the SK_XD_ZZ
clipping attachment end slot.
You're welcome! I'm glad we were able to help. Very often a problem in the binary data is not recoverable.
Note you can post in Chinese, the forum has a button that translates it into English for me, so it's easy to communicate in different languages. For you, there should be a button to translate my English posts into Chinese: Image removed due to the lack of support for HTTPS. | Show Anyway
Unfortunately it's difficult to find the position in the file that has the problem. To solve it yourself, you would need to try to load the data using a 3.6 runtime and write code that keeps track of how many bytes were read before the error. Then you need to edit the file with a hex editor and change the bad bytes.
That's probably too hard for most people. Here, we created a new 3.6.53 Skeleton Viewer that reports the byte offset when reading a binary file:
http://esotericsoftware.com/files/skeletonViewer-3.6.53.jar
When you load your original project with it, you'll see an error like this:
java.lang.RuntimeException: Error at byte: 270197
at com.esotericsoftware.spine.SkeletonViewer$3.readSkeletonData(SkeletonViewer.java:216)
at com.esotericsoftware.spine.SkeletonViewer.loadSkeleton(SkeletonViewer.java:221)
at com.esotericsoftware.spine.SkeletonViewer.create(SkeletonViewer.java:133)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:150)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:127)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 453
at com.badlogic.gdx.utils.Array.get(Array.java:156)
at com.esotericsoftware.spine.SkeletonBinary.readAttachment(SkeletonBinary.java:499)
at com.esotericsoftware.spine.SkeletonBinary.readSkin(SkeletonBinary.java:339)
at com.esotericsoftware.spine.SkeletonBinary.readSkeletonData(SkeletonBinary.java:277)
at com.esotericsoftware.spine.SkeletonViewer$3.readSkeletonData(SkeletonViewer.java:207)
... 4 more
That's the byte offset you need: Image removed due to the lack of support for HTTPS. | Show Anyway Image removed due to the lack of support for HTTPS. | Show Anyway Image removed due to the lack of support for HTTPS. | Show Anyway270197
. Open the .skel
file in a hex editor. I like XVI32 (here is the download link). Click Address
> Goto
and type 270197
:
The cursor jumps to that address:
Don't worry that the binary data doesn't make sense. The problem is just before the cursor: FF FF FF FF 0F
are the bytes that mean -1
. We need to replace them with 00
. Select the first FF
and press delete 4 times, then type 00
to replace the 0F
. Now it looks like:
Save the file, and it's fixed!
Nate 非常抱歉 我实在是太笨了,我尝试了用我给您的skel文件修复,但是按照您的讲解的步骤但是得到的结果缺大相径庭 我要换运行时读取skel吗 因为我用3.6.53 Skeleton Viewer 得到的是如下结果:
F:\xiufuy>java -jar skeletonViewer-3.6.53.jar liekongzuo_mega_pifu.skel
java.lang.RuntimeException: Error at byte: 224
at com.esotericsoftware.spine.SkeletonViewer$3.readSkeletonData(SkeletonViewer.java:216)
at com.esotericsoftware.spine.SkeletonViewer.loadSkeleton(SkeletonViewer.java:221)
at com.esotericsoftware.spine.SkeletonViewer.create(SkeletonViewer.java:133)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:150)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:127)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 41 out of bounds for length 5
at com.esotericsoftware.spine.SkeletonBinary.readSkeletonData(SkeletonBinary.java:202)
at com.esotericsoftware.spine.SkeletonViewer$3.readSkeletonData(SkeletonViewer.java:207)
... 4 more
cmd窗口显示的字节错误的大小值和您给我展示的不太一样,导致修复进度没法进行,在自己摸索几个小时没解决才来又打扰您的。
Skeleton Viewer doesn't take any arguments, it's just:
java -jar skeletonViewer-3.6.53.jar
You must not be using the liekongzuo_mega_pifu.skel
file from your first post above, because I always get Error at byte: 270197
.