• Editor
  • Need help understanding slots/attachments/skins

It's not clear to me from the documentation the distinction between slots/attachments/skins. It seems that they serve similar functions - letting you swap out images without affecting the animation.

Here's what I understand:

Slots: Bones do not have images directly attached to them. Instead you attach SLOTS to bones, and then put images in the slot. A bone can have MANY slots attached, and a slot can have MANY images inside of it, but only ONE image in a given slot can be visible at a time.

Attachments: Is this just another name for slots with images in them representing "attachments"?

Skins: I see in Spine where I can toggle between skins, and it seems that by doing so, I can swap out large groups of images in slots at a time.

So what is the difference between these? Can I keyframe these changes in an animation? In code, can I swap them out?

Here's my use-case: I have a character with interchangable parts for the face - think of the Mr. Potato-Head toy for kids. I have several sets of eyes, several mouths, etc. At runtime, I would like to generate a random combination of these. Which would be the best option for me to use? Skins built at runtime? Slots set up at runtime?

Thanks!

Related Discussions
...

Slots are there so you can have multiple images on a bone (using multiple slots) and be able to use a different draw order for them.

Skin Attachments are "placeholders" for your skin images, if you place an image on a Skin Attachment with a specific skin visible, that image will only be visible with that Skin active.

Here's a simple use case for a skin. Lets say you have eyes blinking on a character (similar to the goblin example). You place an image with eyes closed on your eyes attachment and key that attachment where you want it to be visible, then a few frames further in you key it to be hidden. Now you have another skin with your character looking different, but you also have a blink animation for that. You would not be able to re-use the blink animation on that character without skins. You would need another slot with another image, and you would need to create a new animation so you could get rid of the keys on the blink you made for the first skin.
Take a closer look at the goblin example to see how it can be used.

For your example it's better to place a slot for each interchangeable part and then switch them at runtime. We might make it possible in the future to mix between different skin sets so you would be able to do something similar to what I explained before with having keys on your attachments and also be able to mix your skins.

Thanks for the reply, Shiu!

So if I understand correctly, Slots are altogether different things than Skins, and "Attachments" are really just one component of the Skinning system? In other words, of the three (Slots, Skins, Attachments), there are really only TWO things we're talking about ("Slots" and "Skins with Skin Attachments")?

So "Attachments" are sort of like to "Skins" what "Slots" are to "Bones"? I.e. both are just a spot to hold an image?

Thanks so much for taking the time to answer. :-)