• RuntimesUnity
  • Exporting different skins as separate atlases

Hello everyone, and sorry if this topic has been already answered, I can't seem to be able to recreate the solutions of other suggestions I've previously found.

I have animated a character and set up different skins correctly. In my source path for images I've set it up so each character has its own folder. During most of the animations all skins also use images that are common for every skin. These commonly used images are also in their own separate folder.

I want to export each skin to its own atlas (that also includes the "common images" to a separate atlas as well). Is there a way for this to work in unity? I've tried texture packing each folder, and then exporting the whole project from the JSON export menu and giving only the json file from that export in combination with the exports from texture packer but that didn't work. I'm sure I'm doing something wrong.

Ultimately we wanna have multiple skins with multiple animations and be able to update everything only in one spine file if we wanna make changes. Would that be possible?

Thanks in advance for your help
Spine version: 4.0.64 pro

Related Discussions
...

Currently, Spine does not have a built-in feature to automatically export each skin to its own atlas. However, you can achieve this by organizing your images into folders and using the Texture Packer to pack each folder separately. Here's a suggested workflow:

  1. Organize Images: Place the images for each skin in separate folders, and have a folder for common images used by all skins.

  2. Texture Packing: Use the Texture Packer to pack each skin's folder into its own atlas. You can do this by selecting the folder for each skin and packing it separately. Ensure that the common images are included in each skin's atlas.

  3. Custom AttachmentLoader: In Unity, you can modify the AtlasAttachmentLoader to load the correct atlas for each skin. This involves resolving attachment names and paths to the appropriate atlas texture region.

  4. Script Automation: Consider writing a script to automate the process of copying images to temporary folders and packing them. This can help manage updates and changes efficiently.

  5. Unity Integration: When integrating with Unity, ensure that your custom loader is correctly set up to handle the different atlases for each skin.

By following these steps, you can maintain a single Spine project while managing multiple skins and their respective atlases in Unity.

Erika you mean with the custom "AtlasAttachmentLoader" right?
Well I have to coordinate with the developer for this, because I'm not importing the assets myself in Unity only doing the spine part 🙂. But thanks I'll look into it

Erika I was also thinking, Is there perhaps a script that could deactivate all skins but one each time for each export? So that way from the same spine file I can export multiple different skins, each time only one. Would the fact that all would share the same skeleton name affect them later in Unity?

The main goal of a skin is to reuse the same skeleton and animations with new assets, so because of this there woudn't be a need to avoid exporting all other skins in a json.
What is inside a skin is also only affecting performance when said skin is active at runtime. Is there a specific reason for you to request this?

  • Nate が「いいね」しました。

@Kner You should not need a custom AtlasAttachmentLoader.

If you need to export separate folders as separate atlases and use them at a single skeleton, the easiest way should be to assign the second (and subsequent) AtlasAssets at the SkeletonDataAsset under the Atlas section.

If it's an option with your use case, you could in general also pack by folder structure so that each skin is placed in its own atlas page (if it fits) but the same atlas. Note that a single atlas has multiple atlas page textures.