mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
101.85k stars 35.31k forks source link

FBXLoader: Unable to load animated mesh. #22167

Open shadowredwine opened 3 years ago

shadowredwine commented 3 years ago

Describe the bug

An error occurs when reading some fbx files through the fbx loader.

To Reproduce

Reproducing the error is very simple. Just open the attached fbx file with three.js editor. The error is that the mesh and bone do not match. Blender reads without problems.

Platform:

Mugen87 commented 3 years ago

Where does the FBX file originally come from?

Since you can import the model to Blender, do you mind exporting to glTF and use THREE.GLTFLoader?

shadowredwine commented 3 years ago

model from unity asset store. Reading the fbx file with blender and GLTF results in poor quality. 화면 캡처 2021-07-22 172113

Mugen87 commented 3 years ago

Can you also try to convert the FBX asset to glTF via https://github.com/facebookincubator/FBX2glTF?

Mugen87 commented 3 years ago

Reading the fbx file with blender and GLTF results in poor quality.

What does "poor quality" mean? Can you share the resulting gltf asset in this thread?

shadowredwine commented 3 years ago

sorry. My english skill is not good enough. If you read the fbx file through Blender and convert it to a gltf file, it feels like the 3d modeling quality is lowered. Looking again, there seems to be a problem with the texture mapping. The reason I thought so was because the texture files were not bundled together, so the mapping information seems to have been omitted. Bone Warrior.zip

Mugen87 commented 3 years ago

Um, the glTF asset actually looks good. If you can manage to fix the texture coordinates issue in Blender, I would recommend you choose the glTF workflow. For web based asset delivery it's a better choice than FBX anyway.

shadowredwine commented 3 years ago

It doesn't seem to be a mapping issue. When I checked, there was mapping information in Blender. If you put the FBX file and the texture file in the same folder, blender automatically reads them. It seems to be an export problem with blender itself. In my opinion, FBX files should be read in FBX so there is no problem.

Mugen87 commented 3 years ago

Yeah, it would be good to fix the issue in FBXLoader. But nevertheless, you should be aware that the more modern glTF and not FBX is the recommended 3D format of three.js. If you have to possibility, use it whenever you can. It's more compact, faster to parse and way easier to optimize with a great toolset (resulting in even smaller file sizes and better rendering performance).

Related guide: https://threejs.org/docs/index.html#manual/en/introduction/Loading-3D-models

shadowredwine commented 3 years ago

It looked good to me too. More than anything, it was json, so it was easy to understand the structure. Thanks for the related link.