• Editor
  • Question about skins and animation export

Related Discussions
...

Hello
Until now, I had never used the" power of the skins".
Today it's done, thanks to tutorials and patience 😉

However, one question remains confusing to me :
(I specify that I absolutely don't use Unity myself. I only draw , animate then export my animations (Binary). My job stops here.)
Is it possible to export animations with a specific skin, and only this one? Like "link" a single skin to a single animation.
For example , I have 2 skins "angry" and "happy" and two animations "anim_angry" and "anim_happy".
As you can guess, I'd like to use skin_happy in anim_happy only. But if I select anim_angry, skin_happy still visible and vice versa...

So my (stupid?) question is : when I export my 2 animations (Binary) how can I be sure that the good skin is in the good anim?

What will the guy importing my animations into unity see by default? :think:
Thank you to enlighten me (I'm in the dark...)

When you play an animation, it doesn't know about skins. If you key attachment visibility, you are either keying 1) the visibility for an attachment not in a skin, or 2) you are keying the visibility of a skin placeholder. When an animation shows a skin placeholder, which attachment is actually shown depends on the skeleton skin. There is no way when you play a "happy" or "angry" animation to automatically change the skin. Your code at runtime that sets the animation should also set the skin.

At runtime the skeleton has two skins: 1) the "default" skin, which holds attachments that are not in a skin in the editor, and 2) the skeleton skin, or none. You don't normally change the default skin, but you may want to set (or clear) the skeleton skin. When an animation shows an attachment, it looks for it first in the skeleton skin, if any, then in the default skin.

While there is only one skeleton skin, you can easily add a bunch of skins to a single skin (using code at runtime). That is how you get the same functionality shown in the Skins view in the Spine editor. If you want to show multiple skins, create a new, empty skin and add the other skins to it.

You can run Spine with `


svor


skeleton-viewer` from the command line to start the Skeleton Viewer (you will need the latest launcher and 4.1+ version). That may give you a better idea of how things work at runtime. Click an animation plays it. There is no skeleton skin by default. Clicking a skin sets it as the skeleton skin. The Skeleton Viewer can't currently combine skins.

OK, thank you Nate.
To summarize : to choose which skins is active in animations at runtimes, code is essential.
Clear.