GLTFLoader/SkinnedMesh: Mesh rotated by +/- 90º

Description of the problem

As reported in KhronosGroup/glTF-Blender-IO#856, the model below appears rotated by 90º around the X axis in three.js, when any of the included animations are played. In several other viewers (BabylonJS, glTF-Sample-Viewer, Blender), the model appears upright.

^The second link also contains a second version of the model, game_man_packed.glb. The only difference is that the second has been optimized by gltfpack — and for some reason it then renders correctly. 🤔

expected three.js
babylon three

The glTF validator reports several possible issues with this model (joint weights should be normalized, and so on) but nothing that looked like an obvious cause to me.

For a quick way to preview the problem, drag the model into https://threejs.org/editor/ or https://gltf-viewer.donmccurdy.com/, then play the Idle animation (or any animation with an obvious upright pose). In my viewer, the model itself is accessible as content from the JS console.

Three.js version
  • Dev
  • r113

Author: Fantashit

3 thoughts on “GLTFLoader/SkinnedMesh: Mesh rotated by +/- 90º

  1. Wow… that’s… yeah. Confirmed, renaming the node (I edited the original .glb by hand) fixes the issue.

    (╯°□°)╯︵ ┻━┻

    Either we need to escape this name in PropertyBinding.sanitizeNodeName, or remove the special case entirely. I think I’d vote for the latter.

    Thanks for finding that! Had not occurred to me at all.

Comments are closed.