mrdoob / three.js

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

glTF - Skinned Mesh not displayed. #15020

Closed TimJeskeSensape closed 6 years ago

TimJeskeSensape commented 6 years ago

I am working on a project were I have examples of real time deformations with ThreeJS. I am creating objects in Blender and export them with the glTF-Exporter to glTF and then import them into ThreeJS and display them. This works perfectly fine with normal models and models with morph targets, but if I add an armature in Blender and export it with the Blender glTF-Exporter, no object is rendered in ThreeJS. The object is there and is logged like this: importedobjectinthreejs

The positioning seems to be right. I let the camera rotate and it wasn't rendered anywhere. The 3D-Object is correctly rendered in online glTF-Viewers and the VSCode glTF-Add-on. Also the bones are shown there correctly.

I am loading the models like that:

import GLTFLoader from 'three/examples/js/loaders/GLTFLoader';
loadModel(modelName, gltfPath) {
    return new Promise((resolve, reject) => {
      this.loader.load(gltfPath, gltf => {
        let objectWrapper = new THREE.Object3D();
        objectWrapper.add(gltf.scene);
        this.models.set(modelName, objectWrapper);
        return resolve();
      });
    });
  }

Any ideas why 3D-Objects with bones are not rendered in my scene?

donmccurdy commented 6 years ago

Your code looks OK, are you able to share the model (you can drag a ZIP into GitHub comments)? If not, perhaps check object scale and camera parameters.

06wj commented 6 years ago

Try setting frusumCulled to false, it is possible that it was culled.

TimJeskeSensape commented 6 years ago

@donmccurdy I can upload this object, which is one of those objects that don't work. beard-arm.zip

@06wj Thank you. I will try it. On which object do I have to set frustumCulled to false? The imported object has frustumCulled true and all its children too. Do I have to set for all of them or only mesh objects or only bones?

TimJeskeSensape commented 6 years ago

I set frustumCulled to false for the imported object and every child it has and it didn't work.

Mugen87 commented 6 years ago

Crosspost: https://discourse.threejs.org/t/gltf-skinned-mesh-not-displayed/4406

As long as you can't prove a bug, it's actually more a help request than anything else. Because of this, the discussion should be conducted in the forum.

TimJeskeSensape commented 6 years ago

@Mugen87 Ok sorry, I will close this issue and continue asking in the forum.