Problem using constraints

I have checked all the tutorials i could find, and they explained the basic principles fine, but
i still didn’t find what i wanted.

I’m rigging a rigid mechanical figure, not a robot, but it might as well be.
there are two vertical parallel poles connected at the top by a pipe and at the bottom by a base. I want the two vertical pole to be able to rotate, but have the top and bottom pieces stay horizontal. I can’t upload a pic right now, but heres a basic demonstration of what i want it to do. [] //. terrible, i know. imagine a bar at the top as well. the top and bottom stay horizontal at all times.

The problem i’ve been having is when i set a constraint on the top bar. it moves from it’s original position. i don’t know how to get it back to the right position in relation to the other bones while still keeping it fully constrained. the base is the parent, if i rotate it, i want everything else to rotate with it. I don’t know how to get around that, especially considering that when i rotate the parent of the top bar (parent: the left vertical pole) i don’t want the top bar to rotate. So i’m kind of contradicting myself.

I really appreciate any help.

I think I found a setup that will work. (Kind of hard to visualize what you’re saying.)

Try watching the linked video and reading this post together.

12mb video, .mp4

.blend file

You want the top and bottom to stay parallel, and the left and right to stay parallel, while the left and right bars rotate.

First I added a bone, (the left bar), then duplicated that, making a right bar. Then, I added a Copy Rotation constraint to the right bone, that copies the rotation of the left bone.

Which means, wherever the left bone rotates, so does the right bone. That solves problem #1.

Next, you wanted a top bar that stayed parallel to a bottom bar that stuck between the left and right bars. I added a top bone, and parented it to the left bone. Which kind of solved our problem: the top bone stuck with the left. But what about the right? I added a Stretch To constraint on the top bone, the target being the right bone.

But if you do that, you get a problem. Notice the top bone will jump to the bottom of the right bone. That’s because Stretch To will stretch the bone to the base of the target bone-that’s a problem. Flipping the right bone 180 degrees won’t solve this problem-because the rotation will be screwed up when the left bone rotates. So how do we fix this?

First remove the Stretch To constraint. Then, by duplicating the right bone, rotating THAT 180 degrees, and parenting it to the regular right bone. This creates a bone that moves wherever the right bone moves, but with the base at the top.

Which is perfect, because now if you do Stretch To on the top bone, targeting the inverted right bone, it will work nicely. Solves Problem #2.

(Explanation: Stretch To makes the constrained bone’s tip stretch TO the base of the target bone. By parenting the constrained bone to another, the base stays with the parent, while the tip goes with the target.)

Last problem: bottom bone moves everything, often referred to as a “Root” bone, or master bone. Just create a bone where you want the bottom bar to be, then parent the left and right bones to the bottom, and now the bottom will move everything. You don’t have to parent the top bone to the bottom because that’s already parented to the left.

Now if you create vertex groups with the respective bone’s names, you can deform a mesh with this armature setup. Ta-daa!

Anyway, I know you don’t want to read all that text. So I linked a video and attached the .blend file.

Hope I helped!

(A tip: If you name the vertex groups the exact same name as the bones, they will automatically deform respectively, if the object is parented to the armature.)


Solution.blend (257 KB)

Well, I’m not sure what kind of constraints you’re using. Could you post a blend of what you’ve done?

Meanwhile, I’ve made an example file with one possible solution. I made a base with two vertical bars topped with one horizontal bar. Each piece in my example is a separate stretched out cube, all part of the same object, named barsandpoles. Each piece is also its own vertex group, named for the bone that moves it (for simple models, naming these ahead of time saves some time in weight painting, neat trick).

So, one bone in the base, which is the highest parent bone in the rig. On the left and right, its direct children, the vertical bars. Across the top is the child of the Bar.r bone, cleverly named TopBar. TopBar has an IK constraint set to BarIK, which is the child of Bar.L, with a chain length of 2 (TopBar + Bar.R = 2 bones). You pose it by moving Bar.L which has a few fun things done to it as well.

Bar.L has location and scale locked, and can only be rotated on the z axis (click the Axes button under Armature to see which way the bone’s axes face, so this will make sense). It also has a limit rotation constraint set to limitz from -75 to 75 degrees in Local Space. Just by eyeballing it, that was the furthest that looked realistic to me when I moved it.

Edit: N00bhaxor uses the same vertex group trick as me! Glad we both had different solutions. Now you have choices!



notarobot.blend (128 KB)

Thank you so much! That’s perfect. I haven’t had any experience with constraints so this helps a lot.
Thanks for all your work.

Great! This solves my problem. Thank you. I may post my work on the site when i’m finished.