Hi everyone,
I am getting weird rotations when importing a skeleton via glb into Babylon.
Actual problem
untitled.zip (163.3 KB)
This glb gets me different results when loaded into Blender and Babylon. The model does look the same on immediate import. But the bones, when zeroed, are completely different:
Why does this hapen?
It is not a bug in the inspector or so. I selected the gltf root node and closed the inspector. Then I ran this code in dev console:
debugNode.getDescendants().forEach((node)=>{
node.rotationQuaternion = BABYLON.Quaternion.Identity()
})
Same result.
Background info (in case it is relevant)
-
Start: non-skeletal (unrigged) mesh in t-pose. Location, rotating, scaling all normalised.
-
Upload to mixamo**, re-rigged by them, download as new base fbx
- **scale: 1, forward: -Z Forward, up: Y Up
-
Import new base fbx in Blender:
- Meshes: root node is scaled and rotated, child mesh has inverse rotation and scaling of parent.
- Bones: edit bones have arbitrary role. Pose bones all slightly rotated but at least close to zero. Zeroing the pose bones gets me back to original t-pose.
-
Export new base fbx to glb: normalise (bake tansforms) mesh transformations to 0-rotation and 1-scaling. This requires edit in hips bone (root) on location. This file is included above.
-
Import new glb into Blender: Meshes still normalised, bones with slight rotations. Zeroing the bones gets me back to original t-pose.
-
Import exact same new glb into Sandbox.Babylon: Except gltf root node, meshes still normalised, but bone rotation values completely different (n.b. “values”, visually the skeleton looks fine). Also, there are position changes as well now.
Best wishes
Joe