From 76b23cf0078a6b803a1fef686136fbebc08aaa12 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 31 Mar 2026 18:44:42 +0200 Subject: [PATCH] Refactor and optimize GLTF model import logic --- src/assets/gltf-model-import.ts | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/assets/gltf-model-import.ts b/src/assets/gltf-model-import.ts index 207c9c2d..1479f206 100644 --- a/src/assets/gltf-model-import.ts +++ b/src/assets/gltf-model-import.ts @@ -41,14 +41,6 @@ export interface ImportedModelAssetResult { loadedAsset: LoadedModelAsset; } -function getErrorDetail(error: unknown): string { - if (error instanceof Error && error.message.trim().length > 0) { - return error.message.trim(); - } - - return "Unknown error."; -} - function getFileExtension(sourceName: string): string { const match = /\.([^.]+)$/u.exec(sourceName.trim()); return match === null ? "" : match[1].toLowerCase(); @@ -521,7 +513,6 @@ async function loadModelFileSet(files: File[]): Promise { } const rootFile = modelFiles[0]; - const rootFormat = inferModelAssetFormat(rootFile.name, rootFile.type); const rootSourcePath = getImportedFilePath(rootFile); const rootDirectory = getPathDirectory(rootSourcePath); const importedFiles = await Promise.all( @@ -537,7 +528,7 @@ async function loadModelFileSet(files: File[]): Promise { const sourcePath = file === rootFile ? normalizeRelativePath(rootFile.name.trim()) : getRelativePath(rootDirectory, getImportedFilePath(file)); const mimeType = inferFileMimeType(file.name, file.type); - if (packageFiles[sourcePath] !== undefined && packageFiles[sourcePath].bytes !== bytes) { + if (packageFiles[sourcePath] !== undefined) { throw new Error(`Duplicate imported file path ${sourcePath}.`); }