A script to make a seamless Ik/Fk switching

Few weeks ago, I saw a post from JiriH that explained how to make a seamless Ik/Fk switching : there was a lot of things to do to completely hide the transition during switching.

I worked with JiriH on a python script to make all the steps automaticaly.

The script works quite well, and I apply it with “Cessen’s simple biped”, you can download the rig with the script here.

Here is the mechanism of the script :
Select the slider you want to move, and press <Shift+LMB> : the script switch the IK/FK mode without transition (leg or arm remain in place during the slider movement)

We wanted this script to be really useful for an animator, so there is an other way to use it : press the ‘O’ key to turn on an «autokeyframe» mode. In this mode, every time you use <Shift+LMB> on a slider, the script will insert every usefull animation keys at the current frame to avoid transition in the animation.

We write the script to be easily adaptable to any character : You just have to change the name of the bone in the beginning of the script, and that’s all.

I would be happy to hear what you think of this work…

Kiopaa

I just had a quick look, and I think that’s pretty awesome! It seems to work well. Thanks for sharing!

Thank-you SO MUCH for that script! Its pretty intuitive - doesn’t ham up workflow too much! I could easily see that being implemented in a rig. Just to two keystrokes to remember and your rockin.

This is getting me excited.

I just noticed that when I shift LMB on the Arm R IK switch, the control bones for the torso etc. disappear. Doesn’t happen on Arm L. Cheers.

Thank you for all your feedback…

Yes, there was a mistake with the bone layers, I modified the script, you can re-download it.
The script can hide FK controllers when IK mode is on and vice-versa, the right arm works like this, not the left one, to show all the features of the script. You can easily change this in the beginning of the script :


### Definition of chains : 
 
#Left Arm 
FKChainArmLeft = ("Hand.L", "Forearm.L", "UpperArm.L") 
IKChainArmLeft = ("IK_Hand.L", "MCH_IK_Forearm.L", "MCH_IK_UpperArm.L") 
LeftArm = { "Name":"Left Arm", "SwitchBone":"Arm_IK_Switch.L", "FKChain":FKChainArmLeft,  
            "IKChain":IKChainArmLeft, "PoleBone":"ElbowTarget.L"} 
#Right Arm 
FKChainArmRight = ("Hand.R", "Forearm.R", "UpperArm.R") 
IKChainArmRight = ("IK_Hand.R", "MCH_IK_Forearm.R", "MCH_IK_UpperArm.R") 
RightArm = { "Name":"Right Arm", "SwitchBone":"Arm_IK_Switch.R", "FKChain":FKChainArmRight,  
             "IKChain":IKChainArmRight, "PoleBone":"ElbowTarget.R", "IKLayer":3, "FKLayer":2 }

You can add keys “IKLayer” and 'FKLayer" in the definition of LeftArm as I did with RightArm.

Kiopaa
(sorry for my poor english, I hope you understand what I wrote)

Congratulation Kiopaa to releasing of the script for public testing!
Definitely I have to add that all glory goes to Kiopaa. I was just a tester and have provided some comment during his coding.

JiriH

Quite literally loving this along with Cessen’s biped rig. Thanks for the work.


http://www.digital-air.co.uk/

There is a little issue in the script I would like to fix :

Each time you switch FK->IK, the pole bone move. But the mesh “VIS_ElbowTarget” (for example) doesn’t update. You can see this in the picture.
http://blenderclan.tuxfamily.org/html/uploads/img49341eee75341.png
In the script, I used “pose.update()” but only the armature is updated, not the meshes link to it.
Did you know how I can update these meshes ?
Thank you
Kiopaa

Good, good, good, the Phone number Daquan continue to pay attention!http://chbeb.net/files/product/product_29.htm,http://chbeb.net/files/product/product_65.htm,http://chbeb.net/files/product/product_76.htm.

Hi. I have a question. Lets say i want to use you script with another rig. I set the IK and FK chains and write the appropiate names in the first definitions of your script. Then I run it and it should do its magic. The problem is that it is not doing it.
To put it simple: if I append your rig to a new file, import the script, and run it, al though the transitions beteewn modes work if I slide the slider, i havent been able to reproduce the Shift+LMB behavior, where it sort of jumps. Any advise?