feat(web): add scene stamp authoring
This commit is contained in:
@@ -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([
|
||||
|
||||
Reference in New Issue
Block a user