• Runtimes
  • Root Motion and Animation Blending

Hi guys,

I've implemented Root Motion (https://docs.unrealengine.com/latest/INT/Engine/Animation/RootMotion/index.html) into my XNA engine and it works really well apart from one issue, which is why I'm posting here.

So far, each update frame, my engine will take the movement applied to the skeleton root bone and apply it to my character object instead and reset the skeleton root bone to zero. It keeps track of where the root bone would normally be so it only applies changes between the last frame and the current frame to the character object.

The root motion can be toggled on and off, so only certain animations will make use of this. Going from an animation with root motion to an animation without root motion works beautifully. However, going between root motion animations causes one major issue as I'm also using animation blending to smooth the transitions out, so it is applying a blend of the root bone positions whereas I'm only concerned with the root bone position from the new current animation. :shake:

What I want to do is once an animation blend is happening, completely ignore the root bone for the previous animation, but blend all the other skeleton bones as usual.

My solution is to include a flag on the AnimationState so that ignores Root Bones when calculating the blending. I'm wondering if there are any other solutions or something I'm missing that would help?

Related Discussions
...
  • 編集済み

.... Are you in our office? We literally just discussed this and I came onto the forum to make this post.

and quite frankly its a real ball ache.

The problem lies that the animation blends between the transforms of the two(+) animations, not the animation and the world transforms of the skeleton.
Merely turning off blending for rootmotion anims doesn't work as if you play say: run -> idle -> run, but idle anim is played < the blend time, it will blend between run and run, as it thinks its blending on idle.

please someone?

Good to know I'm not the only one who stumbled across this! It's a shame because it works so well apart from this issue.

x35mm wrote

Good to know I'm not the only one who stumbled across this! It's a shame because it works so well apart from this issue.

We pretty much kindof figured this stuff just isn't supported by spine. Even Glorious Mitch (.... :angry: ) gave up on this stuff, interestingly he mentioned about making a new timeline, which I guess would do what you suggested at the end of your post (cut out blending on the root).

interestingly adding:

if(self->boneIndex == 0)  alpha = 1;

to _spTranslateTimeline_apply in Animation.c works (hooray)

There doesn't seem to be a solution which doesn't involve editing/overriding spine runtimes

Oh cool, I'll give that a try with the xna c/sharp runtime - you've definitely helped save me some time so very much appreciated! =)

This isn't really a solution. Solution will only come when Nate implements this into the runtime 🙂

I can confirm it works on the xna/c-sharp runtime too. :love:

I've already had to make a few modifications to the runtime so one-more won't hurt for now!

Just wanted to throw my hat into the ring - a shared, supported root motion solution that deals with these issues would be super valuable. Maybe that's something we can put together as a patch for the runtimes?

I agree, I think mitch tried to create a root motion time line for unity, but the root motion stuff got put to one side (abandoned?)

BinaryCats wrote

I agree, I think mitch tried to create a root motion time line for unity, but the root motion stuff got put to one side (abandoned?)

Felt it wasn't as useful for 2D anims... Didn't need it for my project anymore so didn't make it heh. 90% of my spine unity stuff has been because I needed it anyway

9日 後

Hey man, could you share your root motion coding?

Mitch wrote

not useful? We found the movement was much more fluid, however more annoying to adjust (as it has to be sent from animator to developer). We found The only time it isn't usful is moving in the Z axis

decoamorim wrote

nope. but the basics are on this post you have already commented on
Applying Root Motion

Yep! I was busy working in the project concept. But ill work on it soon.