I’m looking for a way to make a bendy bone match the shape of a 2 handle bezier curve. It seems that this ought to be possible because, as the documentation says, a bendy bone is essentially a 2 handled bezier curve. However, with the curve, we control it through the control points and handles. But on the bbone, we control it by adjusting the Ease In and Out (in pose or edit mode), and adjusting the Roll.
Does anyone have idea idea how this could be done? I assume there is some relation between the scale of a bezier curves’s handles, and the Ease In and Out values? It should be possible to snap the head or tail of a bone to a control point, get the size or scale of the handles, and convert it to Ease In or out? (And perhaps also set Roll based on Tilt?)
The use for this would be to setup a hair rig, as I’ve already got the hair based on lots of curves. Manually matching the bones to the curves would be a huge amount of fiddling.
UPDATE:
Here’s a picture of a bone that I have positioned to match a curve. The bone’s start and end handles are set to Tanget, and are aligned with the bezier curve’s handles. The left side handle is 2 units away from the control point on Y, and the right side handle is 1 unit away on X. To get my bone to match this, I have the Ease In (left side) at 1.56, and the Ease Out at .3
This creates a chain of multiple bones along a curve. I’m trying to create a single bbone with multiple segments, and adjust its bend to match a curve.
But then I’ll have a chain of bendy bones, no? I need one bone with 30 segments, not 5 bones with 6 segments. Unless there’s a way to convert a chain to a single bone?
I already have a bbone with a head and tail. I’m trying to adjust the big bbone to match a curve. Here’s a gif of me doing it manually. But its imprecise. I’m trying to figure out how to automate this by understanding the relationship between the bezier curve handles and the bbone Ease in and out settinigs.
Making multiple bones along a curve is a different issue.
It looks to me like if a curve segment corresponds to a bendy bone segment (start and end segment included) then the shape should be the same as the curve.
It depends on the control points of the curve. If you scale or move the handles, the curve becomes more extreme. In the case of the bendybones, the start/end are defining the rotation of the handle, but scaling them doesn’t do anything. Instead you adjust the Ease In/Out. So i’m trying to figure out what the relationship is between handle position and Ease In/Out is.
The length of each handle (hlength1 and hlength2 respectively) is based on the “ Ease In/Out ” properties, the length of the bone, and a magic-number factor (“0.5f * sqrt(2) * kappa”, where kappa = the handle length – apparently this formula allows “for near-perfect circles”). i.e.,
So I’ve got a script working where it adjusts the Ease In/Out based on the curve’s handle length:
But now there’s a new issue. I’ve set it up to also follow rotation (via the handle pointing at another bone that follows the curve handle position), but i’m getting some offset.
This offset is caused by the effective length of the bbone changing, but not the actual length value. The bbone is currently 2 units long, and if you apply this pose, it is still 2 units long. So the extra length that comes from Ease In/Out stretching it is not reflected in the length value, and so continuing to use the base length gives the wrong results.
There doesn’t seem to be any part of the data api that tells me the true length of a bbone. So I need to figure out some amount to adjust the base length by based on the Ease In and Out amounts. Any ideas?
EDIT: On further inspection, I’m not sure that the problem is caused by Ease changing the length. It may be some other discrepancy between the bones and curve. You can see here that the bone and curve lines up just right when the handle is at 90 deg to the original path of the bone, but then the length starts being wrong in one direction or the other as its rotated. But moving the ctrl point handle further away stretches the bone and curve, but does not cause additional problems in their alignment.