I'm wondering if Spine has a way to apply the same body animation to a set of different textures, like a character who changes outfits but keeps the same base animation. Right now my animator is remaking the animation for every outfit, and duplicating common assets that I feel could be shared across all the different outfit textures. There are hair pieces, body parts, and facial expressions that show up in every outfit texture. This seems wasteful, and there's also a ton of blank space in the textures for some reason? The filesize is huge because it's animating the whole thing each time.

Basically, my question is "is there a way to share a skeleton animation & texture assets across different outfit animations?"

Surely there are games that use Spine in a way that I'm trying to, like an RPG character who has battle animations but changes their armor/clothing items. Any help would be greatly appreciated!! Thank you
  • Posts: 2


If you want to reuse the same body parts for different outfits, you can use Skins. You can combine multiple skins, for example, you can apply body, hat, dress, and shoes skins to the skeleton at the same time. Not only attachments but also bones and constraints can be added to a skin so that the bones and constraints are only active when that skin is active. For example, you can add bones for a skirt to a skirt skin so that the bones will be only available when the skirt skin is active. This allows you to add animations for skin-specific parts while reusing animations for common body parts. For more information about skins, please see the Spine User Guide:
Skins - Spine User Guide

Also, checking the mix-and-match example Spine project with the following page would be helpful to understand how to use skins:
Mix and Match example

Regarding the textures, you can pack texture atlas pages grouped by folder:
Texture packing - Spine User Guide: Folder structure
This means you can separate folders for each skin and pack a texture page with only common parts, or each outfit. However, if you have many parts to combine, you may end up calling for many texture atlas pages to get a particular look, which may increase draw calls, so packing textures for the combinations you need may not be a bad idea, even if the same body parts will be used many times on different texture pages. Which is better depends on whether you want to prioritize reducing draw calls or reducing the size of textures. If you use the spine-unity runtime, you can repack textures at runtime to combine body parts and outfits used in the current skin into a single texture atlas page so that reduce draw calls. However, this may not be a good idea if you need to change skins frequently, as it will come with an overhead every time you repack.

Regarding the blank space of the textures, I guess your animator uses Polygons of the Pack option. Unfortunately, using Polygons may cause lots of blank space in the exported texture. If you can see a lot of blank space in the exported texture, please reduce the maximum height and width and pack it again. Also, if Power of two or Divisible by 4 and Square are enabled at the same time, the textures will always be packed to meet these conditions, even if they generate a lot of blank space, so you may disable them if they are not needed for your project.

If you have any further questions, do not hesitate to ask!
User avatar

  • Posts: 1164

Return to Editor