How to get the length of a bone of an imported .glb file?

Hi,

I imported an animation using SceneLoader.ImportMesh and I found the lengths of bones are empty. For the bones with children, it might be possible to calculate the bone length using its own position and its child’s position. However, for the bones without any child, is there a way to calculate their length?

I am using the method here (Babylon.js Playground) to import animations.

Thanks.

Hello! Pinging @bghgary

If I understand correctly, glb has nothing to do with the question.

I don’t know if there is an easy way to figure this out. The only thing I think of is to add an additional bone for the end and use that to calculate the leaf length.

2 Likes

Thank you for your reply. I’ve tried to generate a new bone and set it as a child of the tail. But it seems the new bone would be in the same position as its parent instead of linked to its parent’s end.

I think adding a bone at runtime will be difficult. I was suggesting the author of the asset include an additional dummy bone for this. The code in the playground doesn’t have a matrix associated with the bone and it will be the same as the parent.

Thanks, I will try this out.

1 Like

Hello @KimiZhong just checking in, was your question answered?

Sorry for the late reply, and yes, my question was answered. Thanks!

2 Likes