• Unity
  • Export Specific Slot as Custom Material

Hey gang !

Is there a way to export specific skeleton slots as a separate material ?? :nerd:

I think that slots set to "Additive/Multiply/Screen" blend modes get exported as a separate material in Unity.

I know that we can override materials and stuff but I feel like an option to have a "template" blend mode accessible just to create separate materials on export would be pretty awesome for customization in Unity !
As a workaround I think I'll use "multiply" for now (because I don't think I ever use it at the moment) but a custom one just for the sake of exporting would be fire 😉

Related Discussions
...
RemDust a écrit

Is there a way to export specific skeleton slots as a separate material ?? :nerd:

Technically the Spine Editor does not export materials but it exports atlas page textures. For each atlas page texture, and for each blend mode of this texture, a material is created. By default, I see no way to achieve what you want without writing custom code.

However, you could write your own AssetPostprocessor subclass that overwrites OnPostprocessAllAssets like SpineEditorUtilities. There you could atuomatically process e.g. any generated SkeletonDataAsset assets accordingly, go through all slots of the skeleton and generate additional materials when the slot name ends in your custom suffix like e.g. -Glow and create your own material for it (likely copying the original material and changing the shader and material parameters accordingly).

    16 jours plus tard

    Hey Harald
    Sorry for the very late reply and thanks for your input !

    As a poor coder, I think I'd be more comfortable playing around with the texture packer in the editor ^^
    If I can manage to export all the wanted attachments in the same atlas page texture, I'm good to go for easy material settings in Unity.

    I could try to export my skeletons and atlases as subfolder structure, what you think ?