Exporting IKs and Constraints from Blender
UPDATE:
I wrote a Blender addon to automate the conversion of FK to IK, so use that instead of the tedious steps in this post!
Exporting your rigged and animated 3d models from Blender to another file format can be a mini nightmare your first time around. There are a bunch of gotchas that can take hours of googling to piece together a solution to.
One of those gotchas is that you can’t export bones that have inverse kinematics and constraints to most other file formats and engines. They don’t support them.
Let’s talk about how to get around this.
Quick Background
The main idea is to start with your model that uses inverse kinematics and constraints and turn it into a model with identical poses, but without any ik’s or constraints. We’ll effectively be mimicking our inverse kinematic movements onto forward kinematic bones.
After replicating our poses we’ll add visual keys for our bones, delete all of the constraints and inverse kinematic bones, and then end up with an unconstrained model that can be exported as normal.
You’ll be modifying your model and deleting some of your bones, so it’s best to start from a fresh copy of your file.
Creating non-constrained bones
We’ll first want to duplicate all of our constrained bones. It’s important to duplicate any bones that are in the IK chain, not just the first bone in the chain. Otherwise you won’t properly bake your IKs effects into your forward kinematic bones.
Selected our legs, feet and toes
Now remove all of the bone constraints from your original, deformation bones (the bones that you duplicated).
If any of your deformation bones have control bones as parents, remove those parent relationships as well. We’re completely disassociating our deformation bones from our constrained duplicates.
Now that our deformation bones no longer have constraints our model should look all out of whack when viewed in pose mode.
Deformation bones no longer in the proper pose. Time to fix this
Copying our IK & Constraint Transforms
Alright now that we have non constrained deformation bones and a separate set of constraint and IK bones (our duplicates), let’s force our deformation bones to mimic the motions of our constrained duplicates.
Go into Pose mode and add a bone constraint to each of your original deformation bones to copy the transforms of their duplicated counterpart. This is a temporary constraint that we’ll later remove before exporting our model.
Your model should now look correct in pose mode.
Inserting Visual Keyframes
Go ahead and insert visual location and rotation keyframes for all of your bones.
Now delete all of your duplicate joints, control joints and IK joints, remove all of your copy transform constraints, and then verify that your animation still works.
If everything checks out you can now export your model.
Avoiding interpolation artifacts
Keep in mind that Blender’s IK interpolation might not match the resulting FK interpolation after you insert your visual keyframes and delete your control joints. If this happens you’ll want to start over and add more keyframes in between the problematic keyframe range(s) before you remove your copy transforms and delete your control joints.
Catch ya later,
- CFN