Playing multiple spine animations simultaneously on a particular skeleton

Hi there!

I need to play multiple spine animations simultaneously on a skeleton. The typical example is that I have a “running” animation for the legs of a spine skeleton, and a “shooting” animation for the arm bones. Spine runtimes use the notion of “tracks” to handle this, with higher number tracks overriding keys for lower tracks.

http://esotericsoftware.com/spine-using-runtimes#AnimationState
http://esotericsoftware.com/spine-unity-documentation#TRACKS

I didn’t found anything concerning tracks in defold’s spine API. Is this currently unsupported? (if so, are there plans to include it?)

I am not sure that splitting all my meshes would suffice (for example, into “leg” and “torso” submeshes), since I have override animations that apply to the whole skeleton. I am not big into generating “outer product” of combinations either (i.e.: running while shooting, jumping while shooting, etc).

Thanks!

Edit:
Actually, any sort of mixing would suffice http://esotericsoftware.com/spine-using-runtimes#Mixing-animations

1 Like

Good question. I have hardly worked with spine at all (shame on me!), but @Andreas_Jirenius and @Ragnar_Svensson are experts. Do you guys know the answer to this question?

Another use case that I used in another project was blending a “wounded” animation with a single key on top of the regular character animation, that made him look hunched and added a limp when moving. So, I think blending would be more important than “tracks” that override themselves.

I am actually not sure about tracks but I believe they are not supported in this runtime right now. Blending on the other hand is but that is only blend between two animations and not fully blend two (or more) animations over the whole period of time. More like a crossfade.

Yeah, I realized only crossfading works for now. Are there plans for belnding of simultaneous animation?

Sorry, not at the moment. Out of curiosity, what type of animations are you looking to blend?

Basically, all that I said in this question:

  1. Animation on Legs (Running/Walking) + Animation on torso/Arms (Shooting with different weapons)

  2. Blending wounded pose with anything

That was sloppy of me not to read through the thread, sorry!
In may, we are planning to do a design of how animation should work in the more general sense, I think this should be included there. Basically, we already run spine animations like ordinary 3d anims, and the only reason we didn’t went into simultaneous tracks was to simplify the (spine) API. As you might understand, we are indeed running multiple tracks on the inside to do the cross fades.

Sounds good. I know that compromises have to be made when designing an API. I’ll stay tuned for the news!

Hi.

It’s been nine monthes sinse last post here, but spine API has no support of tracks yet. So what’s a result of planning?

I also hit this problem this weekend. During global game jam 2017 I created a game about snake and I needed the way to animate snake rotations in several directions at once. I wanted to make several animations of rotating each part of snake and combine them with tracks. I had to make a tilemap for snake and replace tiles in it to make it move, but it doesn’t provide smooth enought animation as a result.

No progress has been made on this issue as far as I can tell. I’ll talk to the rest of the team when they come into the office and make sure this gets assigned a proper ticket in our system. I’ll get back to you.

There has been some underlying work when 3D animation was added but there is still ways to go.

For your use case it sounds like code driven animation would work. Did you consider that?

Yes, code driven animation would work, but it needs to make several frames for each part of image and to swap in with code. It’s too much work to do for proper animation. It’s not for a 48 hours jam.

What I mean is not to pre-render animation frames but to actually move and rotate the snake body parts with code, just like the skeleton animation system does.

If you take a look at my animation in Bleach, it’s basically 4 spine animations built on top of each other to allow firing while running, jumping, falling, I just simply enable and disable them at the right time. Didn’t take long to do, not sure it would help for 48 hour jam, but I’m working solo, in a team it could be quick.

1 Like

I tried to use code like this, but it does nothing in fact:

local bone_name, angle
for bone_name, angle in ipairs(self.bones_angles) do
    local bone_id = model.get_go('#spinemodel', bone_name)
    go.set_rotation(vmath.quat_rotation_z(angle), bone_id)
end

I looked for a way to do this on documentation and forum, but find only phrase “Defold only supports pre-baked spine animations.”

Well, you cannot manipulate spine models like that. However, you can build your snake out of game objects that you manipulate in code.

My snake was 6 segments long. Each segment can move forward, turn left or right. It makes 36 = 729 combinations of animations. It can’t be pre-created.

Nice idea. I’ll try it later.

But it’s just workaround. I think that tracks support will be a right way for it.

Yea, I meant to say, the spine models are all inside a game object so you can manipulate the game object, which in turn manipulates the spine model, also this is the way forward to alter particle directions

1 Like