New 4.16 Sline IK fit rotations to existing keyframe animation.

Hello,

wondering if anyone else has played with this new feature yet and have figure out how best to get the splineIk’s solver solution rotations to match a keyframed skeleton mesh animation?
I’ll show you what I have found so far and please let me know if you have suggestions.

Basic description is that I am taking the socket transform from the KF animation and using that for the splineIk’s end point transform.

Here is the Blueprint hierarchy,
splineIk_hier.png

This is what the Pawn Blueprint does,
splineIk_hier.png

I have two animation blueprints, one for the animation I want to match, and one for the ‘hero’ mesh that I apply the spline Ik to. (this will later change to using some baked out leaf joints in the animation clips).

Here is the keyframe mesh Animation Blueprint,
splineIk_kfAnBP.png

This then is the hero Animation Blueprint. I have tried to figure out what that offset I need to add is but no luck so far.

And this is the result when I play. The red mesh is the SplineIk driven mesh.
splineIk_double.png

The mismatch is because I get double transforms, there’s resulting rotation both from the angle of the curve and from the rotational values passed with the transform.
I of course want a match. If I try to just derive the rotation from the curve itself using the locations of the points I get no yaw rotation match, ie no rotation around Z.

So my current solution to avoid the double transform but retain the yaw rotation is to disconnect the other rotations just using the yaw, and let the others come from the curve. Like this,

I then get this result,
splineIk_twistOnly.png

Better but I have yet to try this with my full character setup and different animations so if anyone can see that there is a better solution to this then please let me know!
Or if you can spot why I have to add that dodgy 90 deg rotational offset to get orientation alignment? I have tried to rotate the ‘offs’ node in the hierarchy but not yet found one that works.
(I could have gotten the above solution closer if I took more care about positioning the top end spline point, which I didn’t)

Cheers

I notice you are using the ‘world space’ transform for your socket retrieval. The transforms for the spline control points are in component space, so you may just have a discrepancy between the two.

Having taken a look at your sample project (thanks for providing that, by the way!), it looks to be an issue with your animation/skeleton setup.

Your root bone is rotated 90 degrees in Y (Pitch), so the world (and component) transform that ends up coming out of the GetSocketTransform call also has a 90 degree rotation in Y. Applying this to the spline IK transforms then gives the experienced (and expected) result, with a -90 degree Y correction necessary to remove this initial offset.

The fix required may vary according to your pipeline, but you should probably look to remove the rotation offset in your skeleton & animations. If not you are going to have to account for this offset somewhere in your system, at the actor or at the anim BP level.