feat(web): add scene view layer 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 13:50:23 +08:00
parent 27b1f77ffb
commit b8695839ac
47 changed files with 1959 additions and 40 deletions

View File

@@ -675,6 +675,15 @@ function assertFutureCapability(payload: Extract<WebEngineRequest["command"], {
}
return;
}
case "setSceneViewLayerSettings": {
const scene = currentSnapshot?.scenes.find((candidate) => candidate.id === payload.dataId);
if (!scene || typeof payload.layerName !== "string" || payload.layerName.length === 0 || new TextEncoder().encode(payload.layerName).byteLength > 63) throw report("RENDER_PROPERTY_INVALID", "Scene view layer target is invalid");
const properties = payload.properties;
if (!validPropertyKeys(properties, ["useRender", "useFreestyle", "samples"])) throw report("RENDER_PROPERTY_INVALID", "Scene view layer properties are invalid");
for (const field of ["useRender", "useFreestyle"] as const) if (properties[field] !== undefined && typeof properties[field] !== "boolean") throw report("RENDER_PROPERTY_INVALID", `Scene view layer ${field} must be boolean`);
if (properties.samples !== undefined && (!Number.isSafeInteger(properties.samples) || properties.samples < 0 || properties.samples > 1000000)) throw report("RENDER_PROPERTY_INVALID", "Scene view layer samples are outside the bounded range");
return;
}
case "setGeometryNodeGraph": {
const snapshot = currentSnapshot;
const availableResourceIds = new Set([