Hello guys!
Today i tried to modify some gltf model by changing it’s material.
new GLTFLoader().load('./resources/loader/M1A2/scene.gltf',gltf=>{
gltf.scene.scale.set(0.01,0.01,0.01)
this.scene.add(gltf.scene)
gltf.scene.traverse(e=>{
console.log(e.type)
if(e.isMesh || e.isSkinnedMesh){
const parent = e.parent
parent.remove(e)
parent.add(new THREE.Mesh(e.geometry,new
THREE.MeshLambertMaterial({color:0xFFFF99}) ))
}
})
})
But some meshes remain their original material.
original
modified