hsmyldk

我在GitHub上下载了3.5版本的demo,但是使用时报错root is undefined(spine-webgl.js line:4683 near: var root = typeof(json) === "string" ? JSON.parse(json) : json; var skeletonMap = root.skeleton;),后来发现问题根源是在 assetManager.get(DEMO_NAME, "char_147_shining.json").raptor 。
我绕过了raptor变成了 assetManager.get(DEMO_NAME, "char_147_shining.json") ,然后错误变成了(Error: Animation not found"Idle")"
然后我尝试用 (http://zh.esotericsoftware.com/blog/Embedding-assets-with-Spine-Web-Player)的办法来加载skel文件或json文件,但是或许不支持3.5版本的文件,失败了,
我该如何加载3.5版本的骨架。

PS:raptor的作用是什么?我在网上搜索没找到答案

希望能回复,谢谢
You do not have the required permissions to view the files attached to this post.
hsmyldk
  • Posts: 2

Mario

您无法使用Spine Runtimes 3.8版加载从Spine Editor 3.5版导出的框架。 编辑器的版本和运行时必须匹配。 您可以在Spine Editor 3.8中加载在Spine Editor 3.5中创建的Spine项目,并将其升级到该版本。 然后将其重新导出为Spine Runtimes 3.8。

我看过您的示例,文件夹“ spine-3.5”和“ spine-3.8”中的源代码都有很多错误。 您似乎已经将代码基于spritesheets演示了,这非常复杂。 我为您创建了一个简单的示例:
spine-runtimes/test-simple.html at 3.8

它使用二进制.skel格式而不是.json格式,但是经过细微调整,您也可以将其与.json格式一起使用。 您将必须将项目更新为3.5。

另外,您还可以研究pixiJS和pixi-spine,它们可能比WebGL后端更易于使用。 看到
https://github.com/pixijs/pixi-spine

You can not load a skeleton exported from Spine Editor version 3.5 with the Spine Runtimes version 3.8. The versions of the editor and the runtimes must match. You can load your Spine project created in Spine Editor 3.5 in Spine Editor 3.8 and upgrade it to that version. Then re-export it for Spine Runtimes 3.8.

I have looked at your example, and both the source code in the folder spine-3.5 and spine-3.8 have lots of errors in them. You seem to have based your code on the spritesheets demo, which is very complex. I have created a simple example for you:
spine-runtimes/test-simple.html at 3.8

It uses the binary .skel format instead of .json, but with minor adjustments you can also use it with .json. You will have to update your project to 3.5.

Alternatively, you can also look into pixiJS and pixi-spine, which might be easier to use than our WebGL backend. See
https://github.com/pixijs/pixi-spine
User avatar
Mario

Mario
  • Posts: 2360

hsmyldk

谢谢你的回复
我下载了demo,使用你的spine导出的文件可以运行,但是,使用我的spine文件报错(Error: Animation not found: Move),我只修改了文件的路径,其他地方没有修改,并且我用unity测试过我本地的spine导出的.skel文件,没有问题
You do not have the required permissions to view the files attached to this post.
hsmyldk
  • Posts: 2

Mario

Screenshot 2020-04-13 at 09.59.04.png


您已经使用Spine Editor 3.5.51版导出了骨骼。 请改为使用Spine Editor 3.8.x导出,否则spine-webgl运行时无法从3.8 GitHub分支正确读取数据。
You have exported your skeleton with Spine Editor version 3.5.51. Please export it with Spine Editor 3.8.x instead, otherwise the data can not be properly read by the spine-webgl runtimes from the 3.8 GitHub branch.
You do not have the required permissions to view the files attached to this post.
User avatar
Mario

Mario
  • Posts: 2360


Return to 中国Spine用户