• EditorBugs
  • Error reading skeleton JSON file for SkeletonData Unity asset

Hello Spine Team!

Unity 2021.3.1f1
Spine Editor 4.1.24
Spine-Unity Runtime: spine-unity-4.1-2023-01-11.unitypackage
Skeleton source and exported version:

There is a problem with a skeleton importing. When I click SkeletonData of the imported skeleton to display it in the Inspector tab in Unity, the error pops up in console:

Error reading skeleton JSON file for SkeletonData asset: Headhunter_SkeletonData
Error reading attachment: Idle_fx-B_01, skin: default
  at Spine.SkeletonJson.ReadSkeletonData (System.IO.TextReader reader) [0x01056] in *ROOT*\Assets\Spine\Runtime\spine-csharp\SkeletonJson.cs:322 
  at Spine.Unity.SkeletonDataAsset.ReadSkeletonData (System.String text, Spine.AttachmentLoader attachmentLoader, System.Single scale) [0x00017] in *ROOT*\Assets\Spine\Runtime\spine-unity\Asset Types\SkeletonDataAsset.cs:281 
  at Spine.Unity.SkeletonDataAsset.GetSkeletonData (System.Boolean quiet) [0x000d5] in *ROOT*\Assets\Spine\Runtime\spine-unity\Asset Types\SkeletonDataAsset.cs:180 
UnityEngine.Debug:LogError (object,UnityEngine.Object)
Spine.Unity.SkeletonDataAsset:GetSkeletonData (bool) (at Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataAsset.cs:183)
Spine.Unity.Editor.SkeletonInspectorPreview:Initialize (System.Action,Spine.Unity.SkeletonDataAsset,string) (at Assets/Spine/Editor/spine-unity/Editor/Asset Types/SkeletonDataAssetInspector.cs:833)
Spine.Unity.Editor.SkeletonDataAssetInspector:OnInspectorGUI () (at Assets/Spine/Editor/spine-unity/Editor/Asset Types/SkeletonDataAssetInspector.cs:209)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

Is there a way to fix it without disabling the Idle_fx-B_01 attachment completely? I've also noticed there was a similar problem to mine here just in case: https://esotericsoftware.com/forum/d/11629-error-reading-skeleton-json-file-for-skeletondata-asset

Thank you in advance.

Best Regards,
Igor

  • Misaki ha risposto a questo messaggio

    IGR Hmmm, I have not been able to reproduce the error when importing the skeleton files you attached. The latest version of the spine-unity runtime is spine-unity-4.1-2024-02-26. Could you update to it and see if the bug is fixed?

    • IGR ha risposto a questo messaggio

      Misaki Hmm, I imported new spine spine-unity-4.1-2024-02-26 and tested it with that skeleton. The issue remains. I've also created an empty Unity project and checked it there, the result is the same. Have you tested it in Unity 2021.3.1f1?

      • Misaki ha risposto a questo messaggio

        IGR Thank you for trying the latest spine-unity package and I apologize for missing the steps in your description. I don't get an error when importing, but when I select SkeletonDataAsset, I get an error as you described. We will investigate this issue.

        IGR I found the cause! The sequence attachment that causes this error has the wrong end frame number. This frame-by-frame VFX starts at 01 and ends at 23, but because 24 is set as the end frame number, the last frame cannot be referenced, resulting in an error. Try correcting the end frame number to 23 and exporting the skeleton again to see if that solves the problem.

        • IGR ha risposto a questo messaggio

          Misaki Oh, thank you for your quick answer, it worked! Although It seems there are 24 frames in VFX, not 23. Where did you find that there're just 23?

          • Misaki ha risposto a questo messaggio

            IGR Ah, I do indeed see 24 images in the images folder in the zip containing the Spine project you shared with us.

            I checked your skeleton by unpacking the packed textures (Headhunter.png) and importing the exported skeleton data (Headhunter.json) into Spine.
            The last frame Idle_fx-B_24.png is a blank image, but it seems you have enabled Ignore blank images in the texture packer settings, so it was ignored when packing the texture atlas. If you want to continue to use blank images, you should disable this option:

            • IGR ha risposto a questo messaggio

              Misaki A-ha, got it, thank you for your detailed explanation! No questions left, problem solved 🙂