• Bugs
  • Missing attachment on skin

Hi!

I'm writing because I think we've found a bug with skin exporting / importing to Unity.

At some point when our animator exported a character of ours, we noticed that her hair was missing an attachment in Unity.

In Spine 4.1.18 Pro

In Unity 2020.3.42f1 using Spine 4.1 runtime pulled from Git today:

Both are showing the same skin.

When pressing show Attachments in the inspector for the skeleton data, only the attachments up until the missing ones:

And this error is spammed in the console:

NullReferenceException: Object reference not set to an instance of an object
Spine.Unity.Editor.SkeletonDataAssetInspector.DrawSlotList () (at Library/PackageCache/com.esotericsoftware.spine.spine-unity@ca09a57c21/Editor/spine-unity/Editor/Asset Types/SkeletonDataAssetInspector.cs:567)
Spine.Unity.Editor.SkeletonDataAssetInspector.OnInspectorGUI () (at Library/PackageCache/com.esotericsoftware.spine.spine-unity@ca09a57c21/Editor/spine-unity/Editor/Asset Types/SkeletonDataAssetInspector.cs:230)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <bf2356d10abb4ac9a31a334d3389ec17>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

I can upload the Spine file if you can provide at private place to do so.

Thanks! :grinteeth:

  • Jonathan
Related Discussions
...
  • Изменено

We're sorry for the troubles! Please send us your reproduction assets to contact@esotericsoftware.com, briefly mentioning this forum thread URL so that we know the context.

Hi, I've just send the files over e-mail. They were quite large (20MB) so I hope that you get them.
Let me know if you haven't received the mail by tomorrow.

  • Jonathan

Thanks for sending the repro assets, we received everything. We will have a look at it and get back to you as soon as we've figured out what's going wrong.


The issue is that the non-displayed attachment Back_Hair_1 is attached at a slot at the bone Back_Hair_Mohawk which is a skin-bone of skin Hair Mohawk but not a skin-bone of skin Hair Down. As a result, the bone and any attachments of its slots are hidden when another skin is active. So the solution is to add the bone Back_Hair_Mohawk to the skin Hair Down as well (and perhaps rename the bone so that it's not misleading).

Hi Harald!

Thanks a lot for showing me how to fix our setup! 🙂

I still think it was weird that it just threw all of those exceptions in unity. It would be nice if the error could be detected on import / export.

  • Jonathan

I forgot to mention: we could not reproduce the error message part - no errors were issued when changing skins or showing and hiding attachments of your asset, neither in the SkeletonDataAsset Inspector view, nor in the scene. So if you could provide us with a minimal Unity project that still shows this error, we're happy to fix it.