• Bugs
  • Using SkeletonGraphic get error when generate single submesh

I use SkeletonGraphic in my UI on 3.7.
After I upgraded to 3.8, I got an error.

1.
In SkeletonGraphic.cs, it called

public void LateUpdate () {
   if (freeze) return;
   //this.SetVerticesDirty(); // Which is better?
   UpdateMesh();
}

2.
In SkeletonGraphic.cs, it called

MeshGenerator.GenerateSingleSubmeshInstruction(currentInstructions, skeleton, null);

3.
In MeshGenerator.cs, it called

current.material = (Material)((AtlasRegion)rendererObject).page.rendererObject;

And I got a error

[Exception] NullReferenceException: Object reference not set to an instance of an object

I tracked the code, it showed rendererObject is null.
Is this a bug??

Related Discussions
...

I'm afraid this is not enough information. We need to be able to reproduce the NullReferenceException. Could you send us a small example that demonstrates the issue?

I can reproduce the issue using our repro, thanks! The part of the code that errors does so because it can not find an attachment for the slot 3_GetBrokenCard_EFF03 in the TEST_Empty skeleton.

https://marioslab.io/uploads/screenshots/DFp21OMbF0.png

The TEST_Error skeleton doesn't seem to have that problem. I couldn't figure out why TEST_Empty errors yet, I'll get back to you once we know what's going on.

Ah, found it. The Empty animation has an attachment key in the first frame

https://marioslab.io/uploads/screenshots/hicUJf0GY6.png

In the setup pose, the attachment isn't set on the slot. MeshGenerator doesn't take the possibility that not a single attachment is set into account. It shouldn't add an instruction in that case, as there's nothing to render.

I've created an issue for this here: https://github.com/EsotericSoftware/spine-runtimes/issues/1491

Thanks for reporting!

If you fix this issue, would that fix the problem that the empty object should show nothing?

Jupp, that should fix that as well.

11 giorni dopo

This issue has now been fixed. You can download updated unitypackages here as usual:
Spine Unity Download

Thanks for reporting!