• Bugs
  • Error reading skeleton JSON file for SkeletonData asset

Related Discussions
...

Sorry about that


the 3.8.12-beta version of the Spine editor has changed the JSON and binary formats. The Spine Runtimes in the 3.8-beta branch have not all been updated with the changes for the latest beta editor release, which is unfortunately the drawback of using the beta. However, we plan to have that done soon, ideally by mid-week if not sooner. Also it is likely spine-csharp / spine-unity will be one of the first runtimes to be updated.


FWIW, we've updated the Skeleton Viewer to be able to open data from 3.8.12-beta:
Skeleton Viewer
Of course I realize this doesn't help you with getting your assets into Unity. We'll post here as soon as that is ready!

Huh, no you're right, the checkbox makes it look like spine-csharp and spine-unity are done. It seems they were checked prematurely, or possibly someone forgot to push to GitHub. Bones now have a "skin" attribute and I don't see it being read, so the code on GitHub doesn't have it yet. Sorry! Likely it'll be up first thing Monday morning.


Turns out it slipped my mind that the skin bones and constraints feature was done in the skin-bones branch, as we weren't sure if it would make it into 3.8. The changes are indeed there! So you can grab the runtimes from that branch if you'd like to take it for a spin, though please note we are working on it actively both for testing of the skin bones features and to improve skins and provide better APIs for combining and manipulating skins. The skin-bones branch will be merged into the 3.8-beta branch and removed soon.

Gonna stick with 3.7 for now and wait for things to get a bit more stable. While we're on the topic - how do runtimes handle skin specific bones specifically performance wise for a top-down 4-directional character? Would a 3.7 skeleton that repurposes bones by baking transform into animations be as performant as a 3.8 skeleton with skin-specific bones that are made for each major direction - top, down, right, left? If a 3.7 skeleton would have 50 bones, a 3.8 skeleton could have 50 per one of the four skins for a grand total of 200 bones. Does the engine render them all or do the runtimes decide which ones to calculate based on the active skin? In short, what is the performance impact of using this feature?

A skeleton has an "update cache", which is an ordered list of bones and constraints that need to be "updated" when Skeleton updateWorldTransform is called, which is to say bone world transforms are computed and the constraints are applied to manipulate their constrained bones. The contents of the update cache is computed once when the skin changes. After that, only the bones and constraints in the update cache are computed by updateWorldTransform.

Bones and constraints that are in at least one skin are not included in the update cache (they are "inactive") unless a skin containing them is the current skin. This means having many bones and/or constraints that are inactive does not affect performance at all. However, there is still a small difference with animation timelines. Inactive bones and constraints may have timelines, so each timeline has to first check if the bone or constraint is inactive and if so, do nothing. This check is quite cheap, especially compared to how it used to work: previously all bones were always active, so all timelines were always applied, even for bones that were not needed for the current skin. Should this be a performance problem (which is unlikely unless you have thousands or more timelines in a single animation), optimizations could be done. Eg, there could be an update cache similar to what the skeleton does that collects only the timelines that need to be applied, so the inactive timelines don't need to be checked.

You may think great, now I can put all my characters in a single skeleton! Yes, yes you could, but that might not be the best idea for organization and means that you cannot split up loading skeleton data for only some of your characters.

The skin bones and constraints feature has many uses, but the most common is to use a skin per in-game item and to have bones only for that item. Eg, maybe your skeleton can equip a machine gun which uses bones to make spent shell casing fly out of the gun. There are other uses too, such as using constraints in a skin to move bones only for that skin, allowing you to change the proportions of your skeleton for a skin and reuse all your rigging and animations.

Does this correlate to the issue of not being able to import json files?

If you mean #1368 from the first post in this thread and importing JSON into Unity, see this post


you just need to use the skin-bones branch. If you mean importing the old, pre-3.8.12-beta JSON format into Spine, we haven't yet gotten to supporting that. We'll look at that tomorrow! Today we wrapped mesh tracing, which is automatic generation of a mesh hull and will be in 3.8.14-beta.

2 个月 后

I want to use skin constraints for different body types setup on single skeleton. So i need 3.8 for that. I have just updated spine runtimes to current 3.8-beta. Spine-Examples Skeletons work fine, but all my 3.6 skeletons will not be shown and throw the same error message:

Error reading skeleton JSON file for SkeletonData asset: skeleton_SkeletonData
Specified cast is not valid.
  at Spine.SkeletonJson.ReadSkeletonData (System.IO.TextReader reader) [0x00c7f] in C:\GameDev\lvichki\Assets\Spine\Runtime\spine-csharp\SkeletonJson.cs:275

and the code that throws error is actually this (second LoC throws exception):

if (root.ContainsKey("skins")) {
   foreach (Dictionary<string, object> skinMap in (List<object>)root["skins"]) { 
      Skin skin = new Skin((string)skinMap["name"]);

Can i somehow make my 3.6 skeletons work with 3.8 without reexport all spine animations from 3.8 manually?
If not, may be i can somehow use skin contraints with 3.7 runtime?

upd: Ach, probably a list was replaced by map. Will be old skins format supported in 3.8?

old format

"skins": {
   "default": {
      "body": {
         "body": {
            "type": "mesh",

new format

"skins": [
   {
      "name": "default",
      "attachments": {

You'll need to export your Spine project(s) using 3.8. If you have many, you can do this from the command line.

6 天 后
Nate :

You'll need to export your Spine project(s) using 3.8. If you have many, you can do this from the command line.

Is there any diff between skeleton from 3.7 to 3.8? If so, is there any way to support older skeleton json file?

There is a difference. You need to export with 3.8 to use the 3.8 runtimes.