3
$\begingroup$

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.

enter image description here

enter image description here

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.

enter image description here

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.

enter image description here

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.

enter image description here

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.

enter image description here

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.

enter image description here

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

2 Answers 2

2
+50
$\begingroup$

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.

enter image description here

That's a subgroup in a tree which furthermore:

enter image description here

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

enter image description here

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

enter image description here

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

Given a curve, the modifier allows you to set

  • Block dimensions
  • Number of blocks
  • Cable radius, cable separation.

enter image description here

Have a look, see if it works for you:

$\endgroup$
2
  • 1
    $\begingroup$ 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. $\endgroup$
    – spyro
    Oct 2, 2022 at 21:47
  • $\begingroup$ Hi, @spyo! Will check the spec. :) $\endgroup$
    – Robin Betts
    Oct 3, 2022 at 6:34
1
$\begingroup$

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.

Create a new plane and go into edit mode. Select all the vertices and collapse them using "Mesh > Merge > Collapse." Extrude what's left till it's exactly 1 meter in length pointing in the positive X direction. You should now have a single 1 meter line segment as the object.

With the segment selected in object mode, head to the geometry node editor and click "New." Put this in and set the object info node to the curve you wanna find the length for.

enter image description here

enter image description here

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

enter image description here

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

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! This means that both ends of the segment bones will align themselves to the curve they're following, with a few rare exceptions.

enter image description here

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...

EDIT: I found out a better way to use curve length as a driver variable using geometry nodes, I'm updating this post to use that method instead of the old one.

$\endgroup$
2
  • $\begingroup$ 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. $\endgroup$
    – Robin Betts
    Oct 3, 2022 at 18:22
  • 1
    $\begingroup$ sure thing, I'll add it to the post $\endgroup$
    – spyro
    Oct 3, 2022 at 18:46

You must log in to answer this question.

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