feat: support glb model assets

This commit is contained in:
Tom Boullay
2026-04-29 16:18:24 +02:00
parent ad6f1552c6
commit 95e7e9c0a5
9 changed files with 59 additions and 36 deletions
+6 -3
View File
@@ -21,9 +21,12 @@ export async function createSceneDataFromFiles(
const models = new Map<string, string>();
for (const [path, file] of fileMap.entries()) {
const modelMatch = path.match(/^\/models\/(.+)\/model\.gltf$/);
if (modelMatch?.[1]) {
models.set(modelMatch[1], URL.createObjectURL(file));
const modelMatch = path.match(/^\/models\/(.+)\/model\.(glb|gltf)$/);
const modelName = modelMatch?.[1];
const modelExtension = modelMatch?.[2];
if (modelName && (modelExtension === "glb" || !models.has(modelName))) {
models.set(modelName, URL.createObjectURL(file));
}
}