feat(web): add scene image format 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 16:39:01 +08:00
parent a5800cdde8
commit d1635f5163
47 changed files with 1945 additions and 38 deletions

View File

@@ -722,6 +722,18 @@ function assertFutureCapability(payload: Extract<WebEngineRequest["command"], {
if (properties.tint !== undefined && !boundedNumber(properties.tint, -100, 100)) throw report("RENDER_PROPERTY_INVALID", "Scene tint is outside the color-management range");
return;
}
case "setSceneImageFormat": {
const scene = currentSnapshot?.scenes.find((candidate) => candidate.id === payload.dataId);
const properties = payload.properties;
if (!scene || !validPropertyKeys(properties, ["fileType", "colorMode", "depth", "quality", "compression", "exrCodec"])) throw report("RENDER_PROPERTY_INVALID", "Scene image format target or properties are invalid");
if (properties.fileType !== undefined && !["PNG", "JPEG", "OPEN_EXR", "TIFF", "WEBP"].includes(properties.fileType)) throw report("RENDER_PROPERTY_INVALID", "Scene fileType is unsupported");
if (properties.colorMode !== undefined && ![8, 16, 24, 32].includes(properties.colorMode)) throw report("RENDER_PROPERTY_INVALID", "Scene colorMode is unsupported");
if (properties.depth !== undefined && ![2, 4, 8, 16, 64].includes(properties.depth)) throw report("RENDER_PROPERTY_INVALID", "Scene depth is unsupported");
if (properties.quality !== undefined && (!Number.isSafeInteger(properties.quality) || properties.quality < 0 || properties.quality > 100)) throw report("RENDER_PROPERTY_INVALID", "Scene quality is outside the bounded range");
if (properties.compression !== undefined && (!Number.isSafeInteger(properties.compression) || properties.compression < 0 || properties.compression > 100)) throw report("RENDER_PROPERTY_INVALID", "Scene compression is outside the bounded range");
if (properties.exrCodec !== undefined && (!Number.isSafeInteger(properties.exrCodec) || properties.exrCodec < 0 || properties.exrCodec > 10)) throw report("RENDER_PROPERTY_INVALID", "Scene exrCodec is outside the bounded range");
return;
}
case "setGeometryNodeGraph": {
const snapshot = currentSnapshot;
const availableResourceIds = new Set([