- Edited
Keying skins for different animations
I got a rig with 5 animations, all the same motion, and decided to try using skins for the 5 visual variants rather than swapping attachments. I can't seem to give each animation a different skin though. There's no keyframe marker to denote which i want per animation, so when I change it, it just alters them all. Am I missing something, or is there a different point to skins and I should just be keyframing different attachments? Is this only intended for code driven changes?
From our documentation:
Skins allow all the bones and animations for a skeleton to be reused with a different set of attachments. This greatly reduces the effort needed for multiple characters that have similar bones and animations.
The real power of skins comes from the fact that when an animation shows an attachment, it is the skin placeholder that is keyed and not the specific attachment. The actual attachment shown is the attachment for that skin placeholder in the currently active skin. Without this, animations that show attachments could not be reused.
For example, the goblins skeleton needs to have an animation that makes it blink by showing an eyesClosed-male or eyesClosed-female attachment on top of the eyes. Without skins, two animations would be needed. When using skins, only a single animation is needed which shows the eyesClosed skin placeholder.
I recommend taking a read here: Skins - Spine User Guide: Skins
There's no keyframe marker to denote which i want per animation, so when I change it, it just alters them all. Am I missing something, or is there a different point to skins and I should just be keyframing different attachments? Is this only intended for code driven changes?
Skins are not meant to be attached to any specific animations. Changing which skin is active when you play back an animation seems fairly simple and quick, but maybe I misunderstand your use case?
Ah I get it now.
can we set bones to follow skins so that some bones will be hidden for unrelated skins? i could imagine it would be very messy when my character supports multiple hair styles in the next update.
Hello! thanks for the suggestion, we've created an issue here: Active skins to determine bones visibility · #460 · EsotericSoftware/spine-editor (I personally would use it a lot!)
Update: we've made quite a bit of progress for having skin-specifc bones and constraints. We hope to have it in 3.8-beta soon!
In this test using the goblin project, using the new Image removed due to the lack of support for HTTPS. | Show Anyway Image removed due to the lack of support for HTTPS. | Show Anyway Image removed due to the lack of support for HTTPS. | Show Anyway Image removed due to the lack of support for HTTPS. | Show AnywayAdd to Skin
button, the 3 spear bones are added to the goblingirl
skin along with a transform constraint that moves the head bone to the tip of the spear:
The right edge of the tree indicates the bones and constraints are in a skin:
It's pretty neat to have skins change more than just attachments!
There are a number of complexities with hiding bones using skins, such as what happens if a mesh that is not in a skin is bound to a bone that is hidden because it is in a skin (answer: that must be disallowed, which is tricky). The GIF above is actually incorrect, the spear bones should only be visible for the goblingirl
skin. This shows why it must be disallowed:
Bones that are in any skin are not updated when the active skin does not contain those bones.