# Align both ends of a bone to a curve without stretching?

I'm trying to rig a series of bones that follow a curve and stay an equal distance from eachother and have strings that stretch between each segment. The thing that makes this a little complicated is that I only want certain parts to stretch to the curve length, not the whole mesh. The model provided is just a shareable "demo" version of the model I'm rigging. My goal is to make a mechanical arm that functions similarly to the beast cutter from Bloodborne, but much simpler and with exactly 4 segments. I need the resting pose for these segments to be in a "locked" position, like in the video. The gif below is what I got so far.

Each "segment" bone has a copy location constraint set to an "anchor" bone, as well as a damped track constraint that points towards a "pointer" bone. Both the anchor/pointer bones have a follow path constraint with fixed position turned on. The offset factor for the anchor bones are in increments of 0.333 while the pointer bones are set to a lower relative value for the damped track.

When the arm is near its resting pose, it looks great, exactly what I want. But when it's extended, the segments diverge and it no longer follows the curve due to a greater distance between the pointer bone and the segment bone.

Then I need to readjust the offset factor for each pointer bone so that the damped track points the segments along the curve again, then it's back to normal.

But then bringing it back to a bunched up pose causes the bones to work more like the "follow curve" option in the follow path constraint, which is what I don't want because it causes a jagged shape.

Is there a way to make the pointer bone automatically adjust its offset factor to stay at a fixed distance from the segment bone, depending on curve length?

I thought perhaps this could be possible with some driver magic if I were able to use a curve's length as a driver variable. While blender doesn't seem to have a reliable way of doing this, I found a janky workaround here that makes it possible. Unfortunately, I don't know how I could plug this value into a driver to get it to work, or if even having the curve's length is enough to accomplish this.

Below is an illustration of why I don't want to use the "follow curve" option in the follow path constraint. I'd rather the bones point "in the general direction" of the curve, illustrated in the third example.

• Did u ever consider using Geometry nodes for this? Sep 29 at 8:17
• I did, but had no idea where to start. I know very little about geometry nodes. Sep 29 at 18:25
• You want to control this curve by its ends, only? Oct 1 at 18:29
• Yeah, to make animation a little easier. I might add like one more handle to the curve in the future if I need it. Oct 1 at 18:35
• The original looks to me like a pantograph, not cables? Could be wrong,.. you would prefer cables, anyway? Oct 3 at 8:05

Here's a GN Group that will modify a given Bezier curve to a set of smooth, stretchy double-cables linking fixed-size blocks at equal intervals along it. The Curve can be animated, for example, using Hooks. This example has 3 hooks on the curve's 3 control points.

The strategy:

• Instance block-length lines on the curve at block-number samples of the curve, offset to instance center, and to meet curve-ends.
• Create a new poly-curve connecting the ends of those line-segments.

That's a subgroup in a tree which furthermore:

• Places block-length cubes on the straight segments of the above segmented-curve, appropriately rotated ...

• Sets the handles on the segmented curve to be straight, through the blocks, and aligned, between them...

• Gives the straight-and-smooth curve a double-cable profile.

Given a curve, the modifier allows you to set

• Block dimensions
• Number of blocks

Have a look, see if it works for you:

• There are some issues I have with this solution, and this is kinda my bad for not including the specific functions this needs from the beginning. My goal is to make a mechanical arm that works like the beast cutter from Bloodborne (youtu.be/a-Pi9TyoKT0?t=51), but much simpler and using only 4 segments. The segments need to be able to lock together, requiring them to sometimes be in close proximity of eachother on the curve. In this solution, the segments are using example 2 in the drawing, which can still cause a jagged shape when they bunch up. I'm gonna add this info to the post. Oct 2 at 21:47
• Hi, @spyo! Will check the spec. :) Oct 3 at 6:34

I think I may have figured it out. I'm gonna put this out in case there's ANYONE who also wants to do this. I might also change the title to something more search term friendly.

I was thinking about this as I was trying to sleep and how I would go about using the janky workaround method to get a driver equation that could solve this problem and had a bit of a light bulb moment. I jumped out of bed and tried it out. It's 1:30am.

So in the video, it shows someone using the array modifier set to "fit curve" on a plane that's scaled down by A LOT (the smaller the plane, the more accurate the measurement). The plane's dimensions will then display the length of the curve in whatever axis was chosen.

I took the pointer1 bone and added a driver to its offset factor and put this in:

I used the plane generating the curve length as the object, and If I'm not mistaken, 0 = x axis, 1 = y axis, 2 = z axis. In my case it's the x axis. The value should now be displaying the length of the curve in meters.

Now before, this is where I got stumped and gave up cause I couldn't figure out the math to use in the scripted expression but I think I got it now.

I put 1/var as the expression and that made the pointer bone stay at a FIXED point exactly 1 meter into the curve, no matter how long/short it got. Then I tried to take it further and experimented with different numbers and operators and came up with a formula:

x - y/var


x = the offset factor of the bone or object you want this bone to stay relative to

y = the offset you want in meters (in this case, the length of the segment bone)

The anchor1 bone is set to an offset factor of 0.333. I want the pointer1 bone to stay at a distance equal to the length of the segment2 bone, which is 1. So I put this in the expression box:

0.333 - 1/var


It works! The pointer bones (red) stay at a fixed distance from the anchor bones (orange), all while staying aligned with the curve!

I only wish blender had a built in way to use the length of a curve as a driver variable, but I haven't found any other way to do this than in the video above... And that's a bit of a bummer because I feel like there's a lot you'd be able to do with that. If anyone knows a better way to use the length of a curve as a driver value please let me know. Or if there's a completely different solution that's better (like using geometry nodes as suggested by @robin and @chris)

The ONLY problem I've noticed with this has is that since I scaled my plane down to 0.001 of a meter, the plane will now generate 1,000 vertices per 1 meter of curve length, which could cause some bloat if your curve is several hundred meters long or something.

• Very nice! Shame you can't bounty yourself! If it's not considered your own intellectual property It would be great if you could share a minimal .blend file with this answer, for others to poke around in. Oct 3 at 18:22
• sure thing, I'll add it to the post Oct 3 at 18:46