Can't make a knee target [SOLVED!]

Is there a way to control what direction the knee of an IK leg is pointing? In XSI, for instance, you can use an “IK up vector” constraint to make the knee point at an empty. Of course, that only works with 2D IK chains, but still… it’s a really important thing to be able to control, and I can’t figure out how to do it in Blender.

I tried using the “Track To” constraint, but that only works as long as the origin and end of the IK chain keep a certain (very limiting) relationship to each other. Otherwise it messes up. I imagine that has a lot to do with it being a 3D IK chain. But, again, there’s got to be a solution, right? I can’t image an oversight like this lasting so long.

Any help would be greatly appreciated.

EDIT:

I figured out a way to do it. A link to the blend file is at the bottom of the thread.

You should use the locked track constraint,the result is very similar to the up/pole vector tecniques common in xsi/maya.
you can do 2d chain,but you have to limit the rotation axes of the child of the chain(forearm for example)
Bye

Thanks for the tip on 2D chains.

Anyway, the locked track isn’t working either. I’ve tried applying it to the one bone, then the other, then both, then the object that contains the IK chain… and I tried a variety of settings on the Locked Track constraint itself. None of those worked. Several of them sort of worked, but not well enough to reliably animate with.

It’s a bit strange,it should work,but only if you contraint the first bone of the chain,not the childs(arm,not forearm or hand for a 3 bone chain).Maybe you have the roll value of your bones not clear,try to look at it.
bye

Well, as I said, I tried the constraint on every bone, and even the container object itself. And I did so with a variety of settings.

Would you mind rigging up what you’re talking about and posting the .blend file? I might just be confused, and that would help.

EDIT:

Here’s my attempt: http://www.cessen.com/storage/misc_files/leg_rig_1.blend

If you switch to the top view and move the knee target around, it works okay. The knee doesn’t follow it exactly, and if you bring the target close enough it starts to go wacko, but I guess that’s sort of okay (albiet very undesirable).

But go to frame 10 (I set a key), switch to the right view, and try the same thing. It goes all wacko. That’s not okay for animating with. It’s not okay for a rig to fail just because the character isn’t standing upright.

Anyway, if I’m doing something wrong, let me know. I’d love to know how to rig a knee-target properly in Blender.

Hi Cessen,I have looked into your file and maybe I have found the problem.
Your rest position(the edit mode position) is to angular,the knee should bend only a bit,not so much .If you modify this the rig works(yes,when you move the upvector controller too much near the bones the chain flips but only in this case,if you stay far away you shouldn’t have many problem).

i think in blender you usually just add another ik chain as knee target?

Renderdemon, I tried making the rest pose less angular. Here: http://www.cessen.com/storage/misc_files/leg_rig_2.blend
Although this lessens (though not eliminates) the first problem of the knee not exactly following the target as it should when the leg is upright, the second problem still remains.

To demonstrate this I request that you switch to frame 10, switch to the right view, and move the knee target. You’ll notice that knee does not come anywhere close to following the target. This basically means that my character has to be standing upright for this rig to work. Sitting down, lying down, crawling, etc. will all fail. In fact, runs will fail, too, because the legs would come up too high.

Not good enough.

Thanks for trying, though. :slight_smile:

Kakapo, the target in the Blend file is a bone already. I also tried using the IK constraint instead of the locked track constraint. It fails even worse than the locked track.

Your problem is you have the wrong axis tracking the target. On your locked track constraint change To to Y and Lock X.

That solved it for me. Always check which axis by displaying axes before you start tracking.

Switched “To” to Y and “Lock” to X. That only reverses the problem. Now it works on the frame 10 position, but NOT on frame 1.

So, in short, still no good. Thanks for trying, though.

I’m not sure if this is what you’re looking for, but it might help.

https://blenderartists.org/forum/viewtopic.php?t=31839&highlight=

b01c

Thanks for the link, block01cube. Unluckily, I’ve seen that before and it has exactly the same knee tracking problems.

I figured out a way to do it that works 100% Yay!

Here’s the .blend: http://www.cessen.com/storage/misc_files/leg_rig_3.blend

The only problem with this method is that since it isn’t done entirely inside the armature (two of the three constraints are on the armature object itself), it won’t be very useful with Blender’s current pose/NLA system. But as long as you’re planning to animate it all by hand, it’s great.

Hopefully in the future Blender will allow arbitrary collections of objects to be used with the pose/NLA system. Then much more interesting and versatile rigs like this will be usable with that system.

EDIT:

Here’s leg and foot rig I made, complete with a crappy test animation to show off some of the rig’s features: http://www.cessen.com/storage/misc_files/leg_rig_test.blend

(The actual rig controls are all hidden on the first layer for clarity.)

Is it really solved, though, if you have to rotate the entire armature to get it to work? I’m not denying that what you’ve got works well, but it only works for one leg. With that setup how can you expect to not use multiple armatures for a single character?

That’s exactly what I meant. You can’t currently use it with the pose/NLA system.

That really has more to do with the pose/NLA system than with the armature system, though. You shouldn’t have to limit a rig to being constructed entirely within a single armature. That’s always going to be limiting. Ideally you should be able to use arbitrary groups of objects.

It would be nice to have a simple constraint that does knee-tracking type stuff–it would make rigging characters faster. But given the choice between that and a robust pose/NLA system, I’d take the latter in a heart beat. Ideally I should be able to use as many separate armatures and other arbitrary objects in a rig as I want, and still be able to use it with the pose/NLA system. The way Blender restricts you to a single Armature right now is very limiting in more than one way.

So, I guess the way I see it is: yes, this DOES solve the knee tracking problem. What it doesn’t solve, however, is the dastardly limitation that you have to build a rig entirely within a single armature object. :stuck_out_tongue:

HI Cessen,good work,in this way is more controllable,and I totally agree with you,rigging is the process of creating relations between objects,it’s a pity if is limited to only some kind of objects(or hierarchies).The current system could be improved a bit,sometimes there is even some lag.

Still not so sure what the problem is there… Can you elaborate, perhaps with screen shots, how it’s different in other software? You mentioned XSI…

Really? Since you started this thread I’ve been playing around with rigs a bit and I find the IK knee constraint works just fine as long as certain angles are preserved. As long as you’re careful and conscious of the knee constraints they shouldn’t pose a problem.

Well, if you download my latest rig (control objects hidden on the first layer) you’ll see that I use lots of outside objects to control the IK chain. And, in fact, I have two separate Armature objects: one for the leg and one for the foot.

This presents a couple of main advantages: first, I have more flexibility in how to rig my characters; second, I can move parts of the rig to a hidden layer if the animator doesn’t need to control them directly (so they don’t clutter the view).

I can rig characters in Blender this way just fine (I think). But if I do, then I can’t use them in combination with Blender’s more advanced animation features like actions or NLA. Unless something has changed recently that I didn’t notice, that is.

What I’d like to see is a wokrflow like this:

  1. Build your rig however you darn well please, with as many or as few objects (of any type) as you like.
  2. Select all objects in your rig.
  3. Hit some hotkey to make your rig into a “character” or “rig group” or some such name like that. All the objects of your rig are now under a single object (just like multiple bone chains can be under one armature object), and they can be treated collectively as a single rig that can be used in the action editor and NLA timeline.

Something like that would be far more flexible, and would allow for a greater variety of rigs in Blender.

The key phrase in there is “as long as certain angles are preserved”. I’m sorry, but that’s not good enough. I can think of a good number of cartoony characters that could benefit from a greater range of movement than your rig reliably allows. In fact, I can think of non-cartoony rigs that would need a greater range of movement as well.
Also, the way the leg reacts to the knee target is inconsistent: it changes depending on the position of the leg. It’s not predictable. Animators shouldn’t have to worry about things like that. It should be predictable. It should be consistent.

Your rig may be good enough for what you plan to do with it and for how you like to animate, but there are many cases in which that would not be nearly good enough.

I got the equivilent of your example rig very early on, before I even started this thread. If I had thought it was good enough, I wouldn’t have started this thread.

All the objects of your rig are now under a single object (just like multiple bone chains can be under one armature object), and they can be treated collectively as a single rig that can be used in the action editor and NLA timeline.

Or a new Bone-Type, (Target Bones) that are calculated before Constraints.

%<

Well, that wouldn’t really work. For a knee target to work you effectively need to rotate the bones around the axis formed by the line between the beginning and end of the chain after the IK has been solved.

I got around it by making the entire armature rotate to aim at the end effector ahead of time, then solving the IK, and then solving the knee target. Even if there were a “target” bone type that solved before the other constraints, it wouldn’t let you do that.

Anyway, regardless of all that, only being able to make a rig within a single armature is limiting in a variety of ways. And it’s a limitation that eventually needs to be removed if Blender is to have a truly robust animation system.

I’m not saying “OMG! Blender coders work on this right now I demand that you make this ASAP and drop whatever else your doing and ignore your family and job and give up all your free time OMG we need this!” I’m just saying it’s something that should be dealt with eventually.