feat(web): wire Blender camera focus object
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-30 21:30:40 +08:00
parent ed25fafee2
commit b7691f2fe3
36 changed files with 1930 additions and 18 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@@ -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`);