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