calebc01

I'm using the Unity Runtime to animate a Spine character, and I have to say it is *awesome.

To help mix animations, I'd like the ability to selectively turn off keyframes for specific bones programmatically. For example, my character has a "throw" animation and a "run" animation. When my character is idle, the throw animation incorporates small leg movements that improve the general feel of the animation, but I'd like to disable those leg key frames in-game when the character is running, since it interferes with running movement.

I *could have two throw animations in Spine, where one simply removes the leg keyframes. But from a workflow perspective, that is kind of a pain. It would be super nice if I could easily disable those keyframes using the Spine-Unity Runtime.

Absent native support for that feature, I imagine it couldn't be too hard to implement by modifying the runtime or the JSON objects it uses. But before I dive into that rabbit hole, I'd like to ping the community to see if there is an easy way to make it happen.

Thanks!
Kullanıcı avatarı
calebc01
  • Mesajlar: 3

clandestine

You can probably accomplish this with Tracks: http://esotericsoftware.com/spine-using-runtimes#AnimationState

They let you specify the layering order of different animations if you want one to take priority over another.
Kullanıcı avatarı
clandestine
  • Mesajlar: 48

calebc01

Cool, thanks!

It isn't clear from the documentation what happens when you have multiple animations with competing requirements running in different tracks. Clearly, multiple animations applied on the same track are mixed. But does an animation on a higher level track take precedence over animations on a lower track? Or vice-versa? Does one track overwrite keyframes on the other, or are they mixed?
Kullanıcı avatarı
calebc01
  • Mesajlar: 3

clandestine

I believe higher-index tracks overwrite keyframes, and there may be an alpha / mix option as well if you want subtle layering. Like with all animations, this will only modify those bones that actually have frames set in the particular animation.
Kullanıcı avatarı
clandestine
  • Mesajlar: 48


Dön Unity