• RuntimesUnity
  • Skeleton Graphic UI - canvas renderer warning and material slots not showing

I'm encountering an issue with the Spine SkeletonGraphic UI in Unity. 

I’m writing an automated importer that brings in all the necessary Spine files (atlas, png, and skel). The importer then clones a prefab and assigns the skeleton data to the SkeletonGraphic component in that prefab.

Typically, when working with skeleton files that use multiple textures or blending modes, I expect to see a warning about enabling 'Advanced - Multiple CanvasRenderers' to generate the necessary CanvasRenderer GameObjects.

However, when I run the importer—which imports all the necessary Spine files (atlas, png, and skel), clones a prefab, and assigns the skeleton data to the SkeletonGraphic component in the prefab—I'm not seeing the usual warning.

 Additionally, I'm not getting the expected empty material slots when the 'Multiple CanvasRenderers' checkbox is enabled.

I've tried both manual and automated methods of importing the files, but the issue persists. Any ideas on what might be causing this? 

expected result,

Related Discussions
...

The issue with multiple CanvasRenderers warning and checkbox occurs even when I manually drag in the Spine files. Curious if there is a SpineData utility or importer class that I am missing in the documentation.
It looks like when I manually import, then re-assign materials again (even one of them), the canvas renderer box can be enabled then,
Essentially, at least for automated import I need a way to refresh SpineData ? Hopefully that makes sense.

@Nay In general if you want to recreate behaviour of Spine scripts it's recommended to mirror the respective code in your own scripts as much as possible. You can always have a look at the provided source code or step through it using a debugger and see what happens normally during the standard import procedure, or when placing an instance in a scene.

From your description I'm not quite sure what your automated importer script actually does and what it might be missing without seeing any code. Likely some relevant code is not executed or executed in the wrong order due to the way you hook things up.

Additionally, I'm not getting the expected empty material slots when the 'Multiple CanvasRenderers' checkbox is enabled.


The Blend Mode Materials section is only displayed when skeletonDataAsset.blendModeMaterials.RequiresBlendModeMaterials is true (see the inspector code here). For this skeletonDataAsset.blendModeMaterials.UpdateBlendmodeMaterialsRequiredState(skeletonData) needs to be called (e.g. like here). This is normally done during the import procedure here.

I see, thank you this is helping it looks like.