Basic rigging problem - Ik with constraints not matching goal when it is able to.

   3466   4   2
User Avatar
Member
47 posts
Joined: Dec. 2016
Offline
Hi all,

I am building a very basic character rig from scratch to get a better understanding of how houdini's bones/ik solvers work.

I have run into a perplexing issue. So I have a leg that is controlled by an IK With Constraints solver. I'm using the IKWC solver as opposed to the simple IK solver because I want to have a lot of control over the way that bones are able to rotate.

So for the leg, there are only three bones: a pelvic bone, a femur, and an ankle. The pelvic bone at this stage is just to give the femur proper distance from the spine so I have it static (all rotation ranges limits set to 0, for now). So this is essentially a two bone system. The bone are all orientated so that the X axis is the primary axis of rotation.

Its really basic what I want: I have it set so that the femur should rotate from 0-180 and the ankle can rotate from 0-180. This range allows for the leg to be lifted up in a going-up-a-step motion. And it can make this motion in this range if I turn the IK blend to 0 and set the rotations manually. However, when I turn the blend back up to 1, with the goal null where I want the end of the leg to be, it just keep the leg straight and does not match the goal. The goal is definitely attainable given the rotation ranges I allow, but it just won't figure this out.

Anyone have any idea whats wrong here?

Attachments:
Screen Shot 2017-09-09 at 3.21.12 PM.png (1.3 MB)
Screen Shot 2017-09-09 at 3.19.49 PM.png (1.3 MB)
weirdling_anim.hiplc (222.1 KB)

User Avatar
Member
402 posts
Joined: June 2014
Offline
Hi,

looks like your setup has the leg bones in a perfectly straight line in the rest pose, which will be confusing the IK solver when it tries to initiate the angles. Try:
1. turn off the IK
2. put a slight bend in the knee
3. ‘Clean Transforms’
4. Set the ‘Rest Angles’ parm back to zero on both bones (this parm will have been adjusted to compensate for the freezing of transforms)

You should now be able to switch the IK back on and have everything behave as you expect.

Hope that helps,

Henry
Henry Dean
User Avatar
Member
47 posts
Joined: Dec. 2016
Offline
Hi Henry,

Yes, putting a slight bend in the knee does work. Instead of using the pre-transforms, I just added 15 degrees to the X rest rotation. Is this equivalent to your method?

However, this solution is not entirely satisfying. For one thing, I would like the leg to be able to be completely straight without having to turn off the IK. I'm going for more of a toony style. I don't see why the IK can't be given the indication of which way to bend without having to actually start it out with a bend.

Another practical thing is that I get a fair bit of snapping unless I use a higher rest rotation (~>15). For instance, at a rest X rotation of 5 the leg will stay straight until the goal is moved to a region where a rotation of roughly >15 is necessary, at which point it will snap from Rot X = 0 to Rot X = 15 and will increase from there.
User Avatar
Member
402 posts
Joined: June 2014
Offline
Yes, I meant to add that you can just adjust the rest angles for the same effect. Although always a good idea to have clean rotates on the bones, whatever the case.

I'm not sure how the IK with constraints is implemented in Houdini, but it seems common for IK solutions to have constraints applied after an initial solution has been created (i.e. on the first iteration of the solve). So if the initial solution has gone the wrong way then the constraints will lock it to the nearest ‘permitted’ angle, which in your original case was the ‘wrong’ side of the constraint range.

Giving the IK an indication of which way to bend is exactly what the twist effector does when using the ‘un-constrained’ version of the IK (for all intents and purposes the same as the Rotate-Plane solver in maya). I've not come across a good reason to prefer the constrained IK solver over the other when it comes to a two bone chain like a simple leg. If you have a planar chain to start, the knee will only ever bend in the x-axis in the direction of your twist control. Making the pelvic bone part of the IK chain will cause you grief here, as it puts a lovely big kink in the chain which will give very strange results with a twist effector.
Henry Dean
User Avatar
Member
47 posts
Joined: Dec. 2016
Offline
Thank you for your help Henry. Perhaps using a twist effector IK is the better option here. It did indeed cause problems with the pelvic bone included, but as you say, the pelvic bone lies perpendicular to the plane of the motion I would like to achieve, which I can understand would cause problems.

I think you are also right about the solver initially going the wrong way, as I before I began to limit the rotation ranges I remember that the leg appeared to work properly when bending in the backward direction.

Does anyone have any insight as to how the solver initially picks a direction to rotate in?
  • Quick Links