Problem using shape keys with Y rotation

Hello. Noob greetings.

I am trying to create an acceptable hip/thigh/leg rig. I’m doing this before fully modeling my character so I can understand how the rig will manipulate the mesh, and use that to create proper topology. Please note: This is not my mesh. I’m simply using it to create a basic rig and understand what it needs to do to the mesh to cause acceptable deformations. My actual mesh isn’t yet ready for an armature.

Before jumping into the actual hip->thigh deformations, I wanted to make the basic leg deform correctly, which I thought would be a simple matter thanks to Tolobàn’s tutorial on bones that twist. Unfortunately, it’s not turning out to be as simple as I expected.

To start, I created a very simple armature just to deform the mesh using a hip, thigh, and shin bone. I then weight painted things to be able to move the leg and shin in a basic way. Then I added a bone inside of the thigh bone called thigh_upper, parented to the hip bone, with an IK solver pointing it to the shin bone. I then weight painted the thigh and thigh_upper bones so that when I twist the thigh bone, I get a twisting deformation of the mesh surrounding the thigh.

The problem is that when twisted, the thigh mesh shrinks into itself. Tolobàn’s tutorial mentions this problem, and says that the effect can be compensated for by using a shape key driven by the Y rotation of the bone. So I set out to do just that.

I created a shape key called ThighRotation. I then created a key curve that would change the value from 0 to 1 linearly, based on the Y rotation of the thigh bone from -90 to 90.

Then I rotated the thigh bone to the 90 degree position and edited the ThighRotation shape key to compensate for the shrinkage effect.

The shape key could use some tweaking, as well as the weight painting of the thigh and thigh_upper bones, but this rig is doing basically what I want. It’s keeping the shape of the thigh mesh from shrinking in on itself when the bone is rotated.

Here’s where the problem is. I cleared the transformation, then rotated the thigh bone 90 degrees on it’s X axis, as if the model were sitting on a bench.

Then I rotated the thigh bone on it’s Y axis, as I would to pose or animate the model swinging it’s foot from left to right along the ground, or if I wanted the model to put it’s right foot on it’s left knee… a fairly natural pose to assume when you’re sitting down.
And the thigh shrunk in on itself, as if the shape key didn’t exist.

In reality, the shape key is still there and Blender is doing just what I told it to do… change the shape key value linearly with the Y rotation of the thigh bone. The problem is that at this orientation, when I rotate the thigh bone on it’s Y axis, Blender does not see this as a Y rotation. You can look at the values in the Transform Properties window and see that the RotY value is hardly changing at all.

I don’t understand exactly why this is, but I think it must be because Blender sees the Y rotation of that bone from a global perspective of the object, and doesn’t take into account the actual orientation of that specific bone. When you adjust the X or Z rotation, this isn’t a problem. The X and Z values remain the same regardless of how the rest of the armature is moved. But the Y value appears to be dependent on where the bone is in space, which seems to mean I can’t use it for what I want to do.

So, now I’m stumped a bit. Is there a way to drive my shape key from the actual Y rotation of the bone? And if there isn’t, how can I fix this shrinkage effect?