2
$\begingroup$

I have three shapes like this on graphic below.

enter image description here

Objects A and B are connected with object C and I'm trying to get object B translated along Z axis only when object C pushes it due to rotation of object A. Object A can be rotated in marked direction max 45 degrees. Origins of objects are marked with cross in object's color.

I've tried using armature and IK but whatever I do there's mess as a result. I've also tried using Limit Location constraint to limit XY on object B or parent bone but nothing works, tried to use empties and copy Z location, and god knows what else but nothing could resolve this issue. Since my knowledge on this matter is close to nothing, I'm not even sure it's IK problem at all (just my best guess).

My question is how to properly rig this situation.

$\endgroup$

2 Answers 2

2
$\begingroup$

to get object B translated along Z axis

I call this "IK to line"-- we basically want to constrain the pivot point of B to a line, but we don't know where it is on that line. You can do it by using an IK chain with an extra bone:

enter image description here

Here, Control represents Object A, ik1 represents Object C, and ik2 represents object B.

ik3 is a non-deforming bone. Position, rotation, and stretch are all enabled in the IK constraint, and this bone is locked in all axes and has stretch enabled.

The locks mean that ik2 will end up retaining its rotation relative to the ik target (presumably, parented to some root bone.) The stretch will mean that the IK is unconcerned with the distance to the target, only with maintaining the positions in the proper lines.

Note that stretch IK bones cannot scale to smaller than 0 in Blender, so the position of the IK target needs to be distant enough to allow the structure to reach all valid positions.

You've indicated some problems with making this work, so here's a file. I'm using an empty to control the ik target since you were asking about that. It includes animation demonstrating its full range of rotation.

$\endgroup$
9
  • $\begingroup$ This looks like exactly as what I need. But something confuses me on your image, I can see ikT bone in collection and bone constraints panel but not in actual armature. Where's that bone? $\endgroup$
    – Wh1T3h4Ck5
    Commented Jan 26 at 19:01
  • $\begingroup$ Looks like I just had an accidentally duplicated bone in that pic. It's at the exact same location as ikT.001 (the names overlap-- there's no need for ikT.001, it's just an accident.) $\endgroup$
    – Nathan
    Commented Jan 26 at 19:38
  • $\begingroup$ Got it. I'm now trying to apply this solution to actual model and see what progress I can make. A lot of things about IK are still new to me, so most of time I'm trying to figure out how things work in that area. Btw, is that ikT bone same as using . empty for IK target? $\endgroup$
    – Wh1T3h4Ck5
    Commented Jan 26 at 19:43
  • $\begingroup$ Yeah, you can use whatever you want as the target. Be careful about axes though: they define the rotation the IK tries to reach. So an empty would need the same axes as the ikT shown. $\endgroup$
    – Nathan
    Commented Jan 26 at 19:59
  • $\begingroup$ I've got something close to what you have suggested but act's bit weird. Even IK bone's location is locked it still rotates for some angles (see update in my question). I can't say is it pole problem or something else went wrong but here's how it look's now. Only difference is that I've used empty target instead of extra bone (properly rotated to match ik bone's axes). At least I've had some progress. $\endgroup$
    – Wh1T3h4Ck5
    Commented Jan 27 at 15:49
2
$\begingroup$

Simpler way is to move along Z objectB and have the IK chain follow.

In my example bone B is extruded from bone A and has an IK constraint targeting bone C, which has no parent.

Moving bone C in its Y local axis will make the chain work as expected.

If you need to start from Object A rotation, youll'have to set a driver from rot Bone A to Z loc of Bone C, using Trigonometry formulas, setting the middle bone B with a Damped Track constraint, pointing at Bone C.

enter image description here

$\endgroup$
1
  • $\begingroup$ Thanx (+1) for your effort but I've already considered this approach and can confirm that works... but my problem is actually that I don't know Z location of B, just angle of rotation of A... and function to convert these values is not linear (so I can't write simple driver). Entire thing is part of bigger mechanical model which at some point pulls lever (object A) and rest of functionality is triggered by Z location of Object B. If I somehow solve that trigonometric problem with math to get that relation, this approach may be useful in my case. $\endgroup$
    – Wh1T3h4Ck5
    Commented Jan 26 at 13:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .