0
$\begingroup$

I already have existing animations that do not use IK bones. Now, for some new animations, I want to use IK bones. I have added IK bones to the armature, but when I go back to the existing animations, the constrained bones are all messed up (I kinda expected) because they are following newly added unanimated IK bone.

Is there a way to go back into each animation and automatically move the IK bones into position to restore the original poses?

i.e. I would prefer if there is a way to take the rest pose, and the existing FK pose, then calculate the transform needed for the IK bones to deform the rest pose into the FK pose, then apply the transform to the IK bones.

For example, if I set the constraint influence to zero, the constrained bones will look correct, but I cannot do this for every action. Also, I am ultimately going to export it to FBX, and I don't know whether the influence animation will be respected.

$\endgroup$

1 Answer 1

1
$\begingroup$

To explain how classic rigs handle this problem, I assume that you want to export as FBX two animations: one done with FK and one done with IK.

In object mode select the rig and press Shift D to duplicate, then repeat to get three copies of the rig.

For clarity, rename the copies as "IK_rig" and "FK_rig", rename the original as "DEF_rig".

In both FK and IK rigs, uncheck the "Deform" option af all of its bones (hold Alt when clicking, to uncheck the option for all selected bones).

Assign the IK animation to the IK_rig. Assign the FK animation to the FK_rig, deleting its IK constraints and its IK control bones.

In the DEF_rig delete all IK constraints and IK control bones, and set the parenting with every child bone unconnected to its parent bone. Then in Pose mode add to every bone two "Copy Transform" bone constraints, targeting the corresponding bone, the upper to the FK_rig, the lower to the IK_rig.

Then choose a bone (in my example the thigh bone), add a custom property, use the gear button to rename it as "FK_IK", right click on its value and choose "Copy as new driver".

Go to the influence value of the lower Copy Transform Bone constraint (that is targeting the IK_rig), right click and choose "Paste Driver", repeat for every bone.

Now press Shift D again to make two new copies of the DEF_Rig: rename them as "IK_Export_rig" and "FK_Export_rig".

Select the IK_Export_rig, check that its custom property slider is set to 1.0: it should play the IK animation; select all bones in pose mode, go to menu > pose > animation > Bake action (clear constraints, visual keying).

This is the rig and the new IK animation you will want to export as FBX.

Repeat for FK_Export_rig, turning its FK_IK slider to 0.0.

The two newly created animations will be playable on the same Export_rig.

enter image description here

In classic rigs, all the three rigs (IK, FK, and DEF) are joined into a single rig, but even then you will have to perform the bake function in order to export as fbx, as Blender constraints are not directly exportable.

The FBX exporter has an option to automatically bake all DEF bones, but I made you do it manually to better understand what happens "under the hood".

$\endgroup$
5
  • $\begingroup$ If I understand correctly, DEF_rig is the proxy for export. It copies the individual bone transforms from each FK and IK rigs, and provides an FK_IK slider to toggle between the two for export 2 sets of FBX? It's not exactly what I hoped for, I would prefer if there is a way to take the rest pose, and the existing FK pose, then calculate the transform needed for the IK bones to deform the rest pose into the FK pose, then apply the transform to the IK bones. I am a super beginner, I will still try your method as a learning experience. Thanks. $\endgroup$
    – Jake
    Commented Jul 17 at 8:28
  • 1
    $\begingroup$ This is the way classic rigs work, and there isn't an easy way to tell an IK chain to copy an FK chain. A better solution would have been if you prepared an IK/FK rig in advance, and then perform the IK animations. Consider also that after creating all exportable animations, you can assign all of them to a single Export rig in the NLA, so to export a single FBX with all animations. $\endgroup$ Commented Jul 17 at 8:35
  • $\begingroup$ Thanks for the suggestions. I bought models without animations from asset store, then downloaded the animations from mixamo, and started to edit from there. So these are the limitations I had to work with. $\endgroup$
    – Jake
    Commented Jul 17 at 8:59
  • $\begingroup$ Just to report back, given the complexity of managing this method, I decided to just animate without the IK bones. $\endgroup$
    – Jake
    Commented Jul 26 at 6:29
  • $\begingroup$ Reporting back again. I have implemented the IK bones now. My life is much happier now. $\endgroup$
    – Jake
    Commented Nov 19 at 11:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .