feat(web): add scene stamp authoring
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled

This commit is contained in:
mes123456
2026-08-29 20:31:48 +08:00
parent acf4d3d3d0
commit 46ed36ba1b
44 changed files with 1929 additions and 31 deletions

View File

@@ -581,6 +581,7 @@ export interface SceneIR {
performanceSettings?: { fixedThreads: boolean; threads: number; persistentData: boolean; highQualityNormals: boolean };
samplingSettings?: { pixelAspectX: number; pixelAspectY: number; filterSize: number; dither: number };
multiviewSettings?: { enabled: boolean; viewsFormat: number; imageViewsFormat: number; stereoDisplayMode: number; interlaceSwap: boolean; sideBySideCrossed: boolean; squeezedFrame: boolean };
stampSettings?: { stampMask: number; fontId: number; userText: string; foreground: number[]; background: number[] };
compositorGraph?: CompositorGraphIR;
compositorStatus?: "AVAILABLE" | "BLOCKED";
sequencerTimeline?: SequencerTimelineIR;
@@ -1649,6 +1650,12 @@ export function parseSceneSnapshotIR(value: unknown): SceneSnapshotIR {
for (const field of ["viewsFormat", "imageViewsFormat", "stereoDisplayMode"] as const) requireNumber(scene.multiviewSettings[field], `scenes[${index}].multiviewSettings.${field}`);
for (const field of ["enabled", "interlaceSwap", "sideBySideCrossed", "squeezedFrame"] as const) requireBoolean(scene.multiviewSettings[field], `scenes[${index}].multiviewSettings.${field}`);
}
if (scene.stampSettings !== undefined) {
if (!isRecord(scene.stampSettings)) throw new Error(`SceneIR.scenes[${index}].stampSettings must be an object`);
for (const field of ["stampMask", "fontId"] as const) requireNumber(scene.stampSettings[field], `scenes[${index}].stampSettings.${field}`);
requireString(scene.stampSettings.userText, `scenes[${index}].stampSettings.userText`);
for (const field of ["foreground", "background"] as const) requireTuple(scene.stampSettings[field], 4, `scenes[${index}].stampSettings.${field}`);
}
if (scene.compositorStatus !== undefined && !["AVAILABLE", "BLOCKED"].includes(scene.compositorStatus as string)) {
throw new Error(`scenes[${index}].compositorStatus is invalid`);
}