Baking joint transforms for complicated rigs

Hey everyone, it’s my first time here and I have some questions about baking transforms when rigging.

I am using Blender to rig and animate a character which I will export as a COLLADA file for loading into my game engine. Currently Blender’s COLLADA exporter does not support IK constraints or other features, just basic joint transformations. So while I have a nice animation of the IK joint moving in Blender, it doesn’t export properly. Somehow I need to bake the constraint into the transformation for each joint.

One solution that I came across was selecting the bones and using the Bake Action command (with Frame Step = 1, Only Selected checked, Clear Constraints checked, and Pose selected). But this isn’t really what I want since this bakes the joints for EVERY frame, which is just too much data.

What I really want is a way to bake the joint transforms at every important frame. If the IK animation is at frames 0, 24, and 56, then I would like to bake the transforms at those frames and export just those keyframes in the COLLADA file. It would make sense to perform this operation right as I export for COLLADA.

Is there a plugin or script that anyone has come across that achieves this. Is there an alternative solution I have not considered? Should I try to write a script for this?

So I found out a temporary approach that solves this. For each joint that is affected by an IK constraint, use Bake Action where the start frame and end frame are time range of that particular motion, and the Frame Step is the length of that range. You would need to do this for all the keyed frames for that bone. The most important part is to make sure Clear Constraints is unchecked. Now it might look weird at first, so you need to disable the IK constraint for the bone (by pressing the eye icon in the bone constraints menu).

So this is a solution that works for the time being (I have a deadline coming up), but I’d really still like to know if there are any scripts that automate this process.

Here’s an idea, or a partial one - duplicate your rig in object mode so that it’s a completely separate rig, remove all the constraints and add copy rotation and/or copy location constraints that target the bones from the original rig. Now you should have a separate rig that mimics all the motion of the animated rig. Then on frames 0, 24, and 56 - the frames you mentioned - select all the bones in the duplicated rig and insert visual loc/rot keyframes. After your done copying all the actions and keyframing the duplicated rig, you can remove/disable all the copy loc/rot constraints, or even delete the original rig, and you’d be left with a fully FK rig that exactly matches the animation of the IK rig.

BTW, you mentioned that this is a complicated rig, but not how complicated. It would be a PITA to do this if you’re talking an 8 legged creature, but if it’s just a bi-ped, shouldn’t be too bad. If it’s very complex and you know python, you could code the generation of the duplicate rig. If the actions are complex/long, you could code the keying of the duplicate rig…

Just a couple of ideas…

Randy

Mm yes I like that idea a lot. My rig is actually not too complicated, by complex I simply meant more than just basic location/rotation transforms. Your system would work fine.