Is it possible to link the rotation of a bone to the movement of another bone?

I’m almost done rigging the canopy for a spaceship I’m making, and I’m pretty happy with it so far. The idea is that the gear turns and pulls the canopy back and forth along a track of teeth. Ideally this would actually be rigged the other way, so that moving the canopy back and forth makes the gear rotate appropriately. I can do the math easily enough. I just don’t know how to constrain this in blender, or if it even can be done. Worst case I can just animate the two bones separately so that they appear to be in sync.

I don’t know if this will be useful to this thread, but here is the model so far: It is obviously very much an unfinished work.

Create a new control bone. Use action constraints for the complex movement between the two bones.

There is a bone constraint called Transformation that does exactly what you want. Here’s what it looks like:

Add the constraint to the bone that moves up/down and set the source destination mapping so that it says (axis that forward/backward bone moves on >> axis that up/down bone moves on). You might want to use local space for both of them. Also set the respective minimum and maximum values your bones have when they’re in their ‘canopy open/canopy closed’ state. Also, the other destination mappings to X for the source since your canopy doesn’t seem to be moving on that axis (this is so that the bones don’t get moved in an unwanted direction). Assuming your up/down bone moves on Z axis and the backwards/forward bone move on the Y axis it should be looking something like this: (Constraint attached to up/down and target back/forward)

Now just fiddle with the values and you’ll eventually get what you want.

Edit: Whoops I totally missed that all you wanted is turning the gear, however, as DanPro said a transformation constraint will work perfectly here anyway

I’ve had a chance to look at your file. A transformation Constraint will work.

What the Transformation constraint does is maps one transform to another. In the screenshot above I’ve mapped the Local Z location of the Canopy bone to the Y rotation of the Gear bone. (I did not do the math, just guesstimated. You’ll need to figure out the correct values to make this work.)

One thing that will help your rig is if you check “For Transform” on all Limit Type constraints. (Limit Rotation, Location, etc.)

I still recommend you create a master canopy control and add action constraints so only one control is needed for the whole mechanism.

Good luck!

Thanks DanPro! I may try for one of those Action constraints at some point, but as it stands this will have to do. Also, double thanks for the “For Transform” suggestion. I’ve been trying to find a way to do just this. Here is the result: