driven shape key question-parenting

Okay, if I make a shape and apply a base shape key and then some other shape key, then tie the second shape key to be driven by the movement of an object, such as an empty, everything works just fine. For example, I took a cube, applied a base shape key, then went into edit mode and scaled the cube a bit and applied another shape key. Move the slider, the cube scales as expected. Add an empty somewhere else. Go into the IPO editor in shape mode, select the key for the cube, add a driver tied to the empty so that when it moves in, say, the Y axis, the cube scales. Works like a champ.

But if I want to parent the empty driving the shape key to something else and have that something else indirectly control the shape key, all of a sudden the driven shape key no longer works. If I move the object that the empty is parented to, nothing happens. if I go back and move the empty by itself, the shape key works as expected.

Is what I am attempting to do impossible, or am I missing something here? This behavior seems very odd to me. It seems like if the empty is moved, by whatever means, it should still drive the shape key.

If you parent object 1 to object 2 and move object 2, the location value of object 1 is doesn’t change (even though you can see it move) because its new world centre is object 2 ( the relative location from object 2 doesn’t change). You can see this in the Transform Properties window for the location of object 1 after object 2 is moved.
If the driver is the location of object 1, by moving object 2 you are not changing objects 1 location so doesn’t drive the shape key.

Thanks for the reply, that would explain it. Drat. It is starting to look like what I want to do is impossible. I’m trying to make a model of a V8 engine. I have gotten an animated crank and piston to work just fine…so long as everything is aligned with the major axes. But if I want the piston to move at an angle, I haven’t been able to figure out any sort of constraints to get it to do so. I had this idea of using a mesh circle with the scale controlled by a sort of “phantom piston/crank” tied to the major axes and have that control the movement of an empty, which controlled the scale of an 8 sided mesh circle that had the pistons vertex parented to the vertices that were at 45 degrees, so that if the one at “0” moved, so would the ones at 45, in like manner, but along a line tilted at 45 degrees. I figure the crank would be the same, and the tie rod could track the angled pistons…

But it ain’t gonna work. Grrr…

Have you tried parenting the piston to an empty and then rotating the empty. As with the driver above, this will rotate the pistons ‘world’ axis accordingly.

Hmmm, that’s not doing it, but there may be some other consideration involved.

Here is the setup, in top view mode. I have an empty located at the major axes origin. located in y is a cube intended to represent the crank. There is another longer cube for the tie rod with it’s center the same as that of the crank. Further along in y is a third cube for the piston.

The crank is a child of the first empty with only rotation in z enabled.

The tie rod is a child of the crank, also with rotation z enabled. It also has a locked track constraint to the piston.

The piston is a child of the crank, but with only the location in y turned on. Thus, when the empty is rotated in z, it causes the crank to turn and “tugs” on the tie rod pulling it around in a circle, but the locked track constraint points it at the piston.

Can’t remember if I found this setup on the net somewhere or if I made it up…I think I remember seeing somebody else do it on the net. Anyway, It works great, but only along major axes. (Edit: Yup, found it. it’s here.)

I tried adding the empty as you suggested, but the constraint still applies to it’s movement in Y, I need it to move in both x and y simultaneously. The piston is rotated, yes…but moves only along the y axis.


piston-test.blend (134 KB)


I would build an armature rig like this:

Put a bone at the centre of the ‘big end’ on the crank. For each piston, build two ‘arms’ each with a part that sits where the piston rod sits when the piston is half wave through the travel, and one at 90 degrees, in the same plane that the crank rotates. each arm points in the opposite direction to one another. The bend in the arm should be at the ‘little end’ of the piston rod, and the root of the arm should be the base of the 90 degree part, and the tip at the crank.

Limit all movement to the plane of rotation. Apply an IK constraint to both of the arms, pointing at the crank bone, with a step of 2. Now they will rotate to allow the ‘piston rod’ arms to always reach the crank as it goes around. However, being arms, they will rotate, rather than slide back and forth. Add another bone, with no parent, and constrain it’s location to both of the two piston rod bones, at 50%, and it’s rotation locked. This will be the piston mesh bone, so it moves the piston mesh. Do the same again, only also constrain the rotation 50% each to the piston rod bones as well. This will be the piston rod mesh bone.

The whole rig should work whichever way round it is, so you can then duplicate the bone groups to produce your other pistons.