Changing the transparency mode of my GLB file

You’ll need to check that each child is actually a THREE.Mesh, first, with child.isMesh === true. The scene could contain other objects, like empty THREE.Group instances, which don’t have materials.

The materials on meshes created by GLTFLoader will usually be MeshStandardMaterial instances, so you’ll need to use the properties documented for that class — glTF property names like “alphaMode” are not used within three.js. To enable alpha blending in three.js, you’d typically use:

material.transparent = true;
material.opacity = 0.123;

With opacity at 0, the material will be invisible.

3 Likes