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