• Editor
  • How to animate an attachment inside a Skin?

  • Modifié

I want to use Skins to programatically change parts of the character (example, type of head, type of tail etc). But the problem is that I just found out that you cannot have more than one Attachment per "Skin placeholder". I'm using multiple Attachments to animate each body part.

For example, head01 has 6 different Attachments, which are 6 different frames of its animation (head01-frame01, head01-frame02 etc). Before using Skins I was just animating it by keying the visibility of each frame. This was working fine. But if I want to have head01 on one Skin and head02 on another Skin. Then I'll have to put each frame of head01 inside the Skin placeholder. But I cannot do that, because there can only be one frame per Skin. So I cannot animate the head if it belongs to a Skin.

One solution I can think of. Would be animating the head by creating a Slot for each frame, and animate the Slots instead of animating the Attachments. Then each attachment could have multiple Skins. But that sounds like an extremely hacky workaround. And it would look way too confusing and messy in the editor. Specially since there cannot be a hierarchy of Slots inside other Slots. So different parts of the head (eyes, eyelids, mouth, etc) would each 6 or so slots each all grouped together, each with multiple Skins inside.
[Edit: turns out this workaround doesn't work either because you cannot key the actual Slot, only the individual Attachments inside it]

Is there an obvious solution I'm missing here?

Related Discussions
...
  • Modifié

I'm not sure I understand exactly what you're looking for, it's a tad bit confusing.

However you can add multiple skin placeholders to the same slot and then key those. Is this not sufficient for what you want to do ?

Image supprimée en raison de l'absence de support de HTTPS. | Afficher quand même

I want to add more than 1 Attachment to 1 Skin. So I can change the type of head using the Skin, but keep the different types of heads animated.

I think the problem with your idea, is that I wouldn't be able to use Skins to change body parts then, right? I want to have different types of heads, which I will change in the runtime. Following the example in the official docs, if I want to be able to choose between either a dog head or a snake head. I could have a Skin called "doghead" and another called "snakehead", and swapping them would change the head. But what if the heads have multiple frames of animation? With your solution, each frame is a different Skin (frame1, frame2 etc). So I cannot use Skin to change the type of head. How would I do that?

Ah yes, I see now. Nate and I have talked about supporting multiple skins being visible at the same time. I don't know exactly how much work would need to be put in, to make this available. Nate ? 🙂

But is there some workaround I could do while it's not available yet?

I'm trying that idea I mentioned on the first post about keying the visibility of the slot, make one different slot per frame, with multiple skins inside each slot. But it turns out I cannot do that either, because I just found out I cannot key the visibility of the slot either. So I'm out of workarounds for now ^ ^

vib a écrit

if I want to be able to choose between either a dog head or a snake head. I could have a Skin called "doghead" and another called "snakehead", and swapping them would change the head. But what if the heads have multiple frames of animation?

Without skins you have:

slot: head
   region attachment: head1
   region attachment: head2
   region attachment: head3

With skins, you'd have for the "dog head" skin:

slot: head
   skin placeholder: head1
      region attachment: doghead1
   skin placeholder: head2
      region attachment: doghead2
   skin placeholder: head3
      region attachment: doghead3

For the "snake head" skin:

slot: head
   skin placeholder: head1
      region attachment: snakehead1
   skin placeholder: head2
      region attachment: snakehead2
   skin placeholder: head3
      region attachment: snakehead3

In animations you key the visibility of the skin placeholders for the slot "head". Which head images are actually shown depend on which skin is active.

With your solution, each frame is a different Skin (frame1, frame2 etc). So I cannot use Skin to change the type of head.

This doesn't make sense. You can have many skin placeholders. The active skin can define an attachment for each placeholder. Make sense?

Nate a écrit

You can have many skin placeholders. The active skin can define an attachment for each placeholder. Make sense?

Thanks a lot, I didn't realize that.

But just to clarify, that would be in the runtime, right? I would look up each attachment by name, and dynamically build the skin in code. But I wouldn't be able to do that on the editor, correct?

No, in the editor. Look at the goblin example. When you change the skin, all the skin placeholders change.

That helps a lot, thanks for the help.

For some reason I had it in my head that the Skin would only automatically change to placeholders that had the same name.

Nope, not at all. It changes all placeholders. The only thing you can't do in the editor is activate 2 skins at the same time. You might want to do this to have all your heads in one skin, and all your legs in another, etc.