'Snap to' function for IK bones

Hello all. I would like to know is there way to make snap and align function for IK bones to specific bones. I know that rigify has this functionality but i want to make similar function on custom rigs. I need simplified version of such function. My rig has no separate FK\IK bones and no lot of helper bones that rigify rig has. I want to keep my rig as simple as possible but with maximum functionality.

I have simple IK rig for hands, so if i want FK movements for arms i just switch off IK constraint for hand bones. Thing i need is to snap my hand IK bone to new position of FK hand bone (properly aligned) so i could just snap IK to FK and then switch on IK constraint in order to use IK animations from updated pose. For now only way for me to do that is to use 3d cursor and snap to cursor function to move my IK bone to FK bone. However i have to manually align orientation of IK bone to match it to FK one.

So maybe there is more effective way to snap and align bone to other bone? Maybe it can be done with custom properties or even with Python script any help would be appreciated. Maybe there is some good tutorial for that matter. But keep in mind i don’t need obvercomplicated system with hundrets of helper bones (ORG, MCH. FK. IK, TWEAK, STRETCH and so on) like rigify rig has. I just need simply ‘snap to’ and ‘align to’ function for specific bones. Thank you in advance.

The only way I know of to do that is through a python script because you will need to figure out the matrix positions of each bone and then match it. What you can do is pull in the rigify script “rig_ui.py” and go to the section on the IK/FK snapping and copy that and then replace bone names in the script with your bone names. I have done this a couple of times but the effort hasn’t been worth it so I resort to the old blending methods in the animation. Maybe someone else has a better way of doing this.

Thank you for reply. I will follow your advice - will try to apply code from rigify script. Could you explain more detailed - If i will run peace of rigify code (with changed bone names) will i get working button ‘FK>IK’ for IK bones in T-tab like it is in original rigify rig? Would be great.

Also can you share which technique are you using to solve transition problems when switching IK to FK? Maybe there is more simple solution which i don’t know? Thank you in advance.

A FK to IK blend is just that. Instead of switching on one frame, you switch on several frames. say 5 or 10. Then ending is fully IK, then you back up say 5 or 10 frames and keyframe your switch to FK. You match your ending IK as close as you can and keyframe that and the fk arms. I normally keyframe IK start as close as I can to the start of the switch where the FK limbs are where I want to start the transition as well as the FK bones. Doesn’t hurt to put in an intermediate step either say 50% ik and fk. Then you can simply move around the keyframes to get the transition smooth. Normally it is just the switch and IK arm. Of course your animation path will be a little different because you are using part of FK and part of IK to guide to the end. If I don’t have the ending exact, I sometimes just move the IK and the swtich keyframes around a couple of frames so I don’t have the bump. I’m not trying to do it on one or two frames. I’m doing it several frames. That is what is called a blend of FK to IK. Going the other way I just do it backwards. I think I’m showing my age on this one. LOL The script just comment out the parts one by one till you get just the bare bones and change those. Remember it is using several bones you may not have so you might need to tweak it a little or add one or two to your rig. The last time I used it, someone coded it for me a long time ago. I looked but I can’t find it. I’m sure someone else has done matrix matching however so you might want to post in the python section.

1 Like

Thank you for sharing your workflow i found it very interesting and smart. Would try this blending method. For now i’ve ended up with merging my rig with rigify arms lol.:grin: Now i got bunch of (useless for me) tweaking bones in my character arms but at least i have functionality i wanted especially ‘snap to’ function. Thank you once again for spending time to answer my question.

1 Like