Home > Software design >  three.js load glb warning 'format' is not a property of this material
three.js load glb warning 'format' is not a property of this material

Time:01-06

three.js is throwing three.module.js:7950 THREE.MeshStandardMaterial: 'format' is not a property of this material. when I load a .glb I made in blender. Everything else works as expected. What dose this error mean? could it be that some property of my material I set in blender is not supported by threejs?

  const loader = new GLTFLoader();
  loader.load( '/myguy.glb', function ( gltf ) {
    scene.add(gltf.scene);
    const myguyMesh = gltf.scene.children.find((child) => child.name === "Human_Mesh");

  }, undefined, function ( error ) {
    console.error( error );
  } );

i found this https://threejs.org/docs/#api/en/materials/Material

.format : Number
When this property is set to THREE.RGBFormat, the material is considered to be opaque and alpha values are ignored. Default is THREE.RGBAFormat.

but I don't really know where to go from here.

edit: i sort of know where to go from here. there is some irrelevant(ish) glb property of my materials that is not accepted by three

CodePudding user response:

I actually had the same problem as you! The first problem I can think of for it is that you had a texture for the object, and the code is trying to access it but can't get it, perhaps since it is in a different folder, etc. Another possibility is that the code is trying to access the texture through files that changed when exported. Good luck! -Codeitfast

  •  Tags:  
  • Related