IK-FK switch rigging.

Couple days ago I made this IK-FK rig without scripting. Only constrains and drivers (as shown in this video: https://vimeo.com/13978208).
But it seems, constrains doesn’t work well. Strange behaviour of a hand occur during the animation…
Why could this happen? Did I make mistake somewhere using constrains and drivers? Maybe someone have any idea?

Here’s the rig I made.
https://drive.google.com/file/d/0B6XUcZ6l1aBDSUxqWmNGZUFKcVU/view

Looks like “Copy Location” constrain makes delay. Couldn’t find, where’s the problem…

Here, how this looks in viewport.

You have a copy rotation constraint on your leg_2_fk that you set the driver to 0 on and then move your same IK bone frame 42. I would suggest that you forget about that and manually sink them up over more than one frame. It is called blending. You can google it and take a look about IK FK blending. Another words, don’t try to sink them up over one frame. If you are into scripting, you can pull out the rigify part of the script that sinks up the transforms, snap IK to FK and Snap FK to IK and recode those to try to sink up over one frame.

Scripting’s not for me definitely :slight_smile:
Looks like, I’d rather use more simple (and less comfortable) rig.

You might want to contact the guy who made that video he’s right here on Blender Artist…

just do a search here on BA for revolt randy


also here is a discussion you might want to read through that might help…

also…

here’s a link to an old Blender Cookie video that covered doing this…

https://cgcookie.com/archive/animating-a-character-picking-up-an-object/#

you probably will have to download the zip file to watch the video…
but it’s worth the watch to see what Dave Ward is doing

Thank you very much!

Wow, how the time flies…

Thanks pekareff for watching the video!

The video is quite dated, but it’s still a valid method of fk/ik switching without scripting. To seamlessly blend between fk & ik with this sort of set up, you have to do it over the course of a few frames. 10-20 frames, or whatever.

I looked at your file, and there are some problems someplace. I’ll look into it in a day or so… don’t hold your breath…

Randy

Its true what revolt has said. The FK to IK set up using orient constraints is the classic method that has been used for absolute years, everywhere. The whole point of using orient constraints is so you can smoothly animate a transition between the two systems. The movement of the deforming or primary arm chain between the FK and IK chains becomes a natural part of the animation process. It usually needs to be animated across several frames 15 or 20 at least. This is to avoid a sudden jolt or glitch. That’s the whole reason for this type of set up. To be able to animate a smooth transition between the two modes. Also to hand all of the main control of how this will happen over to the animator.

It’s understandable to get confused though. I just recently had to explain this to a young animator fresh out of college working with one of my own rigs in production. He was confused when he moved the FK IK slider after starting animation that the arm moved back to it’s start position. I had to say, that means it’s working properly. I was really surprised as I thought this was all much more widely known.

Anyway all the best.

It looks like I am going against the grain with this one, but I was taught to always do IK/FK switching over a single frame. The reason for this is if you try to blend the switching over multiple frames you lose complete control over both the IK and FK chains. This makes it very difficult to control (and keyframe and polish) the arm or leg because neither control set has complete control over what the deformation bones are doing. It’s in a constant blend between the two and that blending is also changing over time.

Instead of blending both chains, pick a point in the animation where the switching should take over. Then keyframe both chains to be in the exact same positions. (This is easier with IK and FK snapping on the rig, but not impossible to do manually. The manual method just takes more time.) On the frame before the switch, do the same thing so both chains are keyed to the same position.

I set up an example to show how this is done. (I used a standard Rigify Rig for this. You’ll need to have Autorun Python Scripts enabled or click Reload Trusted when you open the file. Play the animation with ALT-A)

For this animation I started with FK arms. I wanted one arm to swing up and stick to a wall. At frame 32 the FK arm is in position on the wall. At this point, I wanted to use IK arms to keep the hand stuck to the wall. I snapped the IK chain to this position and keyed that chain. On frame 31, I also snapped the IK chain to the FK chain. The IK/FK switch property is set to 0.0 for FK on frame 31. On Frame 32, The IK/FK property is keyed at 1.0 so the IK chain is in charge.

I also reversed this process to show how to switch back. On frame 71 and 72 both the IK and FK chains are in the same exact positions. The IK/FK property is keyed at 1.0 for IK mode on frame 71, and 0.0 for FK mode on frame 72.

In the animation frames 1-31 and 72-100 are using FK for the left arm/hand, frames 32-71 are using IK.

I use the same process when animating switching for items that are hand held like swords, throwing a ball, etc. The constraints that are turning on/off to make a hand follow another item like a ball or sword are done over a single frame.

I hope all that makes sense.

Good luck!

Attachments

MidAnimIKFKSwitch.blend (2.44 MB)

Hey pekareff,

I looked at your file and you definitely have problems. The parenting of bones and the constraints used on them are conflicting with each other. It’s called a cyclic dependency, they depend on each other in ways that won’t work in blender. To see this, run blender with a terminal/console window, tab in and out of edit mode for the armature, and blender will report the conflicts in the console/terminal window.

This is most commonly caused by having the IK control bone being a child of any bone in the chain. I didn’t look too deep into this problem. If you want me to look into it, just ask.

It’s a good looking ufo/robot looking thingy. I have one I downloaded from here at ba.org years ago, and always wanted to animate it. I think it would be fun to play with. I’d like to see you do something with your character.

Randy

The IK-FK snapping thing is a bit advanced… (I haven’t even tried to impliment it into any Riggs as of yet… ) (yes… I know I’m being lazy…)

but if anyone is interested… here is one productive BA discussion on the subject…

Thank you all for your interest in this theme.
I had many things to do. Tomorrow I’ll look at this rig again and try to get rid of this cyclic things )

No. I made mistake… Sorry…

You have 2 different error messages in the console/terminal window, the messages are separated by a blank line. Both messages are related to each other.

If you can’t figure them out, post up your most recent file and I’ll take a look at it.

Randy