EsotericSoftware/spine-runtimes

[godot] Crash in SpineSlotNode if SpineSprite parent does not have skeleton data set

Closed this issue ยท 5 comments

  • Create a new scene in the editor in Spine-Godot 4.2.1.stable.mono on macOS Sonoma 14.0.
  • Set a SpineSprite to the root node of the scene.
  • Add a child SpineSlotNode.
  • The Godot editor hangs for several seconds, then crashes to desktop.
  • Creating a new scene with a SpineSlotNode root node doesn't cause the same behavior, and only yields the warning "SpineSlotNode.cpp:80 - SpineSlotNode parent is not a SpineSprite."
  • Furthermore, after the crash, the entire scene was found to be deleted after re-opening the editor. This is in spite of saving the scene before triggering the crash.
  • I was attempting to resolve the warning by making a SpineSprite the root node, instead of the SpineSlotNode, but it crashes the editor every time.

I see that 4.2.2 has been released, I will re-test with that and report back.

Still crashing in 4.2.2.stable.mono, unfortunately.

Thank you for reporting! I have confirmed that I can reproduce the problem on my macOS PC. As you mentioned, this also occurs with Godot 4.2.2 (non-mono).

Regarding the second step (Set a SpineSprite to the root node of the scene) in the instructions, whether it is the root node or not is actually irrelevant. This problem can be reproduced even if the SpineSprite is not the root node.
The problem seems to be caused by the fact that the SkeletonDataResource referenced by the SpineSlotNode has not yet been set in the SpineSprite node, since the SpineSlotNode was created immediately after the SpineSprite node was created. So adding the step of setting the SkeletonDataResource in SpineSprite between Steps 2 and 3 solves this problem.

In any case, it would be ideal to be able to avoid this problem by issuing some kind of warning if the parent SpineSprite node does not have a SkeletonDataReference. We should address this issue.

Thank you for the investigation. For future reference: please always include any error logs or crash report logs that you get. This will help us further pinpoint the issue in the code.

@badlogic Is that Mario?! We meet again. ๐Ÿ™ƒ Used to contribute to LibGDX back in the day as โ€œ3xp0n3ntโ€. Has it really been a decade? Anyway, thanks for the quick fix!