# Rigging complex mechanical shapes

I want to rig a small mechanical interaction between two pieces of metal. In theory it's simple: the upper lever should get pushed up by the lower one (which is already driven) and then drop down - while always keeping contact.

However, due to the large contact area and odd shape of the elements I cant make this work using the regular constraints. What is the right way to rig such an interaction?

• Do you want to get the reasonably convincing appearance as in the video above ... or something more complicated to simulate any two shaped levers? Physics simulation? Nov 21, 2020 at 3:36
• you could completely fake the rotation of the right one with some shapekeys, but as atomicbezier says, it all depends on what you're trying to achieve, are you trying to simulate physics? Nov 21, 2020 at 8:39
• The whole thing is part of a single mechanism which will be re-used in 8 different places. The speed of the bottom lever isn't constant, and the upper one needs to stay in place if the lower one points down and amplify its motion at the tip if it gets pushed up. Since its always the same interaction im trying to avoid physics, but the important part is that it looks good and the lever is in the right position. Nov 21, 2020 at 15:14
• Can I make the following assumptions about the surface where two levers meet? The lower lever has a convex plane and the upper lever does a flat one. Nov 23, 2020 at 14:51

## A rigging method without physics

To simplify this report, consider only two-dimensional space. It is also assumed that the lower lever has a smooth convex curve and the upper lever is a straight line on the side where the two levers touch. With this assumption, rigging with Armature was able to solve the problem.

First, for simplicity, coincides the coordinate system of the lower lever object with the Armature space. In other words, only the upper lever slides on the fixed lower lever in the Armature space. This behavior could be realized by using Follow Path and IK constraints. Then, the behavior of bones was transferred to the both lever objects. Finally, the rotating shaft of the upper lever was fixed by using a Copy Rotation constraint.

## Mesh Objects

Pro Riggers don't want you to know this one trick to rig anything!

Sometimes it's nice to spend time on a good rigging problem. For those of us whose minds work that way. Tetii's solution is fantastic, amazing.

Other times, you just want to get it done. Curved upper lever, concave lower lever. And it took about as long to rig it as it took to make those lovely meshes. What's the trick that pro riggers don't want you to know? [*]

Sometimes, the solution to a hard rigging problem is, don't rig it.

Okay, but you can't hand it to your client like that, right? You can't say, "Okay, whenever you rotate the arm 70 degrees, make sure that you put these keyframes in."

But that's what an action constraint is for:

Now that I've made that animation, I can build it into the rig as a response. Since I made that action by matching a rotation from 0 to -70 degrees, with linear interpolation, over 70 frames, I can just match the action to the rotation.

Is there any other way to do it? Sure, there's a reason that those driver f-curves look just like animation f-curves:

You can just copy-paste them in. I'll need to remap a little bit from degrees to radians by scaling about a cursor at 0,0, with snapping disabled, but that's all.

You mentioned that you don't want to use physics. Maybe that's a principled stance against a domineering reality. I think it's more likely that you just don't want to have to send your client this crazy scene full of empties and caches and tell them, "You have to hit play before you start animating, and I'm sorry it runs so slow."

Because there's a way to use physics without all of those problems, and that's to use physics to create those keyframes, rather than making them by hand. All you have to do is cache your physics, 70 frames of it, and bake to keyframes:

Now, here, making hand keyframes is easy. It takes five minutes. Setting up physics to work right takes longer than that to get right. (You don't want it bouncing all over, you don't want too much inertia, etc.) So it's not the right solution here. But for other problems, it may be. It's worth remembering that you can use physics, without using live physics.

Plus, using physics to generate your keyframes scratches that slightly-irrational itch that many of us have that it's somehow wrong to do it to eye. It's not wrong, but it feels better to let Blender's (not real anyways) physics tell us how to keyframe it.

[*] Pro riggers actually want you to know this trick.