Download

Use Two Bone IK with an Animation (additive)?

Hello,

id like to know how to use Two Bone IK with an Animation that the animation still runs for example at the effector location of the Two Bone IK.

Usually any IK overrides the animation by being implemented at the end of the sequence - near the final pose result.

To get an animation to work - like walking/running for instance, you have to create a curve that details when the foot is affected by the IK and when it is not, and use that as the Alpha value that is fed to the IK node.

Hope that makes sense.

Not entirely this case, but.
Maybe this approach is not perfect, and doesn’t work under some conditions, as I didn’t fully test it yet, requires a bit of additional calculations and potentially lowers performance, but I feel like sharing it.


Here is what I ended up using to add IK-controled bone rotations (locations/scale) as delta to existing animations, and not just have an IK almost entirely override them from animation.
Cached pose “PreAdditiveIK_Pose” is a saved (NewSaveCachedPose) pose after all animations and bone modifications.
I take a reference pose, use BlendBoneByChannel to move all of the IK root bones (if there are multiple IKs that you want to use as “additive”) to transforms that they have after animations (so that IK starts from there, and not from where the root bone is located in reference pose - it may result in it pointing to a different direction), then save it to a RefPoseWithCorrectIKRootBoneTransforms.
Then I apply the IK (CCDIK in my case) to this saved pose. It still “straightens” the IK bone chain from the pose that it had in reference pose, and remembers it as delta to apply to current animations afterwards, so I correct it a bit with Transform(Modify)Bone nodes (if your IK bone chain is perfectly straight in reference pose, you won’t have this problem, I guess).
Add any other IKs after that, just like that. Like my second CCDIK here.
Then I calculate a PoseWithIK - PoseWithoutIK delta, using MakeDynamicAdditive node, and then apply it to saved pose with all the animations and bone modifications applied.
It seems to work… for now at least :slight_smile: