diff --git a/src/pages/Editor.tsx b/src/pages/Editor.tsx index 99e4002..d3a8fff 100644 --- a/src/pages/Editor.tsx +++ b/src/pages/Editor.tsx @@ -268,10 +268,13 @@ export const extractTextureUrl = (texture: any) => { if (!texture) return undefined; const img = texture.image || (texture.source && texture.source.data); if (!img) return undefined; - if (typeof img.src === 'string' && img.src.length > 0) return img.src; - if (typeof img.currentSrc === 'string' && img.currentSrc.length > 0) return img.currentSrc; + + // If we have a stable URL that isn't a blob, return it directly + if (typeof img.src === 'string' && img.src.length > 0 && !img.src.startsWith('blob:')) return img.src; + if (typeof img.currentSrc === 'string' && img.currentSrc.length > 0 && !img.currentSrc.startsWith('blob:')) return img.currentSrc; // Fallback: draw ImageBitmap or HTMLImageElement to canvas to extract data URL + // We MUST do this for blob: URLs because GLTFLoader revokes blob URLs after loading! try { const MAX = 1024; let scale = 1;