pmndrs / gltfjsx

🎮 Turns GLTFs into JSX components
https://gltf.pmnd.rs
MIT License
4.41k stars 290 forks source link

TypeError while using gltfjsx to an animated model: Cannot read properties of null (reading 'array') #263

Open BillySwaggyKidy opened 1 month ago

BillySwaggyKidy commented 1 month ago

Hello, I am struggling to an error while using the gltfjsx command-line tool to turn an animated model into a TSX component. My model is rigged using the rigify addon in blender 4.1 like the following: Capture d'écran 2024-05-29 155126 Capture d'écran 2024-05-29 155157 Then I exported my model to the glTF 2.0 format with the following export configuration: GLTF_export When I check it first to the gltf viewer and it render correctly with the skeleton and the animation. GLTF Viewers So I try to use the gltfjsx command-line tool to implement into my code with the following command:

npx gltfjsx ./public/3d/avatar/mii_avatar.gltf --transform --types

But I got this error as a result:

prune: Removed types… Accessor (16) prune: Removed types… Material (10) prune: Removed types… Accessor (158) instance: Instancing is not currently supported for animated models. prune: No unused properties found. prune: No unused properties found. prune: No unused properties found. TypeError: Cannot read properties of null (reading ‘array’) at file:///C:/Users/billy/AppData/Local/npm-cache/_npx/16b3f312213fced0/node_modules/gltfjsx/src/bin/GLTFLoader.js:2425:40 at async Promise.all (index 0) at async Promise.all (index 1)

I don’t know what I did wrong in my model maybe using rigify for my model is not the best option to export it on the web. :thinking: And It only happen with this file, if I use it with others gltf model from blender then it's work like a charm and generate the .glb and the .tsx component. You can find enclosed a zip file containing my avatar model with his armature and his 3 animations. Any help would be greatly appreciated. Thank you in advance. mii_avatar.zip