Visual Keying and Inverse Kinematics

Hello, I’m having a problem…

I have visual keying enabled and some of my bones have inverse IK enabled with empties as targets.

However when I move the empties somewhere and then select all the bones to keyframe then, most of them don’t react to this. They still have their keyvalues at 0, since they are constrained… But as far as I know, Visual Keying is supposed to circumvent this?!?

How can I fix this?

EDIT: In case this wasn’t clear. In the end I want to have my bones to have a keyframed animation without the IK targets. Until then however I want to work with them.

Or is the only possible solution using targetless IK? So I have to rotate the last bone on a chain manually?

Just tested and you’re right that VK doesn’t record IK positioning. Weird, as I thought it did. I’ll have to check 2.4 series to see if it used to.

Even if it did though, it wouldn’t be useful for what you’re trying to do. When under the influence of a constraint, most objects have their normal transformation data completely ignored. Setting regular F-Curve keys does nothing to the constraint result, so everything works fine. You add your visual keys, then remove the constraint and everyone is happy.

However, notice that rotating a bone while it’s a part of an IK chain actually changes the result: the whole chain moves. So, by adding transformation data into the mix via VK, you would be changing the result on-the-fly as you recorded those keys. That would lead to an unexpected result.

What you really need is some way to bake those positions into F-Curves. Here’s a tricky way to do it:

Create two sets of leg bones: one IK, and another “free floating”. They should be identical copies of each other. Make the free-floating ones the mesh deformers, and give them each a CopyLoc and CopyRot constraint targeted at their equivalent IK bone. Visual Keying WILL record the location of the CopyLoc/Rot’ed bones. They are following the IK leg bones exactly, so…

When you’re done, you remove the CopyLoc/Rot constraints, and you are left with two regular old bones that have keyframes that follow the motion of the IK bones.

It’s a pain, but the only way to do it right now.

:frowning:

well thats shit…

is the blender team seeing into this at any time soon?

I submitted a bug report back about the time 2.54 came out, same problem. It was fixed, but perhaps it’s broken again. I talk about this in a video tutorial on fk/ik switching that is here. I’d suggest submitting a bug report…

Randy

Do you understand though that there is a fundamental incompatibility with setting any kind of keys on bones in an IK chain? Even if you COULD do it, it wouldn’t do what you think. Actually, the functionality I mentioned above (two sets of bones, one FK, one IK) is a pretty standard way of doing arms and legs anyway. You can’t expect advanced functionality from a simple rig (IK-only limbs). In fact, I’d be willing to say that what you really want to do is to bake IK motion into an FK rig. You need two sets of bones to that. Well, either that or the IK system needs to be reworked so that transforms on in-chain bones have no affect on the solution.

You can file a bug report, but I’m going to guess (as the person who originally wrote the visual keying section of Blender lo those many years ago) that it’s not going to be seen as a bug. It’s a restriction, and a correct one.

I’m wrong… I was thinking of inserting visual loc/rot keys for an FK chain that is copying the rot of an IK chain via constraints. I just re-read the OP and see my error…

harkyman’s right, normal practice is to create 2 sets of bones, fk & ik, and have the fk bones copy the rotation of the ik bones. Then you can visually key the fk bones as they copy the rotations of the ik bones.

Randy

that sounds highly complicated. why can’t I just move my empties and keyframe the goddamn bones? :frowning:

Once you understand how IK actually works, you’ll understand why.

It is complicated. 3D animation is not finger painting.

is there anyway you could explain to me on a more easy level? because it seems interesting. but yeah you guys are right…

I asked a few fellow animators and they all seem to use 2 rigs. you see, I learned the tool through tutorials, but the workflow I taught myself, so I am always on the hunt on how I can make things more effective :smiley:

First question: do you know basic rigging, i.e. can you build a skeleton of bones and use basic constraints on it?

Okay, I’ve fielded this question enough times that I just put up a blog post with a more extensive write-up on how to do it. If you can do basic rigging, you can follow the tutorial. If not, you’ll need to get the basic skills in one of the many already available resources…

http://www.harkyman.com/2010/11/26/recording-ik-movement-into-fk-bones/

Yes, I can rig and weightmap and do all that stuff. I’ve also recently gotten into constraints. I would like to have a brief description of each constraint to look up somewhere, but it’s not that important. After all, its easypeasy anyway.

Thanks for the blog post, I’ll check it out! :smiley:

This is working quite well, thank you!

Instead of putting a CopyLocation and CopyRotation on each bone, can I just use CopyTransforms?

That’s a new one to me, but it seems that it would work.