auto-git:

[change] src/document/migrate-scene-document.ts
This commit is contained in:
2026-04-22 12:28:23 +02:00
parent a4f86aa221
commit 0404f7a848

View File

@@ -2531,15 +2531,27 @@ function readWorldTimePhaseProfile(
throw new Error(`${label} must be an object.`); throw new Error(`${label} must be an object.`);
} }
const skyTopColorHex = expectHexColor(
value.skyTopColorHex ?? defaults.skyTopColorHex,
`${label}.skyTopColorHex`
);
const skyBottomColorHex = expectHexColor(
value.skyBottomColorHex ?? defaults.skyBottomColorHex,
`${label}.skyBottomColorHex`
);
const fallbackBackground: WorldBackgroundSettings = {
mode: "verticalGradient",
topColorHex: skyTopColorHex,
bottomColorHex: skyBottomColorHex
};
return { return {
skyTopColorHex: expectHexColor( background: readWorldBackgroundSettings(value.background, `${label}.background`, {
value.skyTopColorHex ?? defaults.skyTopColorHex, allowMissing: true,
`${label}.skyTopColorHex` defaultValue: fallbackBackground
), }),
skyBottomColorHex: expectHexColor( skyTopColorHex,
value.skyBottomColorHex ?? defaults.skyBottomColorHex, skyBottomColorHex,
`${label}.skyBottomColorHex`
),
ambientColorHex: expectHexColor( ambientColorHex: expectHexColor(
value.ambientColorHex ?? defaults.ambientColorHex, value.ambientColorHex ?? defaults.ambientColorHex,
`${label}.ambientColorHex` `${label}.ambientColorHex`
@@ -2607,8 +2619,14 @@ function readLegacyWorldTimeOfDaySettings(
} }
return { return {
dawn, dawn: {
dusk, ...dawn,
background: cloneWorldBackgroundSettings(dawn.background)
},
dusk: {
...dusk,
background: cloneWorldBackgroundSettings(dusk.background)
},
night: { night: {
background: nightBackground, background: nightBackground,
ambientColorHex: nightProfile.ambientColorHex, ambientColorHex: nightProfile.ambientColorHex,