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

@@ -787,6 +787,16 @@ function assertFutureCapability(payload: Extract<WebEngineRequest["command"], {
for (const field of ["interlaceSwap", "sideBySideCrossed", "squeezedFrame"] as const) if (properties[field] !== undefined && typeof properties[field] !== "boolean") throw report("RENDER_PROPERTY_INVALID", `Scene ${field} must be boolean`);
return;
}
case "setSceneStampSettings": {
const scene = currentSnapshot?.scenes.find((candidate) => candidate.id === payload.dataId);
const properties = payload.properties;
if (!scene || !validPropertyKeys(properties, ["stampMask", "fontId", "userText", "foreground", "background"])) throw report("RENDER_PROPERTY_INVALID", "Scene stamp target or properties are invalid");
if (properties.stampMask !== undefined && (!Number.isSafeInteger(properties.stampMask) || properties.stampMask < 0 || properties.stampMask > 0x1ffff)) throw report("RENDER_PROPERTY_INVALID", "Scene stampMask is outside the bounded range");
if (properties.fontId !== undefined && (!Number.isSafeInteger(properties.fontId) || properties.fontId < 0 || properties.fontId > 128)) throw report("RENDER_PROPERTY_INVALID", "Scene fontId is outside the bounded range");
if (properties.userText !== undefined && (typeof properties.userText !== "string" || new TextEncoder().encode(properties.userText).byteLength > 767)) throw report("RENDER_PROPERTY_INVALID", "Scene userText is too long");
for (const field of ["foreground", "background"] as const) if (properties[field] !== undefined && (!Array.isArray(properties[field]) || properties[field].length !== 4 || properties[field].some((value) => !boundedNumber(value, 0, 1)))) throw report("RENDER_PROPERTY_INVALID", `Scene ${field} must contain four normalized channels`);
return;
}
case "setGeometryNodeGraph": {
const snapshot = currentSnapshot;
const availableResourceIds = new Set([