2
$\begingroup$

I'm quite a beginner and I'm struggling with this issue. I would like to realize a THREE JS portfolio website using this model that I found on BlenderKit: asset_base_id:0734e6f3-8609-4a04-90fd-9293c906a4ce asset_type:model

I already solve some animation problems by rigging the whole model but I'm getting crazy with the main cable that runs from the base, up to the elbow of the arm: the cable is a curve and curves are not exported to gltf, this means that I'm loosing all the automatic bending of that cable does when I animate the rest of the model. I converted the curve into a mesh but I'm not able to recreate the same animation. Notice that I tried to bound the movements of the mesh relative to a curve, but it seems not to work at all because all curves are gonna be converted into meshes.

Any solution/advice/suggestion is really appreciated.

Thanks

Blender file The file is quite big so I uploaded it to one of my websites: Robot Arm

$\endgroup$
3
  • 1
    $\begingroup$ pls provide blend file because you didn't share any image or settings you made so we have no idea what you did. $\endgroup$
    – Chris
    Aug 18, 2023 at 12:23
  • $\begingroup$ Added a link to the blend file $\endgroup$
    – Andrea
    Aug 18, 2023 at 12:41
  • $\begingroup$ Rule of thumb: if you need to export animation, only bones and shapekeys are safe to use. Other things are rarely supported (or badly, if at all). $\endgroup$
    – Lauloque
    Aug 18, 2023 at 16:22

1 Answer 1

1
$\begingroup$

As I understand it, the problem here is that you have an animated curve object, but you need to convert it to an animated, armature deformed mesh object for use in another application. You can use a chain of bones with spline IK to do that.

In your file, it appears that you've already converted the problem curve to mesh and tried to solve the problem with regular IK. We need the original, animated curve to be able to deal with this, so I'll be working with some simple, homemade stuff instead.

enter image description here

I've made an armature composed of a chain of 8 connected bones, then gave the child-most an spline IK constraint targeting the curve object. Other than the target, I need to set the chain length for the constraint, the number of bones to take part in the spline IK. This curve object is animated via hook modifiers; I've placed a copy behind and shifted its keyframes. You can see that the bones follow the curve.

But we need an actual mesh object for the bones to deform. We'll write the positions of our bones to their rest pose via "Apply pose as rest pose" operation. Then, we'll make a duplicate of our curve object, convert that to mesh, and weight it to our bones. I'll use autoweights here.

enter image description here

I've changed the curve object so we can distinguish it from the mesh object. Our mesh object is now following the armature's bones, which are following the curve. We can bake this action ("bake action" operation) with clear constraints and visual keying, manually if we want, but most exports are going to do this automatically as part of the export process.

For many meshes, automatic weights are not going to work:

enter image description here

This set of curves, roughly analogous to your problem cable, isn't going to get proper autoweights. The quick way to weight this, assuming we didn't have major curvature, would be to transfer weights (transfer mesh data operation, or data transfer modifier) from a single cylinder that had been autoweighted.

Certain techniques for animating curves are also not going to work-- not be reflected in the bones. Hooks are commonly used for curve animation in part because they (by default) act on the spline rather than the curve mesh. But something like an animated smooth modifier wouldn't affect the bones at all. (Even if set to act on the spline. Which is probably a bug.)

On default settings, the spline IK will tell the bones to inherit the radius of the spline, but there is no way to tell the spline IK to inherit the tilt of the spline. This may lead to some disagreement with the original curve object in some situations. There are workarounds possible here, but as they're a bit complex, they'd be better saved for a new question asking specifically about that problem.

$\endgroup$

You must log in to answer this question.

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