It imports fine in my Babylon scene, and the mesh reacts as expected when I rotate bones.
I managed to copy all animations from my animated skeleton (manually, copyAnimationRange does not play nice). Bones line up perfectly: the input skeleton (red) can’t be seen because the rig skeleton (white) is rendered exactly on top:
It’s correct that the imported scene is from a right handed system. I’ve compensated for that by scaling root. Removing that compensation and adding scene.useRightHandedSystem = true have no effect.
You shouldn’t have to do any scaling in-engine, or before exporting. We already compensate for glTF being right handed in our scene loading, we put the mesh in a right handed subtree via the _root_ generated node.
However, a concern I have here is if you’re trying to take the right handed animation, and applying them to your newly-created left handed skeleton
Setting the scene handedness to right handed removes that conversion, as we now use right handed world coordinates.
I’m trying to remove as many variables as possible, can you try looking at the position gizmo for your joint nodes? they might not be where they’re expected, even though the line rendered skeleton looks alright.
Also, an interactable playground via https://playground.babylonjs.com would be a large help in understanding what you’re doing here.
One strange thing though. I wasn’t able to get the skeleton to look right by copying animation keys to the bones, but to transform nodes with the same names as the bones.
I can try to create a Playground, but it’s some work to reduce my scene to something simple.
Looks like gizmos only work with meshes, not bones?
I think we’re starting to get closer to the issue…
The animation I’ve loaded should be left-handed.
How are you loading this animation? as part of the glTF, or separately? If its part of the glTF, it will be interpreted as right handed by our glTF loader, since glTF is a right handed format.
One strange thing though. I wasn’t able to get the skeleton to look right by copying animation keys to the bones, but to transform nodes with the same names as the bones.
When we load a skeleton from glTF, the bones are no longer self-drivable, we link it to a node in scene (similar to how glTF represents bones, as a reference to a nodes in the scene that drives its transform, rather than their own entities) Any animation assigned to the given bone may not affect its transform, as we override it with its linked TransformNode’s transform each frame. You’ll have to apply animations to the linked transform node instead. You can see this via the inspector: