feat(web): add scene simplify 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 14:57:19 +08:00
parent 013aee26f8
commit ae614dc039
47 changed files with 1922 additions and 43 deletions

View File

@@ -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([