Can you constrain bones with IK the same as you can with rotation?

Hello!

I have created an Armature which is posed by Inverse Kinematics.

It is a robot arm , and I have used the IK limits to constrain the rotations.

I need a bone to stretch too, so I have enabled ‘stretch’. The trouble is, every percentage of stretch I choose seems to allow the bone to stretch and compress infinitely.

Is there way to limit the min/max bone stretching with IK? You can do it with normal bone constraints but IK overrides these!

Have you tried putting limit location constraints on the IK targets?

Actually that was something I started to try after posting the above, except using ‘Limit Distance’ of the IK target from the base of the stretching bone… as yet it is a little awkward in the way it affects the chain, but I haven’t finished refining it yet. My feeling though is that it still will not be as good as proper constrains of the stretchy bone.

By you suggesting this, I am guessing there is no known way to properly constrain a stretchy IK bone?

Not directly, no. Generally people either want no stretch, or they’re doing something cartoony enough that the animator will be the judge of how far is stretchy enough, not the constraint.

So let’s say you have a robot arm with an upper arm and a forearm and a simple ‘hand’.

The forearm you want to be telescopic like a piston. I was using stretch to allow the 2 piston parts of the forearm to extend from each other, but i need to limit this distance or the 2 telescopic parts will come apart - any other ways I could do this in an IK situation?

I wouldn’t make the piston a part of the IK chain, and I wouldn’t use stretch to do it. Here’s what you need:

Make two identical arm chains. One will be the IK chain, the other will copy its rotations. Now add a second bone to the forearm, a bit shorter than the first, and call it your piston bone. It’s the parent of the hand, and it is the piece that will extend on the piston. It is the child of the forearm bone. Give it a local Copy Location constraint that copies only X and Z. Now give it a Limit Location constraint and constrain only Y to however far you want it to move. Now it will follow the forearm around and slide along the forearm. Now make the other chain the IK chain, and give each corresponding bone in the non-ik chain a world Copy Rotation constraint.

Like so: PistonArm.blend (480 KB)

I had a look at your file and it looks great… but I can’t see how it works, though. I cannot find any bone that has the IK on it. Should there be one?

I can see ‘ForearmIK_L’ in the Outliner, but I cannot select nor see it! How so?

Bone layers. Armatures have their own layer system, like scene layers. There is no need to directly manipulate the IK chain, so I put them in bone layer 2 to hide them. Bone layers are in the Armature data tab of the Properties window (stick figure icon).

Many thanks! Bone layers -hadn’t used that before, but very useful!

If I were finished creating this rig, I would move even more bones off of layer 1. If I don’t ever need to grab it and move or rotate it directly, I don’t want to see it. So in that arm, the only things left would be the piston, the IK target, and the hand bone. And the finger controls could stay. I’d move all the fingers to another layer though. I just modified an old rig to demonstrate my idea, so you get a bonus hand. Enjoy!