feat(web): wire Blender camera focus object
This commit is contained in:
File diff suppressed because one or more lines are too long
BIN
web/app/src/vendor/blender/web_engine.wasm
vendored
BIN
web/app/src/vendor/blender/web_engine.wasm
vendored
Binary file not shown.
@@ -572,8 +572,9 @@ function assertFutureCapability(payload: Extract<WebEngineRequest["command"], {
|
||||
if (properties.shift !== undefined && (!Array.isArray(properties.shift) || properties.shift.length !== 2 || properties.shift.some((value) => !boundedNumber(value, -1000, 1000)))) throw report("RENDER_PROPERTY_INVALID", "Camera shift is invalid");
|
||||
if (properties.depthOfField !== undefined) {
|
||||
const dof = properties.depthOfField;
|
||||
if (!validPropertyKeys(dof, ["enabled", "focusDistance", "apertureFStop", "apertureBlades", "apertureRotation", "apertureRatio"])) throw report("RENDER_PROPERTY_INVALID", "Camera depthOfField is invalid");
|
||||
if (!validPropertyKeys(dof, ["enabled", "focusObjectId", "focusDistance", "apertureFStop", "apertureBlades", "apertureRotation", "apertureRatio"])) throw report("RENDER_PROPERTY_INVALID", "Camera depthOfField is invalid");
|
||||
if (dof.enabled !== undefined && typeof dof.enabled !== "boolean") throw report("RENDER_PROPERTY_INVALID", "Camera depthOfField.enabled must be boolean");
|
||||
if (dof.focusObjectId !== undefined && dof.focusObjectId !== null && (typeof dof.focusObjectId !== "string" || !currentSnapshot?.nodes.some((node) => node.id === dof.focusObjectId))) throw report("RENDER_PROPERTY_INVALID", "Camera depthOfField.focusObjectId is invalid");
|
||||
for (const [field, minimum, maximum] of [["focusDistance", 0, 1e9], ["apertureFStop", 0.01, 1000], ["apertureRotation", -Math.PI * 2, Math.PI * 2], ["apertureRatio", 0.01, 100]] as const) {
|
||||
const value = dof[field];
|
||||
if (value !== undefined && !boundedNumber(value, minimum, maximum)) throw report("RENDER_PROPERTY_INVALID", `Camera depthOfField.${field} is outside the bounded range`);
|
||||
|
||||
Reference in New Issue
Block a user