pmndrs / gltfjsx

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

Not all axes and camera track included in output #94

Closed AlexanderProd closed 3 years ago

AlexanderProd commented 3 years ago

I have a glb file with animated joints and a camera moving along a path, when load the model in gltf-viewer.donmccurdy.com the animation plays completely and I can switch to the Camera "Main_Camera" to see the camera movement.

Here a quick recording of how it should look like, excuse the choppiness my macbook has a hard time recording and rendering the webgl at the same time. :D
https://user-images.githubusercontent.com/3080903/121669396-8fc26700-caac-11eb-8549-c72d8f963da5.mp4

But when I convert the model to JSX using gltfjsx, load it in react and play the animation it only plays one of the animation tracks which is one joint, not the whole animation which is composed of multiple tracks, the camera movement being one of them.

Here also a quick screen recording of how it looks, also confusing is the weird lighting change. https://user-images.githubusercontent.com/3080903/121669878-1bd48e80-caad-11eb-942a-40008b6f4fc6.mp4

This is the content of actions["animation_0"]._clip. As you can see there are multiple tracks with axes and the Main_Camera animated.

Bildschirmfoto 2021-06-11 um 11 48 42

The gltfjsx output also only contains one group with the name "Axis-5", the actual model has "Axis-1" to "Axis-7", with 1,2,3 and 5 animated.

Given that the animation plays perfectly in the gltf web viewer using three.js the .gtlb file must be correct and the problem happening during the conversion to jsx.

You can reproduce this by loading the attached .glb file in gltf-viewer.donmccurdy.com and under cameras selecting "Main_Camera".

I've also attached my output of gltfjsx using the command yarn gltfjsx public/model.glb -p=6. I've set makeDefault to true in PerspectiveCamera and added a useEffect to play animation_0. I'm not sure if the exported PerspectiveCamera is the same as Main_Camera.

Archiv.zip

AlexanderProd commented 3 years ago

fixed it by doing a verbose output using the -v flag in gltfjsx.

drcmda commented 3 years ago

oh thats interesting, could still be a bug if it took away something that was needed for skinned meshes

AlexanderProd commented 3 years ago

oh thats interesting, could still be a bug if it took away something that was needed for skinned meshes

Yeah thats true, I just played around with it and it fixed it by chance haha. Shall we reopen the issue?