auto-git:
[change] src/document/migrate-scene-document.ts
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user