feat(web): add view layer pass 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 21:26:04 +08:00
parent 29622d02cd
commit 34801d655e
69 changed files with 3738 additions and 38 deletions

View File

@@ -805,6 +805,16 @@ function assertFutureCapability(payload: Extract<WebEngineRequest["command"], {
if (properties.thickness !== undefined && !boundedNumber(properties.thickness, 0, 1000)) throw report("RENDER_PROPERTY_INVALID", "Scene line thickness is outside the bounded range");
return;
}
case "setSceneViewLayerPassSettings": {
const scene = currentSnapshot?.scenes.find((candidate) => candidate.id === payload.dataId);
if (!scene || typeof payload.layerName !== "string" || payload.layerName.length === 0) throw report("RENDER_PROPERTY_INVALID", "Scene view layer pass target is invalid");
const properties = payload.properties;
if (!validPropertyKeys(properties, ["passMask", "cryptomatteMask", "cryptomatteLevels", "alphaThreshold"])) throw report("RENDER_PROPERTY_INVALID", "Scene view layer pass properties are invalid");
for (const field of ["passMask", "cryptomatteMask"] as const) if (properties[field] !== undefined && (!Number.isSafeInteger(properties[field]) || properties[field] < 0 || properties[field] > 0xffffffff)) throw report("RENDER_PROPERTY_INVALID", `Scene ${field} is outside the bounded mask range`);
if (properties.cryptomatteLevels !== undefined && (!Number.isSafeInteger(properties.cryptomatteLevels) || properties.cryptomatteLevels < 1 || properties.cryptomatteLevels > 16)) throw report("RENDER_PROPERTY_INVALID", "Scene cryptomatteLevels is outside the bounded range");
if (properties.alphaThreshold !== undefined && !boundedNumber(properties.alphaThreshold, 0, 1)) throw report("RENDER_PROPERTY_INVALID", "Scene alphaThreshold must be between zero and one");
return;
}
case "setGeometryNodeGraph": {
const snapshot = currentSnapshot;
const availableResourceIds = new Set([