feat(web): add scene simplify authoring
This commit is contained in:
@@ -705,6 +705,14 @@ function assertFutureCapability(payload: Extract<WebEngineRequest["command"], {
|
||||
if (maxX <= minX || maxY <= minY) throw report("RENDER_PROPERTY_INVALID", "Scene border max values must exceed min values");
|
||||
return;
|
||||
}
|
||||
case "setSceneSimplifySettings": {
|
||||
const scene = currentSnapshot?.scenes.find((candidate) => candidate.id === payload.dataId);
|
||||
const properties = payload.properties;
|
||||
if (!scene || !validPropertyKeys(properties, ["subsurfViewport", "subsurfRender", "particlesViewport", "particlesRender", "volumes"])) throw report("RENDER_PROPERTY_INVALID", "Scene simplify target or properties are invalid");
|
||||
for (const field of ["subsurfViewport", "subsurfRender"] as const) if (properties[field] !== undefined && (!Number.isSafeInteger(properties[field]) || properties[field] < 0 || properties[field] > 64)) throw report("RENDER_PROPERTY_INVALID", `Scene ${field} is outside the subdivision range`);
|
||||
for (const field of ["particlesViewport", "particlesRender", "volumes"] as const) if (properties[field] !== undefined && !boundedNumber(properties[field], 0, 1000)) throw report("RENDER_PROPERTY_INVALID", `Scene ${field} is outside the simplify range`);
|
||||
return;
|
||||
}
|
||||
case "setGeometryNodeGraph": {
|
||||
const snapshot = currentSnapshot;
|
||||
const availableResourceIds = new Set([
|
||||
|
||||
Reference in New Issue
Block a user