How to convert animations of animationGroup to animations of bones?


According to this reply How to convert AnimationGroup to AnimationRange - #4 by Evgeni_Popov, I know the animations of animationsGroup in glb file contains position, rotationQuaternion,scaling, the animations of bones in babylon file only contains matrix.
If I want to convert the animations of animationGroup in glb file to animations of bones in babylon file, there are two questions.
1.how to convert three animations(position, rotationQuaternion,scaling) to one animation matrix?
2.According to “in gltf we animate transform nodes (bones are linked to transform nodes) and in .babylon file we directly animate the bones”.After convert animation,directly animate the bones still don’t work, only animate transform nodes works. How to make directly animate the bones works?

We will need a repro to help further but for 1: You can build a Matrix out of position, quaternion and scaling with Matrix | Babylon.js Documentation (babylonjs.com)

I tried to convert the position, quaternion and scaling to matrix and remove the linkedTransformNode, and export to babylon.

But the mesh don’t show correct.

After click “returnToRest” on Skeleton or click Animation Range, the animation is correct.


Can you find the problem of exported babylon file?
export.zip (2.9 MB)

I do not want (nor have time to) to dig into your object. Can you please provide a repro in the Playground?