From 7bbd062569cc34f3823ebd9ae383c9abd37d5999 Mon Sep 17 00:00:00 2001 From: Marcus Longmuir Date: Fri, 8 Dec 2023 11:39:29 +0000 Subject: [PATCH] Handle missing texture data --- .../src/scene/correction-steps/placeholderMissingTextures.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gltf-avatar-exporter/src/scene/correction-steps/placeholderMissingTextures.ts b/tools/gltf-avatar-exporter/src/scene/correction-steps/placeholderMissingTextures.ts index bfcfad9..20fb7a4 100644 --- a/tools/gltf-avatar-exporter/src/scene/correction-steps/placeholderMissingTextures.ts +++ b/tools/gltf-avatar-exporter/src/scene/correction-steps/placeholderMissingTextures.ts @@ -5,7 +5,7 @@ import { forEachMapKey } from "./materials/forEachMapKey"; import { Step } from "./types"; function fixTexture(texture: Texture, setDefaultColorIfMissing: boolean = false): Texture | null { - if (!texture.image) { + if (!texture.image || texture.image.data === null) { // Replace with a placeholder texture (all white) const placeholderTexture = new THREE.Texture(); placeholderTexture.image = new ImageData(1, 1);