From 3bf7dca99c65d7c3224f2e1d9854f65ad007a529 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sat, 11 Apr 2026 04:14:12 +0200 Subject: [PATCH] Add support for loading screen in project scene migration --- src/document/migrate-scene-document.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/document/migrate-scene-document.ts b/src/document/migrate-scene-document.ts index 512f3334..887baac2 100644 --- a/src/document/migrate-scene-document.ts +++ b/src/document/migrate-scene-document.ts @@ -1796,7 +1796,8 @@ function readProjectScene( value: unknown, label: string, materials: Record, - assets: Record + assets: Record, + options: { allowMissingLoadingScreen: boolean } ): ProjectScene { if (!isRecord(value)) { throw new Error(`${label} must be an object.`); @@ -1805,6 +1806,9 @@ function readProjectScene( return { id: expectString(value.id, `${label}.id`), name: expectString(value.name, `${label}.name`), + loadingScreen: readSceneLoadingScreen(value.loadingScreen, `${label}.loadingScreen`, { + allowMissing: options.allowMissingLoadingScreen + }), world: readWorldSettings(value.world), brushes: readBrushes(value.brushes, materials, false), modelInstances: readModelInstances(value.modelInstances, assets), @@ -1819,19 +1823,25 @@ export function migrateProjectDocument(source: unknown): ProjectDocument { } if ( - source.version === MULTI_SCENE_FOUNDATION_SCENE_DOCUMENT_VERSION && + (source.version === MULTI_SCENE_FOUNDATION_SCENE_DOCUMENT_VERSION || + source.version === RUNNER_LOADING_SCREEN_SCENE_DOCUMENT_VERSION) && isRecord(source.scenes) ) { const materials = readMaterialRegistry(source.materials, "materials"); const assets = readAssets(source.assets); const scenes: Record = {}; + const allowMissingLoadingScreen = + source.version === MULTI_SCENE_FOUNDATION_SCENE_DOCUMENT_VERSION; for (const [sceneKey, sceneValue] of Object.entries(source.scenes)) { scenes[sceneKey] = readProjectScene( sceneValue, `scenes.${sceneKey}`, materials, - assets + assets, + { + allowMissingLoadingScreen + } ); }