GLB loaded file will not apply external textures

I have created a JSFiddle to recreate my problem here:

In that JSFiddle, you will find a chair loaded by the GTLFLoader (specifically, it is a glb), and you will find a cube sitting next to it made from simple geometries in three.js. There is a button called “RED”, which, when you click it, will apply both a color and a texture to both the cube, and some meshes on the chair. You will see that the texture displays on the cube, but not on the chair. I am only applying the color so that you can see which meshes I am trying to apply the texture to. If you remove the color setting part, the texture will still not show.

The relevant code starts on line 70 of the example.

var lounge_2101_seat = gltf.scene.getObjectByName("lounge_2101_seat_velvet");
velvet_texture.encoding = THREE.sRGBEncoding;
for(var s_i in lounge_2101_seat.children) {
    var mesh = lounge_2101_seat.children[s_i]; = velvet_texture; = false; = THREE.sRGBEncoding; = true;
    mesh.material.needsUpdate = true;
    mesh.material.color = velvet_color; = THREE.ClampToEdgeWrapping; = THREE.ClampToEdgeWrapping;

} = velvet_texture; = true;
cube.material.needsUpdate = true;
cube.material.color = velvet_color;

On the texture, I am setting flipY to false, and encoding to sRGB, as described by the documentation here:

I also set the renderer to sRGB, as the documentation asks.

In the console, if you output the result of the chair’s meshes, you can see the texture object sitting in the material’s map, despite the fact it doesn’t show. However, after a few days, and reading every possible related post and piece of documentation, I cannot figure out why the texture will not render. Any help is greatly appreciated.

Let me know if any more information is needed to understand/solve the problem, and I will promptly update the post. Thanks.

To use a texture, a mesh must have texture coordinates (or UVs) stored in its geometry. For a mesh that doesn’t already have them, it’s usually much easiest to create the UVs in a tool like Blender. This process is called “UV unwrapping”:

In this example, the seat mesh does not have UVs.