mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-07-14 07:56:42 +00:00
gracefully handle texture load failures
This commit is contained in:
parent
b86e5622af
commit
4337ee85e9
9 changed files with 16 additions and 10 deletions
|
|
@ -456,12 +456,15 @@ uniform float tiling5;
|
|||
const q = getRotation(true);
|
||||
const interiorFile = getProperty("interiorFile").value;
|
||||
gltfLoader.load(interiorToUrl(interiorFile), (gltf) => {
|
||||
console.log(interiorFile);
|
||||
gltf.scene.traverse((o) => {
|
||||
if (o.material?.name) {
|
||||
const name = o.material.name;
|
||||
const tex = textureLoader.load(interiorTextureToUrl(name));
|
||||
o.material.map = setupColor(tex);
|
||||
try {
|
||||
const tex = textureLoader.load(interiorTextureToUrl(name));
|
||||
o.material.map = setupColor(tex);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
o.material.needsUpdate = true;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue