diff --git a/README.zh-CN.md b/README.zh-CN.md
index b28e0a2df..d865fb8d8 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -30,7 +30,7 @@ OpenDirector 是一个在本地运行、通过浏览器使用的 AI 视频创作
-
+
## 最新动态
diff --git a/apps/api/src/opendirector_api/localization.py b/apps/api/src/opendirector_api/localization.py
index 94914358a..e47b64788 100644
--- a/apps/api/src/opendirector_api/localization.py
+++ b/apps/api/src/opendirector_api/localization.py
@@ -9,6 +9,9 @@
from fastapi import Request
+from opendirector.domain.language import wants_english_language
+from opendirector.domain.storyboard_errors import storyboard_error_message
+from opendirector.domain.camera_move_errors import camera_move_error_message, camera_move_conflict_message
from opendirector.domain.timeline_errors import timeline_error_message
from opendirector.domain.url_import import url_import_message
@@ -221,15 +224,6 @@
}
-def wants_english_language(value: str | None) -> bool:
- """Use the primary Accept-Language tag, matching the browser decision."""
- value = (value or "").strip()
- if not value:
- return False
- primary = value.split(",", 1)[0].split(";", 1)[0].strip().lower()
- return not primary.startswith("zh")
-
-
def wants_english(request: Request) -> bool:
return wants_english_language(request.headers.get("accept-language"))
@@ -242,7 +236,7 @@ def localized_error_for_language(
code: str = "operation_rejected",
required_capability: Capability | None = None,
) -> str:
- specific = (timeline_error_message(code, language) or url_import_message(code, language, chinese)
+ specific = (camera_move_error_message(code, language) or timeline_error_message(code, language) or storyboard_error_message(code, language) or url_import_message(code, language, chinese)
or contract_message(code, language, chinese))
if specific is not None:
return specific
@@ -312,6 +306,8 @@ def localized_error(
def localized_receipt(request: Request, receipt: CommandReceipt) -> CommandReceipt:
return receipt.model_copy(update={'issues': tuple(
- issue.model_copy(update={'message': localized_error(request, chinese=issue.message, status=422, code=issue.code)})
+ issue.model_copy(update={'message': camera_move_conflict_message(
+ localized_error(request, chinese=issue.message, status=422, code=issue.code),
+ (f'{item.cameraId}/{item.clipId}' for item in issue.cameraMoveConflicts))})
for issue in receipt.issues
)})
diff --git a/artifacts/director-stage/visual/v1-stage-shell-1700x1100.png b/artifacts/director-stage/visual/v1-stage-shell-1700x1100.png
new file mode 100644
index 000000000..4d1c8ccf4
Binary files /dev/null and b/artifacts/director-stage/visual/v1-stage-shell-1700x1100.png differ
diff --git a/artifacts/director-stage/visual/v1-stage-shell-1700x1100.zh-CN.png b/artifacts/director-stage/visual/v1-stage-shell-1700x1100.zh-CN.png
new file mode 100644
index 000000000..5854c8286
Binary files /dev/null and b/artifacts/director-stage/visual/v1-stage-shell-1700x1100.zh-CN.png differ
diff --git a/artifacts/director-stage/visual/v1-stage-shell-1920x1080.png b/artifacts/director-stage/visual/v1-stage-shell-1920x1080.png
new file mode 100644
index 000000000..90d6233bd
Binary files /dev/null and b/artifacts/director-stage/visual/v1-stage-shell-1920x1080.png differ
diff --git a/artifacts/director-stage/visual/v1-stage-shell-1920x1080.zh-CN.png b/artifacts/director-stage/visual/v1-stage-shell-1920x1080.zh-CN.png
new file mode 100644
index 000000000..cb8d71174
Binary files /dev/null and b/artifacts/director-stage/visual/v1-stage-shell-1920x1080.zh-CN.png differ
diff --git a/artifacts/director-stage/visual/v2-stage-dynamic-1700x1100.png b/artifacts/director-stage/visual/v2-stage-dynamic-1700x1100.png
new file mode 100644
index 000000000..7db517787
Binary files /dev/null and b/artifacts/director-stage/visual/v2-stage-dynamic-1700x1100.png differ
diff --git a/artifacts/director-stage/visual/v2-stage-dynamic-1700x1100.zh-CN.png b/artifacts/director-stage/visual/v2-stage-dynamic-1700x1100.zh-CN.png
new file mode 100644
index 000000000..54a12eec0
Binary files /dev/null and b/artifacts/director-stage/visual/v2-stage-dynamic-1700x1100.zh-CN.png differ
diff --git a/artifacts/director-stage/visual/v2-stage-dynamic-1920x1080.png b/artifacts/director-stage/visual/v2-stage-dynamic-1920x1080.png
new file mode 100644
index 000000000..8aaf1e4a9
Binary files /dev/null and b/artifacts/director-stage/visual/v2-stage-dynamic-1920x1080.png differ
diff --git a/artifacts/director-stage/visual/v2-stage-dynamic-1920x1080.zh-CN.png b/artifacts/director-stage/visual/v2-stage-dynamic-1920x1080.zh-CN.png
new file mode 100644
index 000000000..f29f9e865
Binary files /dev/null and b/artifacts/director-stage/visual/v2-stage-dynamic-1920x1080.zh-CN.png differ
diff --git a/artifacts/director-stage/visual/v5-stage-pip-1700x1100.png b/artifacts/director-stage/visual/v5-stage-pip-1700x1100.png
new file mode 100644
index 000000000..47bbd368f
Binary files /dev/null and b/artifacts/director-stage/visual/v5-stage-pip-1700x1100.png differ
diff --git a/artifacts/director-stage/visual/v5-stage-pip-1700x1100.zh-CN.png b/artifacts/director-stage/visual/v5-stage-pip-1700x1100.zh-CN.png
new file mode 100644
index 000000000..a8bacf8de
Binary files /dev/null and b/artifacts/director-stage/visual/v5-stage-pip-1700x1100.zh-CN.png differ
diff --git a/artifacts/director-stage/visual/v5-stage-pip-1920x1080.png b/artifacts/director-stage/visual/v5-stage-pip-1920x1080.png
new file mode 100644
index 000000000..2680b8b25
Binary files /dev/null and b/artifacts/director-stage/visual/v5-stage-pip-1920x1080.png differ
diff --git a/artifacts/director-stage/visual/v5-stage-pip-1920x1080.zh-CN.png b/artifacts/director-stage/visual/v5-stage-pip-1920x1080.zh-CN.png
new file mode 100644
index 000000000..c8975e1f7
Binary files /dev/null and b/artifacts/director-stage/visual/v5-stage-pip-1920x1080.zh-CN.png differ
diff --git a/artifacts/director-stage/visual/v5-stage-shoot-1700x1100.png b/artifacts/director-stage/visual/v5-stage-shoot-1700x1100.png
new file mode 100644
index 000000000..3e94dd631
Binary files /dev/null and b/artifacts/director-stage/visual/v5-stage-shoot-1700x1100.png differ
diff --git a/artifacts/director-stage/visual/v5-stage-shoot-1920x1080.png b/artifacts/director-stage/visual/v5-stage-shoot-1920x1080.png
new file mode 100644
index 000000000..7b35e3d42
Binary files /dev/null and b/artifacts/director-stage/visual/v5-stage-shoot-1920x1080.png differ
diff --git a/artifacts/director-stage/visual/v5-stage-view-settings-1700x1100.png b/artifacts/director-stage/visual/v5-stage-view-settings-1700x1100.png
new file mode 100644
index 000000000..221d7b8bf
Binary files /dev/null and b/artifacts/director-stage/visual/v5-stage-view-settings-1700x1100.png differ
diff --git a/artifacts/director-stage/visual/v5-stage-view-settings-1700x1100.zh-CN.png b/artifacts/director-stage/visual/v5-stage-view-settings-1700x1100.zh-CN.png
new file mode 100644
index 000000000..822319a79
Binary files /dev/null and b/artifacts/director-stage/visual/v5-stage-view-settings-1700x1100.zh-CN.png differ
diff --git a/artifacts/director-stage/visual/v5-stage-view-settings-1920x1080.png b/artifacts/director-stage/visual/v5-stage-view-settings-1920x1080.png
new file mode 100644
index 000000000..a7f2d70b0
Binary files /dev/null and b/artifacts/director-stage/visual/v5-stage-view-settings-1920x1080.png differ
diff --git a/artifacts/director-stage/visual/v5-stage-view-settings-1920x1080.zh-CN.png b/artifacts/director-stage/visual/v5-stage-view-settings-1920x1080.zh-CN.png
new file mode 100644
index 000000000..c9a7e16db
Binary files /dev/null and b/artifacts/director-stage/visual/v5-stage-view-settings-1920x1080.zh-CN.png differ
diff --git a/docs/README.md b/docs/README.md
index 86cc0fe69..031fd8b2c 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -27,6 +27,8 @@ This directory is the entry point for the repository's shared documentation. The
| [Bilingual interface](development/i18n.md) | Language selection, message organization, and checks | Language policy, message structure, or checks change |
| [H3 conditioning features](development/h3-conditioning-features.md) (中文) | Structure control, latent continuation, masked editing and keyframes for self-hosted H3 models, with measured results | The H3 request shapes or the vLLM-Omni capabilities they rely on change |
| [Python installation and packaging](development/packaging.md) | Installation, platform wheel builds, and isolated verification | Packaging, resource paths, or build process changes |
+| [Camera moves](guides/camera-moves.md) ([中文](guides/camera-moves.zh-CN.md)) | Existing-camera movement recipes, preview, channel ownership and Agent operations | Camera-move contracts, sampling or interactions change |
+| [Camera movement output acceptance](development/camera-moves-validation.md) | Frozen render provenance, decoded media accuracy and production interaction samples | Output or preview acceptance is repeated |
| [Business CLI](guides/cli.md) | Querying, editing, and generating through a terminal or Agent Shell | Commands, authorization, or receipt semantics change |
| [DeepSeek Harness plugin](../plugins/deepseek-harness/README.md) | Installing the DSH bundle and editing an OpenDirector project from DSH | Plugin setup, tools, or creation workflows change |
| [Video model capabilities](guides/video-model-capabilities.md) ([中文](guides/video-model-capabilities.zh-CN.md)) | Declaring output specifications supported by a service | Configuration fields or capability integration changes |
diff --git a/docs/development/camera-move-geometry.samples.json b/docs/development/camera-move-geometry.samples.json
new file mode 100644
index 000000000..d6cfeba51
--- /dev/null
+++ b/docs/development/camera-move-geometry.samples.json
@@ -0,0 +1,222 @@
+{
+ "measuredAt": "2026-12-04T09:28:27.983Z",
+ "projectId": "ef359c23-2cb0-4c14-9792-5dd35721ddc1",
+ "locale": "en-US",
+ "browser": "159.0.8154.6",
+ "viewport": {
+ "width": 1700,
+ "height": 1100
+ },
+ "dpr": 1,
+ "host": {
+ "platform": "linux",
+ "release": "5.15.167.4-microsoft-standard-WSL2",
+ "cpu": "Intel(R) Core(TM) i7-14650HX",
+ "logicalCpus": 24,
+ "load": [
+ 1.83,
+ 1.91,
+ 2.62
+ ],
+ "freeMemory": 7050600448
+ },
+ "renderer": "ANGLE (Google, Vulkan 1.3.0 (SwiftShader Device (Subzero) (0x0000C0DE)), SwiftShader driver)",
+ "samples": [
+ {
+ "kind": "geometry-pointer",
+ "index": 0,
+ "feedbackMs": 49,
+ "readyMs": 134.19999992847443
+ },
+ {
+ "kind": "geometry-pointer",
+ "index": 1,
+ "feedbackMs": 31.299999952316284,
+ "readyMs": 123.70000004768372
+ },
+ {
+ "kind": "geometry-pointer",
+ "index": 2,
+ "feedbackMs": 30.300000071525574,
+ "readyMs": 125.10000002384186
+ },
+ {
+ "kind": "geometry-pointer",
+ "index": 3,
+ "feedbackMs": 28.5,
+ "readyMs": 127.39999997615814
+ },
+ {
+ "kind": "geometry-pointer",
+ "index": 4,
+ "feedbackMs": 30.399999976158142,
+ "readyMs": 129.79999995231628
+ },
+ {
+ "kind": "geometry-pointer",
+ "index": 5,
+ "feedbackMs": 30.700000047683716,
+ "readyMs": 122.89999997615814
+ },
+ {
+ "kind": "geometry-pointer",
+ "index": 6,
+ "feedbackMs": 30.899999976158142,
+ "readyMs": 126.79999995231628
+ },
+ {
+ "kind": "geometry-pointer",
+ "index": 7,
+ "feedbackMs": 30.700000047683716,
+ "readyMs": 124.39999997615814
+ },
+ {
+ "kind": "geometry-pointer",
+ "index": 8,
+ "feedbackMs": 30.800000071525574,
+ "readyMs": 130.60000002384186
+ },
+ {
+ "kind": "geometry-pointer",
+ "index": 9,
+ "feedbackMs": 28.600000023841858,
+ "readyMs": 128.5
+ },
+ {
+ "kind": "geometry-pointer",
+ "index": 10,
+ "feedbackMs": 30.300000071525574,
+ "readyMs": 129.40000009536743
+ },
+ {
+ "kind": "geometry-pointer",
+ "index": 11,
+ "feedbackMs": 31.200000047683716,
+ "readyMs": 126.10000002384186
+ },
+ {
+ "kind": "geometry-keyboard",
+ "index": 0,
+ "feedbackMs": 22.5,
+ "readyMs": 122.79999995231628
+ },
+ {
+ "kind": "geometry-keyboard",
+ "index": 1,
+ "feedbackMs": 22,
+ "readyMs": 113.59999990463257
+ },
+ {
+ "kind": "geometry-keyboard",
+ "index": 2,
+ "feedbackMs": 22.799999952316284,
+ "readyMs": 109.79999995231628
+ },
+ {
+ "kind": "geometry-keyboard",
+ "index": 3,
+ "feedbackMs": 23.199999928474426,
+ "readyMs": 114.19999992847443
+ },
+ {
+ "kind": "geometry-keyboard",
+ "index": 4,
+ "feedbackMs": 23,
+ "readyMs": 116.70000004768372
+ },
+ {
+ "kind": "geometry-keyboard",
+ "index": 5,
+ "feedbackMs": 23.700000047683716,
+ "readyMs": 107
+ },
+ {
+ "kind": "geometry-keyboard",
+ "index": 6,
+ "feedbackMs": 25.899999976158142,
+ "readyMs": 126
+ },
+ {
+ "kind": "geometry-keyboard",
+ "index": 7,
+ "feedbackMs": 20.199999928474426,
+ "readyMs": 92.39999997615814
+ },
+ {
+ "kind": "geometry-keyboard",
+ "index": 8,
+ "feedbackMs": 23.899999976158142,
+ "readyMs": 123.89999997615814
+ },
+ {
+ "kind": "geometry-keyboard",
+ "index": 9,
+ "feedbackMs": 21.799999952316284,
+ "readyMs": 114
+ },
+ {
+ "kind": "geometry-keyboard",
+ "index": 10,
+ "feedbackMs": 21.200000047683716,
+ "readyMs": 104.40000009536743
+ },
+ {
+ "kind": "geometry-keyboard",
+ "index": 11,
+ "feedbackMs": 25.399999976158142,
+ "readyMs": 142.10000002384186
+ }
+ ],
+ "summary": {
+ "geometry-pointer": {
+ "feedbackP90": 30.899999976158142,
+ "readyMedian": 126.79999995231628,
+ "readyP90": 129.79999995231628
+ },
+ "geometry-keyboard": {
+ "feedbackP90": 25.399999976158142,
+ "readyMedian": 114,
+ "readyP90": 126
+ }
+ },
+ "build": {
+ "baseCommit": "e96b6d5df29ac8db26386cf90a983509c092c998",
+ "assets": {
+ "dist/assets/DirectorStage-Cv0dUxtr.css": "b25cc8b90478cf2bc2f9de7c86307b4aee1b18ac7f04d405d494eabb6c7d0143",
+ "dist/assets/DirectorStage-DusV1f-g.js": "4297256c8a6e67f56339c156a04d5146d235409472c40535f81c983f17b5266e",
+ "dist/assets/__vite-browser-external-BIHI7g3E.js": "82507b0bb9ac4affaeb17c40968d830cbd6d14a2ffa04d8994faf1a78e58e1b5",
+ "dist/assets/custom-coder-CSzaF0UD.js": "0922f11e1c5542934b216143c02cea12818a3486f29b75303c366f9358da5cf0",
+ "dist/assets/highlighted-body-OFNGDK62-CKKpAcSb.js": "2087789029e7db5eddd0502850b52c6949a4049eb5faabe8f21efdedb5982bf3",
+ "dist/assets/id3-LHI8bCc3.js": "2bc8dd650989aa10b23729cd90dd1c55edb43811684971790ece8ae66914b88e",
+ "dist/assets/index-CZ9OgKc0.css": "2eff419e03dc67e2ef93c91ecf1119a64cbc0dcb22c225c16bc864b7f25fb153",
+ "dist/assets/index-eiwXqPcR.js": "2f6ab733ae45fd961bcc9963209b156cecbe2d7c96557918bc33a6351f85cc1d",
+ "dist/assets/mediabunny-aac-encoder-BFYOcKQS.js": "8789834453be47972653efa25a4230c0c956c1f57ff0e6b0b3c6289863bfb9d4",
+ "dist/assets/mermaid-GHXKKRXX-C6Iv8iQa.js": "3cc9e8cc5f5fbc585c0883c7d7d8f05554d196439b55d80605cc8a40032c2dd8",
+ "dist/assets/mermaid-GHXKKRXX-DHbqWYcV.css": "588766799da176363e952f0592b26fa2bb10721e3c1a0aa3215812995b32184b",
+ "dist/assets/mp4Export-C4k2z7mP.js": "c98c8f6ee48dda4b97c73a855b74c724d07ca690c3ba46622340e8d2b1925993",
+ "dist/assets/src-g3FhOw64.js": "3452e79e80e78760c953a03e3ee1919d4e86021b1968cfc8f9d652c9a490424d",
+ "dist/assets/timelineRender-BnrH9jw4.js": "bd07969391c7fe0cf5f58517a196859523ac4008236216656991cad23cb32906"
+ },
+ "implementation": {
+ "src/canvas/StageCameraMoveGeometry.tsx": "9c28d6b01c436a0e4889da7971629ff96662c78a633f3903e1217d822fbf712d",
+ "src/canvas/StageCameraMoveEditor.tsx": "b099877724e1d8fd9b732b4bd16e0eda3c77de014ea46d4f4276c9cb026f2716",
+ "src/canvas/DirectorStage.tsx": "059a7ed429b34ad2bb66922ee0d96b4945efd1cbd1889d2d9e525140bfc09cba",
+ "src/canvas/stageGeometryControls.ts": "c3d9baa4b4d3aa83874b1c86f0c0534c0d0742215c7db28630606e36167fc8ea",
+ "src/canvas/director-stage.css": "df27f4cd3055aa467618decf2b79cd4c41b955cd26041eb49d5e768630e66ad2",
+ "src/i18n/messages/en-US/cameraMoves.ts": "30ef4d07cb2f6c4a1a8a3b24ee82f2a3a900e98494e1e885fd2791020a872479",
+ "src/i18n/messages/zh-CN/cameraMoves.ts": "a079e2f1ab66494bd5de612328967a6ff5f8b69d9f1cd46445c47c2ec422edef"
+ }
+ },
+ "fixture": {
+ "durationSeconds": 6,
+ "objects": 2,
+ "cameras": 2,
+ "movement": "push-in",
+ "geometry": "world X translation; keyboard X nudge; fixed surface during held gesture",
+ "warmupsPerKind": 2,
+ "measuredSamplesPerKind": 10,
+ "feedback": "changed draft field observed after paint from trusted pointer/key event",
+ "readiness": "changed decoded scene and camera pictures with no pending capture",
+ "scope": "new geometry interaction has no pre-feature baseline counterpart; absolute budgets only"
+ }
+}
diff --git a/docs/development/camera-moves-validation.md b/docs/development/camera-moves-validation.md
new file mode 100644
index 000000000..91aeb8060
--- /dev/null
+++ b/docs/development/camera-moves-validation.md
@@ -0,0 +1,412 @@
+# Camera movement output acceptance
+
+Earlier implementation evidence is preserved below; the latest combined review is
+recorded under [Review integration acceptance](#review-integration-acceptance--2026-12-04).
+
+This record covers the production browser camera-movement workflow and its frozen video output. The implementation and reproducible fixture are delivered with this document. The comparison baseline is `521a642a`; exact source and production bundle SHA-256 values, every latency sample and output fingerprints are retained in [the measurement record](camera-moves-validation.samples.json). The patched build was measured before committing; its source/bundle fingerprints identify that tree without attributing uncommitted changes to the baseline commit.
+
+## Workload and boundaries
+
+The tracked [production journey](../../tests/browser/director_stage_camera_moves_output.mjs) creates its own isolated project. It registers a real local GLB containing a magenta panel, adds a recognizable waving performer, a translating blue sphere, and red/green spatial landmarks. Three existing rigs carry a curved spiral rise, dolly zoom and roll. The spiral combines a 90° sweep and one metre rise; after the first acceptance a later edit changes it to 120°. The next accepted pinned render fixes that 120° recipe before another edit returns it to 90°.
+
+Both English and Chinese complete the same journey: wizard cancellation without a content change, destination selection, focus restoration, keyboard preview-time adjustment, pointer scrubbing, dual-view playback advancing while playing, Apply, acknowledged editor closure, numeric duration editing, reopening, an Agent retime, two exports, historical publication, conversion to editable ordinary channels and reopening again. Public HTTP rejection of an out-of-range timing edit is readable in each locale. Each finished run has no page errors or requests for development source/test modules. Wizard and output screenshots were visually inspected in both languages.
+
+The existing renderer runs in Chromium, using the browser GPU and H.264 encoder. The client must remain open. No paid model service, background renderer, remote rendering platform, new task engine or claim of rendering after browser closure is included. This is technical output verification; creative approval remains a separate decision.
+
+## Frozen acceptance and publication
+
+Rendering snapshots the effective stage before preparation. The browser test gates encoder capability preparation after that stage is accepted, queries the accepted revision, then changes the saved spiral recipe through the actual Agent command adapter before allowing frames to render. Frame expectations come from the public sampler on that exact accepted stage, at the same absolute timestamps.
+
+A public project-command regression exposed publication requiring the old editor CAS version and comparing frozen data to the current editor. An accepted video now validates its exact source and canvas identity in the recoverable historical snapshot. Its recorded source revision and accepted cursor remain historical facts. The current canvas binding, canvas version, edit ownership, locks and asset validation still apply. The change does not substitute a newer editor revision or modify current stage content; still publication and operations without a historical video plan retain current-source checks.
+
+Public tests additionally reject forged historical content, an unrelated cursor, a locked current target and a source/binding mismatch. They check unchanged state on rejection, identical receipt replay and reopening from disk. Browser publication proves that the stored execution document matches the accepted data while the editable document retains the later recipe.
+
+## Actual media results
+
+Each locale generated and decoded **two actual 1280 × 720 MP4 files**, one Storyboard output and one pinned spiral-camera output. Independent `ffprobe`/`ffmpeg` checks found **2.400000 seconds, 25/1 FPS and 60 decoded frames** for each. Storyboard cuts occur at 0.8 and 1.6 seconds, selecting spiral, dolly zoom and roll respectively; pinned output uses the spiral throughout.
+
+Representative frame indices are `0, 5, 10, 19, 20, 25, 30, 39, 40, 45, 50, 59`, evaluated at `frame / 25` seconds, including both cut boundaries. At every timestamp, decoded red/green sphere centres and the moving blue centre are compared with independently projected public camera/up samples. The magenta registered-model pixels must additionally appear at their known physical centre in the first front-facing frame. A flat panel becomes edge-on during an orbit, so its physical visibility is not assumed at every later timestamp. The gray unloaded placeholder cannot satisfy the magenta test.
+
+The declared acceptance tolerance is **less than 3 pixels at the 320 × 180 decoded analysis raster**, including antialiasing, H.264 chroma/quantization and downsampling. It is not the much tighter unencoded conversion tolerance. Spheres are grounded primitives: their local centre is 0.6 units above their root, scaled by the fixture's object scale. This physical offset is included in the projection oracle. The maximum measured displacement was **1.143768 pixels for Storyboard** and **2.475273 pixels for pinned spiral**, identical in both locale runs, over **37 observations per video**. This bounds the stated scene, projections and encoding settings; it does not establish a universal raster bound for arbitrary geometry, scales or GPUs.
+
+The retained measurement JSON includes each MP4 SHA-256, plan, accepted cursor and source revision. In both locales Storyboard records revision 5/cursor 12 and pinned output revision 6/cursor 15, with distinct execution snapshots. Raw MP4s, PNGs, full project snapshots and failure traces were retained outside Git; regenerating them requires only the tracked fixture and ordinary local dependencies.
+
+## Responsiveness
+
+Environment: Linux x86_64, Node 25.2.1, Python 3.12.3, Chromium 159.0.8154.6 with SwiftShader, 1700 × 1100 viewport, DPR 1. Baseline and patched measurements use the same local API, registered-media scene, controls, browser options and production build mode, run serially without concurrent test/build/browser workloads. Initial loading and export completion are excluded from routine interaction statistics.
+
+Each action retains 12 sequential pairs of feedback/readiness measurements. The first two are warmups; median and P90 use nearest-rank over the remaining ten. The clock starts on the trusted browser pointer/input event. Feedback requires the wizard or changed numeric time to have rendered, observed after a paint opportunity; readiness additionally requires both current preview images decoded, no pending refresh, and the captured timestamp matching the requested time. Keyboard arrows exercise the preview slider; pointer samples click alternating 30%/70% slider positions. Numeric duration editing is separately checked against stored state.
+
+| Build / locale | Action | Feedback P90 ms | Ready median ms | Ready P90 ms |
+| --- | --- | ---: | ---: | ---: |
+| Baseline / EN | Open wizard | 211.0 | 200.7 | 211.0 |
+| Baseline / EN | Keyboard time | 208.2 | 267.9 | 279.8 |
+| Baseline / EN | Pointer scrub | 219.4 | 200.1 | 219.4 |
+| Patched / EN | Open wizard | 9.7 | 81.1 | 89.6 |
+| Patched / EN | Keyboard time | 30.5 | 102.7 | 127.9 |
+| Patched / EN | Pointer scrub | 29.1 | 108.1 | 137.7 |
+| Patched / ZH | Open wizard | 10.5 | 83.6 | 89.2 |
+| Patched / ZH | Keyboard time | 32.9 | 108.7 | 137.0 |
+| Patched / ZH | Pointer scrub | 28.9 | 107.5 | 129.0 |
+
+The original feedback budget failed. A first change that merely deferred capture still failed (open 132.7 ms and keyboard 137.9 ms P90); it was not accepted. The final change also stops continuously rendering the covered main viewport while the movement modal owns its sampled views. One bounded capture task reads the latest request, allowing controls to paint first and preventing continuous clock updates from starving previews. Cancellation clears scheduled IDs, including React StrictMode effect replay. Captions retain the last captured time while a new frame is pending. The final distributions meet the unchanged budgets: feedback P90 ≤100 ms, readiness median ≤500 ms and P90 ≤1000 ms. They describe this loaded-view fixture, not cold opens, arbitrary heavy scenes, other machines or export throughput.
+
+Earlier retained harness failures included a nonexistent CSS selector, synthetic range input rejected by the trusted-event probe, an exact label against a wrapped select, a raw Agent response bypassing HTTP localization, treating a grounded sphere root as its centre, expecting a flat panel to stay visible edge-on, and assuming an omitted optional recipe list remained `[]`. These were corrected at the test boundary; no raster/latency threshold was increased. A preceding complete English run also passed before the matched pointer/model-color extensions.
+
+## Reproduction
+
+Use local Playwright and Chromium installations as described in the [validation guide](validation.md); set `PLAYWRIGHT_MODULE` and `CHROMIUM_PATH` when they are not discoverable. `ffmpeg` and `ffprobe` must be available. Run from this repository, in separate terminals:
+
+```sh
+npm run build
+PYTHONPATH=packages/core/src:apps/api/src .venv/bin/python tests/browser/creation_server.py --port 8065 --root /tmp/opendirector-creation-camera15-reproduce
+OPENDIRECTOR_API_URL=http://127.0.0.1:8065 npm run preview -- --port 5265 --strictPort
+```
+
+Then run both locales serially, each with a separate output directory:
+
+```sh
+DIRECTOR_STAGE_LOCALE=en-US CREATION_API_URL=http://127.0.0.1:8065 CREATION_WEB_URL=http://127.0.0.1:5265 CREATION_SCREENSHOTS=/tmp/camera15-evidence-en node tests/browser/director_stage_camera_moves_output.mjs
+DIRECTOR_STAGE_LOCALE=zh-CN CREATION_API_URL=http://127.0.0.1:8065 CREATION_WEB_URL=http://127.0.0.1:5265 CREATION_SCREENSHOTS=/tmp/camera15-evidence-zh node tests/browser/director_stage_camera_moves_output.mjs
+```
+
+`DIRECTOR_STAGE_PERF_ONLY=1` records raw timings without running exports or claiming that budgets passed; use it against an independently built baseline with the same fixture. The script writes success evidence only after every output and budget assertion passes. For a comparison, pin the baseline Git revision, build it in a separate directory and record its bundle hashes, without replacing the patched build during a run.
+
+Focused verification commands:
+
+```sh
+PYTHONPATH=packages/core/src:apps/api/src .venv/bin/python -m pytest tests/test_creation_director.py tests/test_director_agent_chain.py tests/test_director_stage_assets.py tests/test_creation_media_publication.py tests/test_creation_contracts.py -q
+node --test tests/creationClient.test.ts tests/creationEditorSession.test.ts tests/saveQueue.test.ts tests/stageCameraMoves.test.ts tests/stageTimeline.test.ts tests/stageStoryboardThumbnail.test.ts tests/directorStageViewState.test.ts tests/mediaPublication.test.ts
+npm run check:i18n
+npm run check:browser-manifest
+npm run check:browser-locale
+PYTHONPATH=packages/core/src:apps/api/src .venv/bin/python scripts/generate_contracts.py --check
+npm run build
+```
+
+Final focused verification passed: **405 Python tests**, **179 TypeScript tests**, generated contracts, the production TypeScript/Vite build, i18n (3,861 matching keys; no problems), browser manifest (125 entries) and browser locale checks (115 pages/126 scripts; no problems). The build retained the existing npm configuration/chunk-size notices, and Python retained the existing Starlette/httpx deprecation warning. The post-check production bundle/source hashes match the recorded measured build. A fresh Vite development run additionally opened and cancelled twelve wizards with both decoded preview images under React StrictMode; its timing samples are development-only and are not included in the production budget claim.
+
+## Whole-path orientation regression
+
+The existing camera-movement browser fixture also has a focused, production-safe
+orientation mode. It starts with horizontal up and a horizontal sightline: a
+180° half arc has valid endpoints but an invalid midpoint. Both locales require
+a readable rejection, disabled Apply and unchanged authoritative state after
+preview and cancellation. An elevated target then makes the complete sweep
+provably safe; the fixture checks two changing real preview images, one Apply
+revision and the persisted recipe/up after reopening. This mode does not render
+a video or measure latency; use the production output journey above for those.
+
+Run against the isolated API and Vite dev or production preview described above,
+using a separate output directory per locale:
+
+```sh
+DIRECTOR_STAGE_ORIENTATION_ONLY=1 DIRECTOR_STAGE_LOCALE=en-US CREATION_SCREENSHOTS=/tmp/camera-orientation-en node tests/browser/director_stage_camera_moves.mjs
+DIRECTOR_STAGE_ORIENTATION_ONLY=1 DIRECTOR_STAGE_LOCALE=zh-CN CREATION_SCREENSHOTS=/tmp/camera-orientation-zh node tests/browser/director_stage_camera_moves.mjs
+```
+
+Set `CREATION_API_URL` and `CREATION_WEB_URL` to those servers. Public backend
+regressions in `tests/test_creation_director.py` cover preview, command, Agent,
+full-document save and atomic rejection. Frontend regressions in
+`tests/stageCameraMoves.test.ts` cover shared validation, parsing, sampling and
+export acceptance. Their analytic and convex-cone proofs cover the complete
+path and held endpoint; selected output frames are supplementary evidence.
+
+
+## Ordinary camera up rendering / 普通相机上方向渲染
+
+Ordinary camera keys remain readable and editable when their authored up is zero
+or interpolation passes through zero. Rendering uses world +Y for zero or
+non-finite sampled up, independently of the preceding frame; it does not rewrite
+keys or promise continuous roll across opposed directions. Finite nonzero up is
+normalized after scaling, preserving the direction of huge and tiny components.
+The viewport, split previews, camera helpers, Storyboard thumbnails, stills and
+video output share this posing boundary.
+
+普通相机关键帧的上方向为零或插值经过零点时,工程仍可打开并继续编辑。
+渲染对零向量或非有限采样值使用世界 +Y 回退,且不依赖上一帧;此行为不会改写
+关键帧,也不保证相反方向之间的滚转连续。有限非零向量先缩放再归一化,以保留
+巨大或极小分量的方向。视口、分屏预览、机位辅助、分镜缩略图、静帧与视频共用
+这一摆位边界。
+
+The regression below uses an isolated fixture API and Vite development or preview
+server configured as above. It saves an ordinary camera edit, opens disk storage
+in a separate Python process, reloads both languages, then decodes and checks all
+72 frames of an actual 24 fps Storyboard MP4, including the exact opposed-key
+midpoint and huge authored up. It retains `storyboard.mp4`, decoded landmarks and
+screenshots in `CREATION_SCREENSHOTS` (default `/tmp/director-camera-up-rendering`).
+
+以下回归使用上述隔离 API 与 Vite 开发或预览服务:保存普通机位编辑,使用独立
+Python 进程从磁盘打开工程,重载中英文界面,再解码检查真实 24 fps 分镜 MP4
+的全部 72 帧,包括相反关键帧的零点及巨大上方向向量。视频、解码标记与截图
+保存在 `CREATION_SCREENSHOTS`(默认 `/tmp/director-camera-up-rendering`)。
+
+```sh
+node --test tests/stageCameraUpRendering.test.ts tests/stageCameraMoves.test.ts
+PYTHON=.venv/bin/python CREATION_API_URL=http://127.0.0.1:8065 CREATION_WEB_URL=http://127.0.0.1:5265 node tests/browser/director_stage_camera_up_rendering.mjs
+```
+
+## Preset catalog contract
+
+The Python domain catalog owns preset metadata. Regenerate its checked-in JSON
+and preset ID type using `python scripts/generate_camera_move_presets.py` after
+changing metadata. `python scripts/generate_contracts.py --check` includes these
+artifacts in the existing contract drift gate. The public
+`director.cameraMove.presets` query test compares the actual query result with
+the browser artifact, including bilingual names and descriptions.
+
+With the isolated creation API and Vite running, set `CREATION_API_URL` and
+`CREATION_WEB_URL`, then run:
+
+```sh
+DIRECTOR_STAGE_CATALOG_ONLY=1 DIRECTOR_STAGE_LOCALE=en-US node tests/browser/director_stage_camera_moves.mjs
+DIRECTOR_STAGE_CATALOG_ONLY=1 DIRECTOR_STAGE_LOCALE=zh-CN node tests/browser/director_stage_camera_moves.mjs
+```
+
+This checks every preset's initial numeric values, bounds and enum options
+through the real editor, then edits spiral height, applies the recipe, inspects
+the authoritative project query and reopens its saved UI. Geometry sampling
+remains runtime-specific; this contract does not replace path admission checks.
+
+## Temporary draft geometry / 临时草稿几何控制
+
+The public browser journey uses real THREE world-axis handles, shared rendered
+scene/camera pictures, keyboard and numeric alternatives, and authoritative
+project queries. Run against the isolated creation API and Vite development or
+production preview server. No provider or remote model is involved.
+
+该公共浏览器流程使用真实 THREE 世界轴手柄、共享场景与机位渲染图、键盘与
+数值替代操作,并查询权威工程状态;针对隔离 API 和 Vite 开发或生产预览服务
+运行,不调用远程模型。
+
+```sh
+DIRECTOR_STAGE_GEOMETRY_ONLY=1 DIRECTOR_STAGE_GEOMETRY_OUTPUT=1 DIRECTOR_STAGE_LOCALE=en-US node tests/browser/director_stage_camera_moves.mjs
+DIRECTOR_STAGE_GEOMETRY_ONLY=1 DIRECTOR_STAGE_GEOMETRY_OUTPUT=1 DIRECTOR_STAGE_LOCALE=zh-CN node tests/browser/director_stage_camera_moves.mjs
+# Invalid initial movement from a rolled source camera, with real handle correction.
+DIRECTOR_STAGE_GEOMETRY_ONLY=1 DIRECTOR_STAGE_GEOMETRY_ROLLED_INVALID=1 node tests/browser/director_stage_camera_moves.mjs
+# Separate production timing run; first two actions of each kind are warmups.
+DIRECTOR_STAGE_GEOMETRY_ONLY=1 DIRECTOR_STAGE_GEOMETRY_PERF=1 node tests/browser/director_stage_camera_moves.mjs
+```
+
+The rolled-source variant also starts with a 30° rolled camera only 0.5 m from
+its target, rejects the default 1 m push-in, and corrects it with two actual
+camera-handle drags. A director scene framing is used even without an existing
+movement; overlay and picture use the shared poseStagePreviewCamera contract.
+
+滚转来源变体从滚转 30°、距离目标仅 0.5 米的相机开始,拒绝默认 1 米推近,
+再用两次真实相机手柄拖动修正。即使没有现有运镜,场景仍使用导演取景;手柄
+与图片共用 poseStagePreviewCamera 姿态契约。
+
+The fixture checks actual camera and target drags, pointer-cancel/blur rollback,
+keyboard world-axis edits, backward retention, invalid geometry correction,
+independent playback time, one logical Apply receipt, newer focus preservation,
+cancel/Escape/close without a project edit, independent disk reopening, twelve
+repeated geometry opens, and a 24 fps MP4 from the saved geometry edit. Its
+moving-cube landmarks are decoded at exact frame timestamps and compared with
+an independent literal push-in projection. This unit cube is ground-anchored:
+its physical centre is 0.5 m above its authored origin. The 5 px centroid bound
+at 320 × 180 accounts for the projected cube's finite extent and video encoding;
+it is a separate workload from the existing 3 px sphere-landmark output check.
+Artifacts
+include the actual recipe, before/after document queries, command receipts and
+bilingual screenshots. Asset imports preparing Apply thumbnails are recorded
+separately from its single logical project batch. Timing starts at trusted
+pointer/key events; first feedback requires a changed draft field after paint,
+and readiness requires changed, decoded dual views with no capture pending.
+Raw samples and nearest-rank percentiles are retained in geometry-performance.json.
+
+该夹具检查相机与目标真实拖动、指针取消/失焦回退、世界轴键盘调整、后退保留、
+非法几何修正、独立播放时钟、单次正式应用、新焦点保留、取消/Escape/关闭不改
+工程,以及保存重开。证据包含实际运镜配方、前后文档查询、操作回执与双语截图。
+应用前缩略图准备的素材导入与单次逻辑工程批操作分别记录。计时从真实指针或
+键盘事件开始,首反馈要求绘制后的草稿字段已变化,就绪要求双图已更新解码且
+没有待处理捕获;geometry-performance.json 保留原始样本和最近秩百分位数。
+
+Production draft geometry measurement (2026-12-04): headless Chromium 159,
+SwiftShader, 1700 × 1100, DPR 1. Each action kind has twelve raw samples with
+two warmups excluded from nearest-rank percentiles. The complete raw samples,
+host, source and production bundle hashes are retained in
+[camera-move-geometry.samples.json](camera-move-geometry.samples.json).
+
+| Action | Feedback P90 | Ready median | Ready P90 |
+| --- | ---: | ---: | ---: |
+| World-X handle drag | 30.90 ms | 126.80 ms | 129.80 ms |
+| Keyboard X nudge | 25.40 ms | 114.00 ms | 126.00 ms |
+
+Both kinds satisfy the 100 / 500 / 1000 ms routine interaction budgets. These
+are new geometry actions with no corresponding control in the archived
+baseline; they establish absolute responsiveness, not a before/after speedup.
+They do not replace the integrated output/performance acceptance run.
+
+生产草稿几何测量(2026-12-04):无头 Chromium 159、SwiftShader、1700 × 1100、
+DPR 1。每类十二个原始样本,排除前两个预热后计算最近秩百分位数;上述 JSON
+保留全部样本、主机、源码和生产包哈希。世界 X 轴拖动的首反馈 P90 / 就绪中位数 /
+就绪 P90 为 30.90 / 126.80 / 129.80 毫秒;键盘 X 调整为 25.40 / 114.00 /
+126.00 毫秒,均满足 100 / 500 / 1000 毫秒预算。归档基线没有该几何控制,
+这些数值只证明绝对响应时间,不代表前后加速;集成后的输出与性能验收仍需单独运行。
+
+## Review integration acceptance — 2026-12-04
+
+This section records the combined orientation, ordinary-up rendering, shared
+catalog and temporary geometry changes. Earlier sections and their original
+samples remain historical evidence. The `reviewIntegration` record in
+[camera-moves-validation.samples.json](camera-moves-validation.samples.json)
+contains the new raw samples, project identities, environment, exact source and
+production bundle hashes, accepted recipes, media fingerprints and output
+summaries. The final runtime was built from integrated base
+`44c5f9b504beeb6e7c2ef24b409f2b78e499cdce`; the expanded browser harness is
+identified separately by SHA256. The independently built comparison baseline is
+`1f478ff74a1f4c69bc179d4205e50d0c859080cb`.
+
+The default production output journey now combines these capabilities in one
+project per locale. It compares actual preset options, translated names,
+spiral defaults and bounds with the live Agent catalog; drags real camera and
+target world-X handles; changes numeric target height; and checks new decoded
+scene and camera previews. Identical vertical, up-collinear geometry is rejected
+by the UI, Agent preview and Agent put without changing the saved document.
+Cancel preserves the formal document and main playhead. Reopening and explicitly
+applying the geometry-derived values produces one logical movement batch;
+thumbnail asset preparation and the later stage-close save are distinct.
+
+While that saved recipe is open, an Agent changes the same clip and camera name.
+The journey waits for the browser's real project-projection response containing
+the newer document, observes that the mounted editor retains its original
+basis, and verifies that Apply still sends that original revision. The explicit
+`revision_conflict` preserves both the Agent's persisted edit and the user's
+geometry draft. Close/reopen reads the confirmed recipe; it does not save the
+stale parent editor to dismiss it. This exercised the existing protection and
+did not require a separate UI conflict exception.
+
+A fresh Python process/store independently reopens both the saved recipe and
+converted keys from disk. Conversion compares positions, targets, FOV and up at
+all 25 fps output timestamps, the endpoint, and an independent fractional time;
+the declared 0.00003 m / 0.00003° / 0.0000003 vector bounds remain unchanged.
+The original curved path, dolly zoom, roll and accepted-input publication
+scenario is retained. Each render is accepted before a later Agent recipe edit;
+published provenance and its execution document must equal the frozen source.
+
+| Locale | Strategy | Accepted editor revision | Decoded frames | Maximum landmark error |
+| --- | --- | ---: | ---: | ---: |
+| en-US | Storyboard | 6 | 60 | 1.16082 px |
+| en-US | Pinned spiral | 7 | 60 | 1.87928 px |
+| zh-CN | Storyboard | 6 | 60 | 1.16082 px |
+| zh-CN | Pinned spiral | 7 | 60 | 1.87928 px |
+
+All four real H.264 MP4s are 1280 × 720, 25 fps and 2.4 seconds. At the same
+absolute `frame / 25` times, 37 physical sphere/panel landmark comparisons per
+video cover twelve frames, including both sides of the 0.8 / 1.6 second cuts.
+The unchanged bound is **3 px at 320 × 180** after decoding. The registered GLB
+bytes retain fingerprint
+`sha256:672727744b8734a5ede57c3f9ae169126089e86830c4d6d22e2713d6cba3482f`.
+Storyboard accepts the geometry-edited 75° spiral, then dolly and 70° roll;
+pinned output accepts its subsequently edited 120° spiral. The flat panel is
+checked front-facing at frame zero; the spheres remain checked throughout.
+These checks establish representative technical motion, not creative approval.
+
+The complementary ordinary-up journey ran against the same final production
+bundle. It preserves authored zero, opposed and huge up keys through an ordinary
+edit, independent disk reopening and Chinese/English reloads. A real 3 second,
+24 fps, 72-frame Storyboard MP4 is decoded at every frame, including the exact
+opposed-up midpoint. Zero/nonfinite sampled up uses world +Y without rewriting
+keys; the nonfinite case is tested at the public Node renderer boundary because
+project JSON cannot persist nonfinite numbers. No fallback camera was added to
+the curved/dolly/roll comparison scene.
+
+### Serial production responsiveness
+
+The archived baseline and final builds ran serially on one browser with no
+competing team build/test/browser workloads, from 14:34–14:39 UTC. Both use the
+same 1700 × 1100, DPR 1, Chromium 159/SwiftShader environment and fixture on an
+Intel i7-14650HX WSL2 host. Each kind retains twelve raw trials; the first two are
+warmups and the remaining ten use nearest-rank percentiles. Comparable open,
+keyboard preview scrub and pointer preview scrub measurements happen before the
+added geometry edits. Geometry is an additional final-only workload; the
+baseline has no corresponding control. No speedup is inferred from that added
+workload or from normal variation between the other samples.
+
+| Build / locale | Action | Feedback P90 | Ready median | Ready P90 |
+| --- | --- | ---: | ---: | ---: |
+| Baseline en-US | Open | 13.0 ms | 78.1 ms | 98.5 ms |
+| Baseline en-US | Keyboard scrub | 32.7 ms | 131.8 ms | 147.9 ms |
+| Baseline en-US | Pointer scrub | 29.0 ms | 112.6 ms | 129.4 ms |
+| Baseline zh-CN | Open | 14.6 ms | 83.9 ms | 95.9 ms |
+| Baseline zh-CN | Keyboard scrub | 32.5 ms | 110.7 ms | 132.8 ms |
+| Baseline zh-CN | Pointer scrub | 28.9 ms | 112.1 ms | 126.9 ms |
+| Final en-US | Open | 12.2 ms | 84.7 ms | 89.3 ms |
+| Final en-US | Keyboard scrub | 31.7 ms | 109.7 ms | 132.1 ms |
+| Final en-US | Pointer scrub | 29.2 ms | 105.2 ms | 124.3 ms |
+| Final en-US | Geometry drag | 65.0 ms | 181.3 ms | 190.7 ms |
+| Final zh-CN | Open | 12.4 ms | 81.8 ms | 89.1 ms |
+| Final zh-CN | Keyboard scrub | 31.6 ms | 130.4 ms | 136.0 ms |
+| Final zh-CN | Pointer scrub | 29.6 ms | 106.4 ms | 125.0 ms |
+| Final zh-CN | Geometry drag | 64.8 ms | 181.8 ms | 197.5 ms |
+
+All final workloads pass the unchanged feedback P90 ≤ 100 ms, ready median
+≤ 500 ms and ready P90 ≤ 1,000 ms budgets. Geometry timers start on a trusted
+pointerdown; first feedback requires a changed endpoint field after paint, and
+readiness requires both new decoded pictures with no pending capture. Endpoint
+values and trial identities are retained. The generic scrub output check is
+not used as geometry feedback.
+
+### Reproduce the integrated review
+
+Use the existing reproduction prerequisites, then start the isolated API and
+production preview (the fixture root must be directly under system temporary
+storage):
+
+```sh
+npm run build
+PYTHONPATH=packages/core/src:apps/api/src .venv/bin/python tests/browser/creation_server.py --port 8076 --root /tmp/opendirector-creation-camera-review05
+OPENDIRECTOR_API_URL=http://127.0.0.1:8076 npm run preview -- --port 5276 --strictPort
+```
+
+Run sequentially with distinct evidence directories; set `PLAYWRIGHT_MODULE`
+and `CHROMIUM_PATH` for the installed browser. The established tracked
+Playwright/Chromium headless-shell workflow was used after the preferred
+agent-browser CLI stalled in earlier stage inspection.
+
+```sh
+DIRECTOR_STAGE_LOCALE=en-US CREATION_API_URL=http://127.0.0.1:8076 CREATION_WEB_URL=http://127.0.0.1:5276 CREATION_SCREENSHOTS=/tmp/camera-review05-en node tests/browser/director_stage_camera_moves_output.mjs
+DIRECTOR_STAGE_LOCALE=zh-CN CREATION_API_URL=http://127.0.0.1:8076 CREATION_WEB_URL=http://127.0.0.1:5276 CREATION_SCREENSHOTS=/tmp/camera-review05-zh node tests/browser/director_stage_camera_moves_output.mjs
+PYTHON=.venv/bin/python CREATION_API_URL=http://127.0.0.1:8076 CREATION_WEB_URL=http://127.0.0.1:5276 CREATION_SCREENSHOTS=/tmp/camera-review05-up node tests/browser/director_stage_camera_up_rendering.mjs
+```
+
+Build the comparison revision separately and serve it on another port. Run this
+checkout's output script with `DIRECTOR_STAGE_PERF_ONLY=1` against that preview
+in each locale. This omits geometry, publishing and exports, preserves the same
+common input sequence and records raw metrics without claiming output acceptance.
+Do not replace either build while measuring. The earlier failed schema/selector
+and stale-editor dismissal attempts, plus an informal overlapping-check run,
+remain separate raw artifact directories; their timings are excluded here.
+
+Focused shared verification passed: **422 Python tests**, **187 Node tests**
+(including ordinary-up rendering), generated contracts, production build,
+i18n (3,867 keys, zero problems), browser manifest (126 entries) and browser
+locale checks (116 pages / 127 scripts, zero problems). Existing npm/chunk-size
+notices and the Starlette/httpx deprecation warning remain. Final bilingual
+geometry screenshots were visually inspected; translated controls fit and user
+fixture names retain their authored values.
+
+本节是审查补全后的联合验收,前文与旧样本保留为历史记录。中英文各在同一工程中
+完成真实相机/目标几何拖动、数值编辑、目录对照、相同非法姿态拒绝、取消、单次
+正式应用、同一配方的 Agent 并发编辑冲突、冻结导出版本、转换和独立磁盘重开。
+四个真实视频各 60 帧,最大标记误差为 1.87928 像素,未放宽 320 × 180 下的
+3 像素边界。最终所有交互均满足 100 / 500 / 1000 毫秒预算;新增几何操作没有
+旧版对应项,不宣称前后加速。另一个普通上方向流程在同一生产包下逐帧解码检查
+72 帧视频,保留原始关键帧及零点 +Y 回退。全部渲染使用现有浏览器参与模式,
+不调用付费模型、不提供关闭浏览器后的后台渲染,也不代替创意验收。
+
+Supplementary final regressions used the same isolated API and a Vite development
+server on port 5278 for the existing source-module seams. Orientation and the
+full thirteen-preset catalog passed in both languages; reviewed replacement,
+held local-input recovery and later-Agent-response recovery passed in English.
+Their `DIRECTOR_STAGE_ORIENTATION_ONLY`, `DIRECTOR_STAGE_CATALOG_ONLY`,
+`DIRECTOR_STAGE_REPLACEMENT_ONLY`, `DIRECTOR_STAGE_RECOVERY_ONLY` and
+`DIRECTOR_STAGE_RESPONSE_RECOVERY_ONLY` flags select the reproducible journeys
+in `tests/browser/director_stage_camera_moves.mjs`. Set the selected flag to `1`,
+`DIRECTOR_STAGE_LOCALE`, both server URLs and a distinct `CREATION_SCREENSHOTS`
+directory. These development runs add no production latency claim. One
+replacement attempt was interrupted by an unexplained clean SIGTERM of the
+isolated API after all production runs had completed; its connection-refused
+artifacts were retained, and a fresh project passed after restarting that API.
+The focused run identities and outcomes are retained in `reviewIntegration`.
diff --git a/docs/development/camera-moves-validation.samples.json b/docs/development/camera-moves-validation.samples.json
new file mode 100644
index 000000000..d175391d3
--- /dev/null
+++ b/docs/development/camera-moves-validation.samples.json
@@ -0,0 +1,3990 @@
+{
+ "schema": 1,
+ "environment": {
+ "os": "Linux x86_64",
+ "node": "25.2.1",
+ "python": "3.12.3",
+ "chromium": "159.0.8154.6",
+ "renderer": "SwiftShader",
+ "viewport": [
+ 1700,
+ 1100
+ ],
+ "devicePixelRatio": 1,
+ "export": [
+ 1280,
+ 720,
+ 25,
+ 2.4
+ ]
+ },
+ "sampleColumns": [
+ "feedbackMs",
+ "readyMs"
+ ],
+ "warmupsPerAction": 2,
+ "measuredPerAction": 10,
+ "percentile": "nearest-rank",
+ "baselineRevision": "521a642a26ac9e9d30ce99c13183dd92d508fb06",
+ "sourceSha256": {
+ "src/canvas/DirectorStage.tsx": "cbf280ec5342a05ff7ca43a2a8b8099ec99681252577756cf064ae7b5a4d188d",
+ "src/canvas/StageCameraMoveEditor.tsx": "0236142c9c69bd21ca83f9a90d6ea9d8a052dfeb1af8a582b1f70748283ba6f0",
+ "src/backend/mediaPublication.ts": "10c121913a72a25d9650170e1275afee35b8e9c3a6451b5da6ac20b2dfea6a67",
+ "packages/core/src/opendirector/domain/creation/commands.py": "14de8b32ea3479aefd9771b6605d2b6141b2e85832ba5db09ebfb085607d0693",
+ "packages/core/src/opendirector/application/creation_media_publication.py": "ffa550fc406e4f002fa0d34544a791f2e2085584f89b637f08bb7cd44a9e382d",
+ "tests/browser/director_stage_camera_moves_output.mjs": "e165e0f0c6cf0a8df1310ef4e626f1693457fb7dcf54583564873a241e7d8a70"
+ },
+ "productionBundleSha256": {
+ "baseline": {
+ "DirectorStage-B23DgpyR.js": "79c38c775e77fc8ade3257ca1425c6796d042275c3e3c0da34857d2cd0332e49",
+ "index-CpaM-_bW.js": "4bfdaad3dd61fd2ac97c68df872f6c96f62005c498979c202839b3620d90ceca"
+ },
+ "accepted": {
+ "DirectorStage-DS8hYRvk.js": "768f095cf9a4b66ecc956f5bb058e7dde35258020c38d54523c9c8a216e52472",
+ "index-BtBOb3Bv.js": "84afd93dc42f7744372f113960e043dabd59751f0619b175d99ba141d08d9bdb"
+ }
+ },
+ "runs": [
+ {
+ "build": "baseline-en-US",
+ "locale": "en-US",
+ "samples": {
+ "open": [
+ [
+ 226.39999997615814,
+ 226.39999997615814
+ ],
+ [
+ 190,
+ 190
+ ],
+ [
+ 209,
+ 209
+ ],
+ [
+ 193.79999995231628,
+ 193.79999995231628
+ ],
+ [
+ 200.69999992847443,
+ 200.69999992847443
+ ],
+ [
+ 190.89999997615814,
+ 190.89999997615814
+ ],
+ [
+ 209.29999995231628,
+ 209.29999995231628
+ ],
+ [
+ 192.60000002384186,
+ 192.60000002384186
+ ],
+ [
+ 208,
+ 208
+ ],
+ [
+ 213.70000004768372,
+ 213.70000004768372
+ ],
+ [
+ 194.60000002384186,
+ 194.60000002384186
+ ],
+ [
+ 211,
+ 211
+ ]
+ ],
+ "numeric": [
+ [
+ 202.19999992847443,
+ 263.2999999523163
+ ],
+ [
+ 216,
+ 288.10000002384186
+ ],
+ [
+ 195.5,
+ 260.89999997615814
+ ],
+ [
+ 201.5,
+ 268.7999999523163
+ ],
+ [
+ 202.70000004768372,
+ 278
+ ],
+ [
+ 196.09999990463257,
+ 267.89999997615814
+ ],
+ [
+ 202.60000002384186,
+ 278.7000000476837
+ ],
+ [
+ 199.30000007152557,
+ 265.60000002384186
+ ],
+ [
+ 189.10000002384186,
+ 258.2999999523163
+ ],
+ [
+ 193.89999997615814,
+ 263.60000002384186
+ ],
+ [
+ 208.20000004768372,
+ 279.7999999523163
+ ],
+ [
+ 212.69999992847443,
+ 286.6999999284744
+ ]
+ ],
+ "pointer": [
+ [
+ 201.79999995231628,
+ 201.79999995231628
+ ],
+ [
+ 216.60000002384186,
+ 216.60000002384186
+ ],
+ [
+ 199.19999992847443,
+ 199.19999992847443
+ ],
+ [
+ 219.39999997615814,
+ 219.39999997615814
+ ],
+ [
+ 215.79999995231628,
+ 215.79999995231628
+ ],
+ [
+ 212.39999997615814,
+ 212.39999997615814
+ ],
+ [
+ 206.5,
+ 206.5
+ ],
+ [
+ 198.10000002384186,
+ 198.10000002384186
+ ],
+ [
+ 219.80000007152557,
+ 219.80000007152557
+ ],
+ [
+ 199,
+ 199
+ ],
+ [
+ 200.10000002384186,
+ 200.10000002384186
+ ],
+ [
+ 199.60000002384186,
+ 199.60000002384186
+ ]
+ ]
+ },
+ "summary": {
+ "open": {
+ "feedbackP90": 211,
+ "readyMedian": 200.69999992847443,
+ "readyP90": 211
+ },
+ "numeric": {
+ "feedbackP90": 208.20000004768372,
+ "readyMedian": 267.89999997615814,
+ "readyP90": 279.7999999523163
+ },
+ "pointer": {
+ "feedbackP90": 219.39999997615814,
+ "readyMedian": 200.10000002384186,
+ "readyP90": 219.39999997615814
+ }
+ }
+ },
+ {
+ "build": "accepted-en-US",
+ "locale": "en-US",
+ "samples": {
+ "open": [
+ [
+ 25.600000023841858,
+ 121
+ ],
+ [
+ 7,
+ 84.20000004768372
+ ],
+ [
+ 9.399999976158142,
+ 78.10000002384186
+ ],
+ [
+ 7.299999952316284,
+ 81.10000002384186
+ ],
+ [
+ 7.799999952316284,
+ 78.29999995231628
+ ],
+ [
+ 8.200000047683716,
+ 77.89999997615814
+ ],
+ [
+ 13.799999952316284,
+ 89.29999995231628
+ ],
+ [
+ 9.700000047683716,
+ 109.70000004768372
+ ],
+ [
+ 9,
+ 89.60000002384186
+ ],
+ [
+ 8.700000047683716,
+ 82
+ ],
+ [
+ 7.299999952316284,
+ 77.59999990463257
+ ],
+ [
+ 7.399999976158142,
+ 83.19999992847443
+ ]
+ ],
+ "numeric": [
+ [
+ 28.600000023841858,
+ 102.19999992847443
+ ],
+ [
+ 23.600000023841858,
+ 124
+ ],
+ [
+ 31.899999976158142,
+ 109.79999995231628
+ ],
+ [
+ 22,
+ 90.60000002384186
+ ],
+ [
+ 29.899999976158142,
+ 107.30000007152557
+ ],
+ [
+ 19.5,
+ 119.89999997615814
+ ],
+ [
+ 28.799999952316284,
+ 129.19999992847443
+ ],
+ [
+ 25.100000023841858,
+ 127.89999997615814
+ ],
+ [
+ 27.600000023841858,
+ 102.70000004768372
+ ],
+ [
+ 22.399999976158142,
+ 99.09999990463257
+ ],
+ [
+ 21.399999976158142,
+ 92.89999997615814
+ ],
+ [
+ 30.5,
+ 98
+ ]
+ ],
+ "pointer": [
+ [
+ 31.800000071525574,
+ 132.20000004768372
+ ],
+ [
+ 29,
+ 112.5
+ ],
+ [
+ 29.800000071525574,
+ 136.60000002384186
+ ],
+ [
+ 22.100000023841858,
+ 105.80000007152557
+ ],
+ [
+ 28.5,
+ 137.5
+ ],
+ [
+ 19.600000023841858,
+ 99.20000004768372
+ ],
+ [
+ 15.899999976158142,
+ 104.70000004768372
+ ],
+ [
+ 24.100000023841858,
+ 124.5
+ ],
+ [
+ 29.100000023841858,
+ 108.10000002384186
+ ],
+ [
+ 16.299999952316284,
+ 104.89999997615814
+ ],
+ [
+ 23.800000071525574,
+ 140.80000007152557
+ ],
+ [
+ 28.399999976158142,
+ 137.70000004768372
+ ]
+ ]
+ },
+ "summary": {
+ "open": {
+ "feedbackP90": 9.700000047683716,
+ "readyMedian": 81.10000002384186,
+ "readyP90": 89.60000002384186
+ },
+ "numeric": {
+ "feedbackP90": 30.5,
+ "readyMedian": 102.70000004768372,
+ "readyP90": 127.89999997615814
+ },
+ "pointer": {
+ "feedbackP90": 29.100000023841858,
+ "readyMedian": 108.10000002384186,
+ "readyP90": 137.70000004768372
+ }
+ }
+ },
+ {
+ "build": "accepted-zh-CN",
+ "locale": "zh-CN",
+ "samples": {
+ "open": [
+ [
+ 16,
+ 132.70000004768372
+ ],
+ [
+ 15.100000023841858,
+ 88.20000004768372
+ ],
+ [
+ 7.600000023841858,
+ 78
+ ],
+ [
+ 8,
+ 101.5
+ ],
+ [
+ 8.899999976158142,
+ 85.39999997615814
+ ],
+ [
+ 10.5,
+ 80.29999995231628
+ ],
+ [
+ 7.700000047683716,
+ 84.60000002384186
+ ],
+ [
+ 10.199999928474426,
+ 76.29999995231628
+ ],
+ [
+ 7.200000047683716,
+ 86.89999997615814
+ ],
+ [
+ 15.5,
+ 89.19999992847443
+ ],
+ [
+ 7.199999928474426,
+ 74.89999997615814
+ ],
+ [
+ 8.199999928474426,
+ 83.60000002384186
+ ]
+ ],
+ "numeric": [
+ [
+ 24,
+ 103.09999990463257
+ ],
+ [
+ 32.5,
+ 133
+ ],
+ [
+ 32.89999997615814,
+ 108.69999992847443
+ ],
+ [
+ 22.5,
+ 95.90000009536743
+ ],
+ [
+ 23.799999952316284,
+ 140.89999997615814
+ ],
+ [
+ 31.299999952316284,
+ 109.29999995231628
+ ],
+ [
+ 20.100000023841858,
+ 101.89999997615814
+ ],
+ [
+ 33.200000047683716,
+ 137
+ ],
+ [
+ 28.700000047683716,
+ 107.80000007152557
+ ],
+ [
+ 28.699999928474426,
+ 102.5
+ ],
+ [
+ 21.899999976158142,
+ 125.19999992847443
+ ],
+ [
+ 25.5,
+ 125.79999995231628
+ ]
+ ],
+ "pointer": [
+ [
+ 32.300000071525574,
+ 109.5
+ ],
+ [
+ 17.800000071525574,
+ 118.10000002384186
+ ],
+ [
+ 28.899999976158142,
+ 129
+ ],
+ [
+ 29,
+ 103.29999995231628
+ ],
+ [
+ 21.399999976158142,
+ 107.5
+ ],
+ [
+ 26.100000023841858,
+ 109.89999997615814
+ ],
+ [
+ 28.799999952316284,
+ 131.60000002384186
+ ],
+ [
+ 25.5,
+ 109.69999992847443
+ ],
+ [
+ 28.600000023841858,
+ 105.30000007152557
+ ],
+ [
+ 19.59999990463257,
+ 107.5
+ ],
+ [
+ 24.800000071525574,
+ 102.60000002384186
+ ],
+ [
+ 17.799999952316284,
+ 102.79999995231628
+ ]
+ ]
+ },
+ "summary": {
+ "open": {
+ "feedbackP90": 10.5,
+ "readyMedian": 83.60000002384186,
+ "readyP90": 89.19999992847443
+ },
+ "numeric": {
+ "feedbackP90": 32.89999997615814,
+ "readyMedian": 108.69999992847443,
+ "readyP90": 137
+ },
+ "pointer": {
+ "feedbackP90": 28.899999976158142,
+ "readyMedian": 107.5,
+ "readyP90": 129
+ }
+ }
+ }
+ ],
+ "outputs": [
+ {
+ "locale": "en-US",
+ "projectId": "a43b0827-d19d-4ff8-8850-ee313de74008",
+ "source": "storyboard",
+ "sha256": "c96e5d768c8e9a172104d57bd8c2e151418077f2bbb87dbaa15eef775373523c",
+ "evidence": {
+ "acceptedProjectCursor": 12,
+ "sourceEditorId": "1bf02c63-8883-495f-bd83-b8f1321f0443",
+ "sourceEditorRevision": 5,
+ "plan": {
+ "cameraSource": "storyboard",
+ "cameraId": null,
+ "width": 1280,
+ "height": 720,
+ "durationSeconds": 2.4,
+ "frameRate": 25
+ }
+ },
+ "duration": 2.4,
+ "fps": "25/1",
+ "frames": "60",
+ "observations": 37,
+ "maximumError320px": 1.143767257722961
+ },
+ {
+ "locale": "en-US",
+ "projectId": "a43b0827-d19d-4ff8-8850-ee313de74008",
+ "source": "spiral",
+ "sha256": "00cf3ed25a93029662bd0fd68c969c204f1f7f3b988ffdd263a51d8d9710e994",
+ "evidence": {
+ "acceptedProjectCursor": 15,
+ "sourceEditorId": "1bf02c63-8883-495f-bd83-b8f1321f0443",
+ "sourceEditorRevision": 6,
+ "plan": {
+ "cameraSource": "camera",
+ "cameraId": "spiral",
+ "width": 1280,
+ "height": 720,
+ "durationSeconds": 2.4,
+ "frameRate": 25
+ }
+ },
+ "duration": 2.4,
+ "fps": "25/1",
+ "frames": "60",
+ "observations": 37,
+ "maximumError320px": 2.475272036251813
+ },
+ {
+ "locale": "zh-CN",
+ "projectId": "59244e90-0b3e-4a48-b01a-8a5dd9aae02f",
+ "source": "storyboard",
+ "sha256": "571982792932abaf1ba91e29995a3a6436d010b2f09fb51c4ba7ea0cc0833a43",
+ "evidence": {
+ "acceptedProjectCursor": 12,
+ "sourceEditorId": "9328bdca-9a86-4a02-8da5-a1dc62fd4ee4",
+ "sourceEditorRevision": 5,
+ "plan": {
+ "cameraSource": "storyboard",
+ "cameraId": null,
+ "width": 1280,
+ "height": 720,
+ "durationSeconds": 2.4,
+ "frameRate": 25
+ }
+ },
+ "duration": 2.4,
+ "fps": "25/1",
+ "frames": "60",
+ "observations": 37,
+ "maximumError320px": 1.143767257722961
+ },
+ {
+ "locale": "zh-CN",
+ "projectId": "59244e90-0b3e-4a48-b01a-8a5dd9aae02f",
+ "source": "spiral",
+ "sha256": "a9f06e83c89c186c5b003af6abf6577d84a32bce484c1fc721bc8c94fd8ed8a5",
+ "evidence": {
+ "acceptedProjectCursor": 15,
+ "sourceEditorId": "9328bdca-9a86-4a02-8da5-a1dc62fd4ee4",
+ "sourceEditorRevision": 6,
+ "plan": {
+ "cameraSource": "camera",
+ "cameraId": "spiral",
+ "width": 1280,
+ "height": 720,
+ "durationSeconds": 2.4,
+ "frameRate": 25
+ }
+ },
+ "duration": 2.4,
+ "fps": "25/1",
+ "frames": "60",
+ "observations": 37,
+ "maximumError320px": 2.475272036251813
+ }
+ ],
+ "reviewIntegration": {
+ "date": "2026-12-04",
+ "scope": "Review integration 01–05; historical samples above remain unchanged",
+ "baselineBuild": {
+ "gitCommit": "1f478ff74a1f4c69bc179d4205e50d0c859080cb",
+ "build": "npm run build",
+ "buildExitCode": 0,
+ "buildLog": "/tmp/opendirector-camera-review/baseline-build.log",
+ "bundleSha256": {
+ "dist/index.html": "4295cdb842b5537dfc29719f9281e1894fab7543dddaed29c2344c420978a185",
+ "dist/assets/timelineRender-BhWAPhRK.js": "11c5f20a996f966187735dc63ae76652c86acf5554a3868353e660bdb3f9be7c",
+ "dist/assets/custom-coder-CSzaF0UD.js": "0922f11e1c5542934b216143c02cea12818a3486f29b75303c366f9358da5cf0",
+ "dist/assets/index-CZ9OgKc0.css": "2eff419e03dc67e2ef93c91ecf1119a64cbc0dcb22c225c16bc864b7f25fb153",
+ "dist/assets/index-BtBOb3Bv.js": "84afd93dc42f7744372f113960e043dabd59751f0619b175d99ba141d08d9bdb",
+ "dist/assets/DirectorStage-DS8hYRvk.js": "768f095cf9a4b66ecc956f5bb058e7dde35258020c38d54523c9c8a216e52472",
+ "dist/assets/open_director_logo-VLFVt7VI.png": "c68bbda2db93edfc638ca9974472b5bd5601b9b2c01880d5739142e8ce437203",
+ "dist/assets/canvas-en-US-BfXRv5Dk.webp": "47176ee44c0819d77fb8b6fc4363881e3e3cc59d533833f05d9bea66e17c80b3",
+ "dist/assets/__vite-browser-external-BIHI7g3E.js": "82507b0bb9ac4affaeb17c40968d830cbd6d14a2ffa04d8994faf1a78e58e1b5",
+ "dist/assets/mediabunny-aac-encoder-BoTc-zc9.js": "08fc9007dd4033378427f824ae4ad6ca062b95c8371f9aedf3b926213390e51c",
+ "dist/assets/moss-CvzmHDze.svg": "22dcee13e271125e23c4cea4a0e251bbc00c2f80852e71666b43f550d716c0ff",
+ "dist/assets/src-g3FhOw64.js": "3452e79e80e78760c953a03e3ee1919d4e86021b1968cfc8f9d652c9a490424d",
+ "dist/assets/mp4Export-TGs1Bnde.js": "68afc1ba4f1cd9552b455d0d1b9b79fc9228df005432a384723f52b07fd5933e",
+ "dist/assets/internlm-DDR49CDA.svg": "2507dd5e17f3ba47e0ed2c89181a677389a24620157aa4e56e9970dd5ecec2f9",
+ "dist/assets/canvas-zh-CN-CRMsmBME.webp": "78acfee5f68b63ee2a4bff002fe2de9820b073d8285ea79e8b92a3433ab5cbf9",
+ "dist/assets/mermaid-GHXKKRXX-DHbqWYcV.css": "588766799da176363e952f0592b26fa2bb10721e3c1a0aa3215812995b32184b",
+ "dist/assets/jiuwenswarm-CLYP6aTi.svg": "2fe205389ee2410bf3971f4b5baec73b4a29dbf8e7120fe994359b2dc329203b",
+ "dist/assets/open_director_logo_anim-CvdEwcN7.gif": "47ae10dab687ee905373c1d4682fbe89e3e1a85649cfb68554ee4b032c60f151",
+ "dist/assets/id3-LHI8bCc3.js": "2bc8dd650989aa10b23729cd90dd1c55edb43811684971790ece8ae66914b88e",
+ "dist/assets/mermaid-GHXKKRXX-BI2y1qS9.js": "4327507106a5da1c60634886011ecb434302e3e6f9a3f3d3265b3f57b3ea5424",
+ "dist/assets/highlighted-body-OFNGDK62-CIkbbYAi.js": "430db1da393d0f5cef8c4fc243a3ff68ed2f7ae39545384c394423e549c407f5",
+ "dist/assets/DirectorStage-Byasxm9a.css": "41cea098a09e3a9808bf23e57db568162ff36c3d4de1eefdf00a5d870fe8a225",
+ "dist/fonts/NunitoSans-OFL.txt": "d51d5ca233487ceb30d012c9a97e883ff7449a1fed2cd316871afd4ece4b38d4",
+ "dist/fonts/NotoSansCJKsc-Regular.otf": "2c76254f6fc379fddfce0a7e84fb5385bb135d3e399294f6eeb6680d0365b74b",
+ "dist/fonts/manifest.json": "e4a74ce2500366d31ad24fc038bbd3b6a92a0987881ce77dc930fe5b003c0884",
+ "dist/fonts/NunitoSans-Latin.woff2": "29e3890496844a9ea81975c52771c587c872b4eb317026422d1995b88d21b57d",
+ "dist/fonts/LICENSE.txt": "6a73f9541c2de74158c0e7cf6b0a58ef774f5a780bf191f2d7ec9cc53efe2bf2"
+ }
+ },
+ "finalBuild": {
+ "measuredAt": "2026-12-04T14:34:34.846950+00:00",
+ "baseCommit": "44c5f9b504beeb6e7c2ef24b409f2b78e499cdce",
+ "sourceSha256": {
+ "src/canvas/DirectorStage.tsx": "059a7ed429b34ad2bb66922ee0d96b4945efd1cbd1889d2d9e525140bfc09cba",
+ "src/canvas/StageCameraMoveEditor.tsx": "b099877724e1d8fd9b732b4bd16e0eda3c77de014ea46d4f4276c9cb026f2716",
+ "src/canvas/StageCameraMoveGeometry.tsx": "9c28d6b01c436a0e4889da7971629ff96662c78a633f3903e1217d822fbf712d",
+ "src/canvas/stageGeometryControls.ts": "c3d9baa4b4d3aa83874b1c86f0c0534c0d0742215c7db28630606e36167fc8ea",
+ "src/canvas/stageDocument.ts": "37c4ea4c50888b437352698e0f141664c91a351b6e7e55135f74e6b00b5d705d",
+ "src/canvas/stageCameraMoves.ts": "c550e71023aaaa552a4b9cf85dc3182ea4202ab33fe6fbca3b4a35dc9f3e87af",
+ "src/canvas/stageStoryboardThumbnailRender.ts": "469bcf79437d900379440baf53230356a98667d31ff92032862a1046463a3787",
+ "src/contracts/cameraMovePresets.json": "7195a2020f72c4a65e0e654531c92be529b1541cdfa626f29eddb7a39ddfd071",
+ "packages/core/src/opendirector/domain/creation/commands.py": "14de8b32ea3479aefd9771b6605d2b6141b2e85832ba5db09ebfb085607d0693",
+ "packages/core/src/opendirector/domain/creation/camera_moves.py": "62d3d60cc2d2fb39e40ad6e55a232a900afebefd9a13b408868c3d02dfd84004",
+ "tests/browser/director_stage_camera_moves_output.mjs": "bca2e3467e9a1ba6aea849b85c522497a051e1413fb72faa03b20ad1d530c465",
+ "tests/browser/director_stage_camera_up_rendering.mjs": "1bb60ea7b244f29555e5da4f9f7d47de931b26afa6578ee955e5e9c585f4a663"
+ },
+ "bundleSha256": {
+ "dist/assets/DirectorStage-Cv0dUxtr.css": "b25cc8b90478cf2bc2f9de7c86307b4aee1b18ac7f04d405d494eabb6c7d0143",
+ "dist/assets/DirectorStage-DusV1f-g.js": "4297256c8a6e67f56339c156a04d5146d235409472c40535f81c983f17b5266e",
+ "dist/assets/__vite-browser-external-BIHI7g3E.js": "82507b0bb9ac4affaeb17c40968d830cbd6d14a2ffa04d8994faf1a78e58e1b5",
+ "dist/assets/canvas-en-US-BfXRv5Dk.webp": "47176ee44c0819d77fb8b6fc4363881e3e3cc59d533833f05d9bea66e17c80b3",
+ "dist/assets/canvas-zh-CN-CRMsmBME.webp": "78acfee5f68b63ee2a4bff002fe2de9820b073d8285ea79e8b92a3433ab5cbf9",
+ "dist/assets/custom-coder-CSzaF0UD.js": "0922f11e1c5542934b216143c02cea12818a3486f29b75303c366f9358da5cf0",
+ "dist/assets/highlighted-body-OFNGDK62-CKKpAcSb.js": "2087789029e7db5eddd0502850b52c6949a4049eb5faabe8f21efdedb5982bf3",
+ "dist/assets/id3-LHI8bCc3.js": "2bc8dd650989aa10b23729cd90dd1c55edb43811684971790ece8ae66914b88e",
+ "dist/assets/index-CZ9OgKc0.css": "2eff419e03dc67e2ef93c91ecf1119a64cbc0dcb22c225c16bc864b7f25fb153",
+ "dist/assets/index-eiwXqPcR.js": "2f6ab733ae45fd961bcc9963209b156cecbe2d7c96557918bc33a6351f85cc1d",
+ "dist/assets/internlm-DDR49CDA.svg": "2507dd5e17f3ba47e0ed2c89181a677389a24620157aa4e56e9970dd5ecec2f9",
+ "dist/assets/jiuwenswarm-CLYP6aTi.svg": "2fe205389ee2410bf3971f4b5baec73b4a29dbf8e7120fe994359b2dc329203b",
+ "dist/assets/mediabunny-aac-encoder-BFYOcKQS.js": "8789834453be47972653efa25a4230c0c956c1f57ff0e6b0b3c6289863bfb9d4",
+ "dist/assets/mermaid-GHXKKRXX-C6Iv8iQa.js": "3cc9e8cc5f5fbc585c0883c7d7d8f05554d196439b55d80605cc8a40032c2dd8",
+ "dist/assets/mermaid-GHXKKRXX-DHbqWYcV.css": "588766799da176363e952f0592b26fa2bb10721e3c1a0aa3215812995b32184b",
+ "dist/assets/moss-CvzmHDze.svg": "22dcee13e271125e23c4cea4a0e251bbc00c2f80852e71666b43f550d716c0ff",
+ "dist/assets/mp4Export-C4k2z7mP.js": "c98c8f6ee48dda4b97c73a855b74c724d07ca690c3ba46622340e8d2b1925993",
+ "dist/assets/open_director_logo-VLFVt7VI.png": "c68bbda2db93edfc638ca9974472b5bd5601b9b2c01880d5739142e8ce437203",
+ "dist/assets/open_director_logo_anim-CvdEwcN7.gif": "47ae10dab687ee905373c1d4682fbe89e3e1a85649cfb68554ee4b032c60f151",
+ "dist/assets/src-g3FhOw64.js": "3452e79e80e78760c953a03e3ee1919d4e86021b1968cfc8f9d652c9a490424d",
+ "dist/assets/timelineRender-BnrH9jw4.js": "bd07969391c7fe0cf5f58517a196859523ac4008236216656991cad23cb32906",
+ "dist/fonts/LICENSE.txt": "6a73f9541c2de74158c0e7cf6b0a58ef774f5a780bf191f2d7ec9cc53efe2bf2",
+ "dist/fonts/NotoSansCJKsc-Regular.otf": "2c76254f6fc379fddfce0a7e84fb5385bb135d3e399294f6eeb6680d0365b74b",
+ "dist/fonts/NunitoSans-Latin.woff2": "29e3890496844a9ea81975c52771c587c872b4eb317026422d1995b88d21b57d",
+ "dist/fonts/NunitoSans-OFL.txt": "d51d5ca233487ceb30d012c9a97e883ff7449a1fed2cd316871afd4ece4b38d4",
+ "dist/fonts/manifest.json": "e4a74ce2500366d31ad24fc038bbd3b6a92a0987881ce77dc930fe5b003c0884",
+ "dist/index.html": "1c256494d8a9b1782ef7b44cd8442ed0f6b00b3c413bc77ef0440cbdc4baf950"
+ },
+ "buildLog": "/tmp/opendirector-camera-review/ticket05-build.log"
+ },
+ "measurement": {
+ "serial": true,
+ "competingTeamWorkloads": false,
+ "warmupsPerKind": 2,
+ "measuredPerKind": 10,
+ "percentile": "nearest-rank",
+ "budgetsMs": {
+ "feedbackP90": 100,
+ "readyMedian": 500,
+ "readyP90": 1000
+ },
+ "geometryBaseline": "No corresponding control; final-only workload"
+ },
+ "runs": [
+ {
+ "build": "baseline-en-US",
+ "measuredAt": "2026-12-04T14:35:09.665Z",
+ "projectId": "212a9beb-3769-4a93-90e6-5870ebf121b0",
+ "documentId": "b519e6bf-240e-48c6-bfac-7e7996c0ca73",
+ "locale": "en-US",
+ "host": {
+ "platform": "linux",
+ "release": "5.15.167.4-microsoft-standard-WSL2",
+ "cpu": "Intel(R) Core(TM) i7-14650HX",
+ "logicalCpus": 24,
+ "load": [
+ 2.32,
+ 3.09,
+ 2.9
+ ],
+ "freeMemory": 6791077888
+ },
+ "browser": "159.0.8154.6",
+ "viewport": {
+ "width": 1700,
+ "height": 1100
+ },
+ "dpr": 1,
+ "samples": [
+ {
+ "kind": "open",
+ "feedbackMs": 9,
+ "readyMs": 100
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 8.200000047683716,
+ "readyMs": 81.70000004768372
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 8.099999904632568,
+ "readyMs": 78.09999990463257
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 7.699999928474426,
+ "readyMs": 77.5
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 11.599999904632568,
+ "readyMs": 80.09999990463257
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 8.899999976158142,
+ "readyMs": 76.60000002384186
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 13,
+ "readyMs": 83.79999995231628
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 7.899999976158142,
+ "readyMs": 77.69999992847443
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 9,
+ "readyMs": 75
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 10.199999928474426,
+ "readyMs": 91
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 7.799999952316284,
+ "readyMs": 98.5
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 25.600000023841858,
+ "readyMs": 125.5
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 16.100000023841858,
+ "readyMs": 116.5
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 31.800000071525574,
+ "readyMs": 132.10000002384186
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 32.200000047683716,
+ "readyMs": 131.80000007152557
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 31.100000023841858,
+ "readyMs": 131.5
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 32.799999952316284,
+ "readyMs": 132.69999992847443
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 32.699999928474426,
+ "readyMs": 149.89999997615814
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 18.5,
+ "readyMs": 118.80000007152557
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 30.699999928474426,
+ "readyMs": 147.89999997615814
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 32.39999997615814,
+ "readyMs": 135.39999997615814
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 27.5,
+ "readyMs": 128.29999995231628
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 30.200000047683716,
+ "readyMs": 137.10000002384186
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 21.200000047683716,
+ "readyMs": 105.10000002384186
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 30.799999952316284,
+ "readyMs": 131.5
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 28.300000071525574,
+ "readyMs": 110.90000009536743
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 13,
+ "readyMs": 115.60000002384186
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 27,
+ "readyMs": 127.60000002384186
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 29.100000023841858,
+ "readyMs": 106.60000002384186
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 18.399999976158142,
+ "readyMs": 102.39999997615814
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 29,
+ "readyMs": 112.60000002384186
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 28.800000071525574,
+ "readyMs": 129.40000009536743
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 28.5,
+ "readyMs": 113.20000004768372
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 27.799999952316284,
+ "readyMs": 130.79999995231628
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 24.299999952316284,
+ "readyMs": 108.19999992847443
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 28.200000047683716,
+ "readyMs": 106.90000009536743
+ }
+ ],
+ "summary": {
+ "open": {
+ "feedbackP90": 13,
+ "readyMedian": 78.09999990463257,
+ "readyP90": 98.5
+ },
+ "numeric": {
+ "feedbackP90": 32.699999928474426,
+ "readyMedian": 131.80000007152557,
+ "readyP90": 147.89999997615814
+ },
+ "pointer": {
+ "feedbackP90": 29,
+ "readyMedian": 112.60000002384186,
+ "readyP90": 129.40000009536743
+ }
+ }
+ },
+ {
+ "build": "baseline-zh-CN",
+ "measuredAt": "2026-12-04T14:35:39.957Z",
+ "projectId": "4004a701-c8ad-4db4-b6b6-f6babb77ae3e",
+ "documentId": "6f80fe41-4e80-4dad-a4e3-34177e7cea6e",
+ "locale": "zh-CN",
+ "host": {
+ "platform": "linux",
+ "release": "5.15.167.4-microsoft-standard-WSL2",
+ "cpu": "Intel(R) Core(TM) i7-14650HX",
+ "logicalCpus": 24,
+ "load": [
+ 2.95,
+ 3.18,
+ 2.94
+ ],
+ "freeMemory": 6788087808
+ },
+ "browser": "159.0.8154.6",
+ "viewport": {
+ "width": 1700,
+ "height": 1100
+ },
+ "dpr": 1,
+ "samples": [
+ {
+ "kind": "open",
+ "feedbackMs": 27.90000009536743,
+ "readyMs": 127.10000002384186
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 11.400000095367432,
+ "readyMs": 88.5
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 14.600000023841858,
+ "readyMs": 83.89999997615814
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 8.5,
+ "readyMs": 80.89999997615814
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 13.300000071525574,
+ "readyMs": 96.30000007152557
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 11.799999952316284,
+ "readyMs": 92.59999990463257
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 9,
+ "readyMs": 82.5
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 7.799999952316284,
+ "readyMs": 79
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 14.5,
+ "readyMs": 95.90000009536743
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 10.100000023841858,
+ "readyMs": 81.80000007152557
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 8.399999976158142,
+ "readyMs": 85
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 15.799999952316284,
+ "readyMs": 89
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 13.799999952316284,
+ "readyMs": 88.20000004768372
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 23,
+ "readyMs": 93.70000004768372
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 24.299999952316284,
+ "readyMs": 103.39999997615814
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 19.399999976158142,
+ "readyMs": 136.60000002384186
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 28.299999952316284,
+ "readyMs": 110.69999992847443
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 32.5,
+ "readyMs": 132.80000007152557
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 31,
+ "readyMs": 114.20000004768372
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 31,
+ "readyMs": 104.80000007152557
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 22.699999928474426,
+ "readyMs": 96.29999995231628
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 17,
+ "readyMs": 117
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 32.5,
+ "readyMs": 132.69999992847443
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 17.800000071525574,
+ "readyMs": 95.70000004768372
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 19.299999952316284,
+ "readyMs": 119.60000002384186
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 28.700000047683716,
+ "readyMs": 103.20000004768372
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 21.40000009536743,
+ "readyMs": 122
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 30.799999952316284,
+ "readyMs": 126.89999997615814
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 14.800000071525574,
+ "readyMs": 109.10000002384186
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 17.59999990463257,
+ "readyMs": 111.39999997615814
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 19.100000023841858,
+ "readyMs": 119.39999997615814
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 28.700000047683716,
+ "readyMs": 108.10000002384186
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 16.699999928474426,
+ "readyMs": 117.09999990463257
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 28.600000023841858,
+ "readyMs": 129
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 28.899999976158142,
+ "readyMs": 112.10000002384186
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 12.899999976158142,
+ "readyMs": 98.19999992847443
+ }
+ ],
+ "summary": {
+ "open": {
+ "feedbackP90": 14.600000023841858,
+ "readyMedian": 83.89999997615814,
+ "readyP90": 95.90000009536743
+ },
+ "numeric": {
+ "feedbackP90": 32.5,
+ "readyMedian": 110.69999992847443,
+ "readyP90": 132.80000007152557
+ },
+ "pointer": {
+ "feedbackP90": 28.899999976158142,
+ "readyMedian": 112.10000002384186,
+ "readyP90": 126.89999997615814
+ }
+ }
+ },
+ {
+ "build": "en-US",
+ "measuredAt": "2026-12-04T14:36:18.087Z",
+ "projectId": "ae6a7e3c-34b6-4aea-9711-f5ea6b3a3cbd",
+ "documentId": "2c651b76-28de-477c-8e55-a3cfac70480b",
+ "locale": "en-US",
+ "host": {
+ "platform": "linux",
+ "release": "5.15.167.4-microsoft-standard-WSL2",
+ "cpu": "Intel(R) Core(TM) i7-14650HX",
+ "logicalCpus": 24,
+ "load": [
+ 2.98,
+ 3.14,
+ 2.93
+ ],
+ "freeMemory": 6724964352
+ },
+ "browser": "159.0.8154.6",
+ "viewport": {
+ "width": 1700,
+ "height": 1100
+ },
+ "dpr": 1,
+ "samples": [
+ {
+ "kind": "open",
+ "feedbackMs": 11.100000023841858,
+ "readyMs": 98.69999992847443
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 15,
+ "readyMs": 88.39999997615814
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 12.199999928474426,
+ "readyMs": 89.29999995231628
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 8.699999928474426,
+ "readyMs": 84.69999992847443
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 8.200000047683716,
+ "readyMs": 80.30000007152557
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 11.5,
+ "readyMs": 87.29999995231628
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 8.600000023841858,
+ "readyMs": 86.5
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 8.099999904632568,
+ "readyMs": 82
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 7.899999976158142,
+ "readyMs": 84.5
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 9.800000071525574,
+ "readyMs": 83.20000004768372
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 13.699999928474426,
+ "readyMs": 92.19999992847443
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 8.099999904632568,
+ "readyMs": 85.79999995231628
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 19.800000071525574,
+ "readyMs": 90.80000007152557
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 26.799999952316284,
+ "readyMs": 127.89999997615814
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 27.90000009536743,
+ "readyMs": 104.30000007152557
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 20.600000023841858,
+ "readyMs": 120.79999995231628
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 30.399999976158142,
+ "readyMs": 105.69999992847443
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 20.100000023841858,
+ "readyMs": 137.20000004768372
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 30.799999952316284,
+ "readyMs": 109.70000004768372
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 17.799999952316284,
+ "readyMs": 98.39999997615814
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 32.5,
+ "readyMs": 113.60000002384186
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 31.700000047683716,
+ "readyMs": 132.10000002384186
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 31.399999976158142,
+ "readyMs": 111.09999990463257
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 19.100000023841858,
+ "readyMs": 91.29999995231628
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 26.5,
+ "readyMs": 104.40000009536743
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 18.100000023841858,
+ "readyMs": 118.5
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 29.199999928474426,
+ "readyMs": 106.5
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 19.300000071525574,
+ "readyMs": 103.20000004768372
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 24.399999976158142,
+ "readyMs": 105.20000004768372
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 14.399999976158142,
+ "readyMs": 103.5
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 23.600000023841858,
+ "readyMs": 124.30000007152557
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 27.899999976158142,
+ "readyMs": 128.20000004768372
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 28.600000023841858,
+ "readyMs": 106.79999995231628
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 17.5,
+ "readyMs": 118.10000002384186
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 29.200000047683716,
+ "readyMs": 102.89999997615814
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 21.899999976158142,
+ "readyMs": 105.10000002384186
+ },
+ {
+ "kind": "geometry",
+ "index": 0,
+ "feedbackMs": 134.79999995231628,
+ "readyMs": 240.29999995231628,
+ "before": {
+ "x": 0,
+ "y": 2,
+ "z": 10
+ },
+ "after": {
+ "x": 0.40829612139278737,
+ "y": 2,
+ "z": 10
+ }
+ },
+ {
+ "kind": "geometry",
+ "index": 1,
+ "feedbackMs": 64,
+ "readyMs": 180.5,
+ "before": {
+ "x": 0.40829612139278737,
+ "y": 2,
+ "z": 10
+ },
+ "after": {
+ "x": -0.0012270572999177887,
+ "y": 2,
+ "z": 10
+ }
+ },
+ {
+ "kind": "geometry",
+ "index": 2,
+ "feedbackMs": 64.89999997615814,
+ "readyMs": 166,
+ "before": {
+ "x": -0.0012270572999177887,
+ "y": 2,
+ "z": 10
+ },
+ "after": {
+ "x": 0.40709803984121606,
+ "y": 2,
+ "z": 10
+ }
+ },
+ {
+ "kind": "geometry",
+ "index": 3,
+ "feedbackMs": 64.19999992847443,
+ "readyMs": 180.79999995231628,
+ "before": {
+ "x": 0.40709803984121606,
+ "y": 2,
+ "z": 10
+ },
+ "after": {
+ "x": -0.002449305822175063,
+ "y": 2,
+ "z": 10
+ }
+ },
+ {
+ "kind": "geometry",
+ "index": 4,
+ "feedbackMs": 64.5,
+ "readyMs": 181.19999992847443,
+ "before": {
+ "x": -0.002449305822175063,
+ "y": 2,
+ "z": 10
+ },
+ "after": {
+ "x": 0.4058949345623013,
+ "y": 2,
+ "z": 10
+ }
+ },
+ {
+ "kind": "geometry",
+ "index": 5,
+ "feedbackMs": 65,
+ "readyMs": 184.30000007152557,
+ "before": {
+ "x": 0.4058949345623013,
+ "y": 2,
+ "z": 10
+ },
+ "after": {
+ "x": -0.00368151470692224,
+ "y": 2,
+ "z": 10
+ }
+ },
+ {
+ "kind": "geometry",
+ "index": 6,
+ "feedbackMs": 64.29999995231628,
+ "readyMs": 182.29999995231628,
+ "before": {
+ "x": -0.00368151470692224,
+ "y": 2,
+ "z": 10
+ },
+ "after": {
+ "x": 0.40468503135714373,
+ "y": 2,
+ "z": 10
+ }
+ },
+ {
+ "kind": "geometry",
+ "index": 7,
+ "feedbackMs": 65,
+ "readyMs": 181.29999995231628,
+ "before": {
+ "x": 0.40468503135714373,
+ "y": 2,
+ "z": 10
+ },
+ "after": {
+ "x": -0.00491092582090813,
+ "y": 2,
+ "z": 10
+ }
+ },
+ {
+ "kind": "geometry",
+ "index": 8,
+ "feedbackMs": 64.70000004768372,
+ "readyMs": 190.70000004768372,
+ "before": {
+ "x": -0.00491092582090813,
+ "y": 2,
+ "z": 10
+ },
+ "after": {
+ "x": 0.4034748925749878,
+ "y": 2,
+ "z": 10
+ }
+ },
+ {
+ "kind": "geometry",
+ "index": 9,
+ "feedbackMs": 64.60000002384186,
+ "readyMs": 182.90000009536743,
+ "before": {
+ "x": 0.4034748925749878,
+ "y": 2,
+ "z": 10
+ },
+ "after": {
+ "x": -0.006150317908985681,
+ "y": 2,
+ "z": 10
+ }
+ },
+ {
+ "kind": "geometry",
+ "index": 10,
+ "feedbackMs": 63.299999952316284,
+ "readyMs": 196.39999997615814,
+ "before": {
+ "x": -0.006150317908985681,
+ "y": 2,
+ "z": 10
+ },
+ "after": {
+ "x": 0.40227144964057304,
+ "y": 2,
+ "z": 10
+ }
+ },
+ {
+ "kind": "geometry",
+ "index": 11,
+ "feedbackMs": 61.800000071525574,
+ "readyMs": 179.39999997615814,
+ "before": {
+ "x": 0.40227144964057304,
+ "y": 2,
+ "z": 10
+ },
+ "after": {
+ "x": -0.007366433349413892,
+ "y": 2,
+ "z": 10
+ }
+ }
+ ],
+ "summary": {
+ "open": {
+ "feedbackP90": 12.199999928474426,
+ "readyMedian": 84.69999992847443,
+ "readyP90": 89.29999995231628
+ },
+ "numeric": {
+ "feedbackP90": 31.700000047683716,
+ "readyMedian": 109.70000004768372,
+ "readyP90": 132.10000002384186
+ },
+ "pointer": {
+ "feedbackP90": 29.199999928474426,
+ "readyMedian": 105.20000004768372,
+ "readyP90": 124.30000007152557
+ },
+ "geometry": {
+ "feedbackP90": 65,
+ "readyMedian": 181.29999995231628,
+ "readyP90": 190.70000004768372
+ }
+ }
+ },
+ {
+ "build": "zh-CN",
+ "measuredAt": "2026-12-04T14:38:08.329Z",
+ "projectId": "bdbded23-aa21-4f11-8de8-f2b5a547f8ed",
+ "documentId": "2ab3e91e-2afe-4927-880a-50ed23db906c",
+ "locale": "zh-CN",
+ "host": {
+ "platform": "linux",
+ "release": "5.15.167.4-microsoft-standard-WSL2",
+ "cpu": "Intel(R) Core(TM) i7-14650HX",
+ "logicalCpus": 24,
+ "load": [
+ 5.94,
+ 3.82,
+ 3.18
+ ],
+ "freeMemory": 5399240704
+ },
+ "browser": "159.0.8154.6",
+ "viewport": {
+ "width": 1700,
+ "height": 1100
+ },
+ "dpr": 1,
+ "samples": [
+ {
+ "kind": "open",
+ "feedbackMs": 24.399999976158142,
+ "readyMs": 117.69999992847443
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 13.100000023841858,
+ "readyMs": 87.39999997615814
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 7.600000023841858,
+ "readyMs": 79.60000002384186
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 7.399999976158142,
+ "readyMs": 81.79999995231628
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 12.700000047683716,
+ "readyMs": 95
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 8.100000023841858,
+ "readyMs": 81.60000002384186
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 12.399999976158142,
+ "readyMs": 89.09999990463257
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 7.899999976158142,
+ "readyMs": 83.89999997615814
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 7.799999952316284,
+ "readyMs": 75.09999990463257
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 7.800000071525574,
+ "readyMs": 82.70000004768372
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 7.600000023841858,
+ "readyMs": 76.5
+ },
+ {
+ "kind": "open",
+ "feedbackMs": 8,
+ "readyMs": 85.39999997615814
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 25.399999976158142,
+ "readyMs": 125.89999997615814
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 28,
+ "readyMs": 128.39999997615814
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 23.799999952316284,
+ "readyMs": 127.59999990463257
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 25.600000023841858,
+ "readyMs": 105.79999995231628
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 18.800000071525574,
+ "readyMs": 136
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 31.600000023841858,
+ "readyMs": 132
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 31.799999952316284,
+ "readyMs": 132.60000002384186
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 30.200000047683716,
+ "readyMs": 130.39999997615814
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 29.399999976158142,
+ "readyMs": 145.79999995231628
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 28.899999976158142,
+ "readyMs": 111.89999997615814
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 31,
+ "readyMs": 130.60000002384186
+ },
+ {
+ "kind": "numeric",
+ "feedbackMs": 28.299999952316284,
+ "readyMs": 108.29999995231628
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 18.600000023841858,
+ "readyMs": 105.89999997615814
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 25.5,
+ "readyMs": 107.69999992847443
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 13.700000047683716,
+ "readyMs": 108.70000004768372
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 17.699999928474426,
+ "readyMs": 104.60000002384186
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 24.700000047683716,
+ "readyMs": 125
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 29.600000023841858,
+ "readyMs": 105.79999995231628
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 20.59999990463257,
+ "readyMs": 104.59999990463257
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 28.5,
+ "readyMs": 111.39999997615814
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 10.699999928474426,
+ "readyMs": 94.5
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 29.59999990463257,
+ "readyMs": 141
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 17.799999952316284,
+ "readyMs": 106.39999997615814
+ },
+ {
+ "kind": "pointer",
+ "feedbackMs": 23.200000047683716,
+ "readyMs": 124
+ },
+ {
+ "kind": "geometry",
+ "index": 0,
+ "feedbackMs": 31.800000071525574,
+ "readyMs": 148.40000009536743,
+ "before": {
+ "x": 0,
+ "y": 2,
+ "z": 10
+ },
+ "after": {
+ "x": 0.40829612139278737,
+ "y": 2,
+ "z": 10
+ }
+ },
+ {
+ "kind": "geometry",
+ "index": 1,
+ "feedbackMs": 61.89999997615814,
+ "readyMs": 178.30000007152557,
+ "before": {
+ "x": 0.40829612139278737,
+ "y": 2,
+ "z": 10
+ },
+ "after": {
+ "x": -0.0012270572999177887,
+ "y": 2,
+ "z": 10
+ }
+ },
+ {
+ "kind": "geometry",
+ "index": 2,
+ "feedbackMs": 64.80000007152557,
+ "readyMs": 181.30000007152557,
+ "before": {
+ "x": -0.0012270572999177887,
+ "y": 2,
+ "z": 10
+ },
+ "after": {
+ "x": 0.40709803984121606,
+ "y": 2,
+ "z": 10
+ }
+ },
+ {
+ "kind": "geometry",
+ "index": 3,
+ "feedbackMs": 63.799999952316284,
+ "readyMs": 180.29999995231628,
+ "before": {
+ "x": 0.40709803984121606,
+ "y": 2,
+ "z": 10
+ },
+ "after": {
+ "x": -0.002449305822175063,
+ "y": 2,
+ "z": 10
+ }
+ },
+ {
+ "kind": "geometry",
+ "index": 4,
+ "feedbackMs": 63.699999928474426,
+ "readyMs": 181.79999995231628,
+ "before": {
+ "x": -0.002449305822175063,
+ "y": 2,
+ "z": 10
+ },
+ "after": {
+ "x": 0.4058949345623013,
+ "y": 2,
+ "z": 10
+ }
+ },
+ {
+ "kind": "geometry",
+ "index": 5,
+ "feedbackMs": 64.60000002384186,
+ "readyMs": 187.10000002384186,
+ "before": {
+ "x": 0.4058949345623013,
+ "y": 2,
+ "z": 10
+ },
+ "after": {
+ "x": -0.00368151470692224,
+ "y": 2,
+ "z": 10
+ }
+ },
+ {
+ "kind": "geometry",
+ "index": 6,
+ "feedbackMs": 64.39999997615814,
+ "readyMs": 183.79999995231628,
+ "before": {
+ "x": -0.00368151470692224,
+ "y": 2,
+ "z": 10
+ },
+ "after": {
+ "x": 0.40468503135714373,
+ "y": 2,
+ "z": 10
+ }
+ },
+ {
+ "kind": "geometry",
+ "index": 7,
+ "feedbackMs": 30.699999928474426,
+ "readyMs": 147.29999995231628,
+ "before": {
+ "x": 0.40468503135714373,
+ "y": 2,
+ "z": 10
+ },
+ "after": {
+ "x": -0.00491092582090813,
+ "y": 2,
+ "z": 10
+ }
+ },
+ {
+ "kind": "geometry",
+ "index": 8,
+ "feedbackMs": 65.60000002384186,
+ "readyMs": 198.5,
+ "before": {
+ "x": -0.00491092582090813,
+ "y": 2,
+ "z": 10
+ },
+ "after": {
+ "x": 0.4034748925749878,
+ "y": 2,
+ "z": 10
+ }
+ },
+ {
+ "kind": "geometry",
+ "index": 9,
+ "feedbackMs": 64.80000007152557,
+ "readyMs": 197.5,
+ "before": {
+ "x": 0.4034748925749878,
+ "y": 2,
+ "z": 10
+ },
+ "after": {
+ "x": -0.006150317908985681,
+ "y": 2,
+ "z": 10
+ }
+ },
+ {
+ "kind": "geometry",
+ "index": 10,
+ "feedbackMs": 64.29999995231628,
+ "readyMs": 197.39999997615814,
+ "before": {
+ "x": -0.006150317908985681,
+ "y": 2,
+ "z": 10
+ },
+ "after": {
+ "x": 0.40227144964057304,
+ "y": 2,
+ "z": 10
+ }
+ },
+ {
+ "kind": "geometry",
+ "index": 11,
+ "feedbackMs": 64.10000002384186,
+ "readyMs": 180.20000004768372,
+ "before": {
+ "x": 0.40227144964057304,
+ "y": 2,
+ "z": 10
+ },
+ "after": {
+ "x": -0.007366433349413892,
+ "y": 2,
+ "z": 10
+ }
+ }
+ ],
+ "summary": {
+ "open": {
+ "feedbackP90": 12.399999976158142,
+ "readyMedian": 81.79999995231628,
+ "readyP90": 89.09999990463257
+ },
+ "numeric": {
+ "feedbackP90": 31.600000023841858,
+ "readyMedian": 130.39999997615814,
+ "readyP90": 136
+ },
+ "pointer": {
+ "feedbackP90": 29.59999990463257,
+ "readyMedian": 106.39999997615814,
+ "readyP90": 125
+ },
+ "geometry": {
+ "feedbackP90": 64.80000007152557,
+ "readyMedian": 181.79999995231628,
+ "readyP90": 197.5
+ }
+ }
+ }
+ ],
+ "media": [
+ {
+ "locale": "en-US",
+ "projectId": "ae6a7e3c-34b6-4aea-9711-f5ea6b3a3cbd",
+ "documentId": "2c651b76-28de-477c-8e55-a3cfac70480b",
+ "savedGeometry": {
+ "position": {
+ "x": 0.26596972164283317,
+ "y": 2,
+ "z": 10
+ },
+ "target": {
+ "x": 0.43795953847489955,
+ "y": 2.05,
+ "z": 0
+ },
+ "fov": 45,
+ "roll": 0
+ },
+ "registeredModel": {
+ "assetId": "3f1997ce-3577-5b3b-a592-1ce45c0303e1",
+ "revision": 1,
+ "fingerprint": "sha256:672727744b8734a5ede57c3f9ae169126089e86830c4d6d22e2713d6cba3482f",
+ "kind": "file"
+ },
+ "renders": [
+ {
+ "source": "storyboard",
+ "acceptedEditorRevision": 6,
+ "acceptedProjectCursor": 13,
+ "acceptedClip": {
+ "id": "a1413a79-e022-47c6-8a9b-ee10bbebcc41",
+ "name": "Agent intervening recipe",
+ "presetId": "spiral-rise",
+ "algorithmVersion": 1,
+ "start": 0,
+ "duration": 2.4,
+ "startingPose": {
+ "position": {
+ "x": 0.26596972164283317,
+ "y": 2,
+ "z": 10
+ },
+ "target": {
+ "x": 0.43795953847489955,
+ "y": 2.05,
+ "z": 0
+ },
+ "fov": 45,
+ "roll": 0
+ },
+ "parameters": {
+ "height": 1,
+ "center": {
+ "x": 0,
+ "y": 2,
+ "z": 0
+ },
+ "orbitDirection": "clockwise",
+ "sweep": 75,
+ "distance": 1
+ },
+ "easing": {
+ "kind": "linear"
+ }
+ },
+ "publishedFingerprint": "sha256:cf70b3eb4978e53b684d37830f237732a72041156d551cf4d0089780f4dfb2b5",
+ "mp4Sha256": "cf70b3eb4978e53b684d37830f237732a72041156d551cf4d0089780f4dfb2b5",
+ "probe": {
+ "duration": 2.4,
+ "stream": {
+ "index": 0,
+ "codec_name": "h264",
+ "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
+ "profile": "High",
+ "level": 31,
+ "codec_type": "video",
+ "codec_tag_string": "avc1",
+ "codec_tag": "0x31637661",
+ "mime_codec_string": "avc1.640c1f",
+ "width": 1280,
+ "height": 720,
+ "coded_width": 1280,
+ "coded_height": 720,
+ "has_b_frames": 0,
+ "pix_fmt": "yuvj420p",
+ "color_range": "pc",
+ "color_space": "bt709",
+ "color_transfer": "iec61966-2-1",
+ "color_primaries": "bt709",
+ "chroma_location": "left",
+ "field_order": "progressive",
+ "refs": 1,
+ "is_avc": "true",
+ "nal_length_size": "4",
+ "id": "0x1",
+ "r_frame_rate": "25/1",
+ "avg_frame_rate": "25/1",
+ "time_base": "1/57600",
+ "start_pts": 0,
+ "start_time": "0.000000",
+ "duration_ts": 138240,
+ "duration": "2.400000",
+ "bit_rate": "1398076",
+ "bits_per_raw_sample": "8",
+ "nb_frames": "60",
+ "nb_read_frames": "60",
+ "extradata_size": 38,
+ "disposition": {
+ "default": 1,
+ "dub": 0,
+ "original": 0,
+ "comment": 0,
+ "lyrics": 0,
+ "karaoke": 0,
+ "forced": 0,
+ "hearing_impaired": 0,
+ "visual_impaired": 0,
+ "clean_effects": 0,
+ "attached_pic": 0,
+ "timed_thumbnails": 0,
+ "non_diegetic": 0,
+ "captions": 0,
+ "descriptions": 0,
+ "metadata": 0,
+ "dependent": 0,
+ "still_image": 0,
+ "multilayer": 0
+ },
+ "tags": {
+ "creation_time": "2026-12-04T14:36:47.000000Z",
+ "language": "und",
+ "handler_name": "MediabunnyVideoHandler",
+ "encoder": "Mediabunny v1.62.1"
+ }
+ },
+ "colors": [
+ [
+ 41,
+ 42,
+ 46
+ ],
+ [
+ 41,
+ 42,
+ 46
+ ],
+ [
+ 41,
+ 42,
+ 46
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ]
+ ]
+ },
+ "landmarkComparisons": 37,
+ "frames": [
+ 0,
+ 5,
+ 10,
+ 19,
+ 20,
+ 25,
+ 30,
+ 39,
+ 40,
+ 45,
+ 50,
+ 59
+ ],
+ "maxErrorPx": 1.160817528752729,
+ "tolerancePx": 3,
+ "comparisonRaster": [
+ 320,
+ 180
+ ]
+ },
+ {
+ "source": "spiral",
+ "acceptedEditorRevision": 7,
+ "acceptedProjectCursor": 16,
+ "acceptedClip": {
+ "id": "a1413a79-e022-47c6-8a9b-ee10bbebcc41",
+ "name": "Later storyboard",
+ "presetId": "spiral-rise",
+ "algorithmVersion": 1,
+ "start": 0,
+ "duration": 2.4,
+ "startingPose": {
+ "position": {
+ "x": 0.26596972164283317,
+ "y": 2,
+ "z": 10
+ },
+ "target": {
+ "x": 0.43795953847489955,
+ "y": 2.05,
+ "z": 0
+ },
+ "fov": 45,
+ "roll": 0
+ },
+ "parameters": {
+ "height": 1,
+ "center": {
+ "x": 0,
+ "y": 2,
+ "z": 0
+ },
+ "orbitDirection": "clockwise",
+ "sweep": 120,
+ "distance": 1
+ },
+ "easing": {
+ "kind": "linear"
+ }
+ },
+ "publishedFingerprint": "sha256:a6e43f94a9c2492a386dfc78f77b66a595594e46a503ede0f74e5c0687a9f7c5",
+ "mp4Sha256": "a6e43f94a9c2492a386dfc78f77b66a595594e46a503ede0f74e5c0687a9f7c5",
+ "probe": {
+ "duration": 2.4,
+ "stream": {
+ "index": 0,
+ "codec_name": "h264",
+ "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
+ "profile": "High",
+ "level": 31,
+ "codec_type": "video",
+ "codec_tag_string": "avc1",
+ "codec_tag": "0x31637661",
+ "mime_codec_string": "avc1.640c1f",
+ "width": 1280,
+ "height": 720,
+ "coded_width": 1280,
+ "coded_height": 720,
+ "has_b_frames": 0,
+ "pix_fmt": "yuvj420p",
+ "color_range": "pc",
+ "color_space": "bt709",
+ "color_transfer": "iec61966-2-1",
+ "color_primaries": "bt709",
+ "chroma_location": "left",
+ "field_order": "progressive",
+ "refs": 1,
+ "is_avc": "true",
+ "nal_length_size": "4",
+ "id": "0x1",
+ "r_frame_rate": "25/1",
+ "avg_frame_rate": "25/1",
+ "time_base": "1/25",
+ "start_pts": 0,
+ "start_time": "0.000000",
+ "duration_ts": 60,
+ "duration": "2.400000",
+ "bit_rate": "1763193",
+ "bits_per_raw_sample": "8",
+ "nb_frames": "60",
+ "nb_read_frames": "60",
+ "extradata_size": 38,
+ "disposition": {
+ "default": 1,
+ "dub": 0,
+ "original": 0,
+ "comment": 0,
+ "lyrics": 0,
+ "karaoke": 0,
+ "forced": 0,
+ "hearing_impaired": 0,
+ "visual_impaired": 0,
+ "clean_effects": 0,
+ "attached_pic": 0,
+ "timed_thumbnails": 0,
+ "non_diegetic": 0,
+ "captions": 0,
+ "descriptions": 0,
+ "metadata": 0,
+ "dependent": 0,
+ "still_image": 0,
+ "multilayer": 0
+ },
+ "tags": {
+ "creation_time": "2026-12-04T14:36:58.000000Z",
+ "language": "und",
+ "handler_name": "MediabunnyVideoHandler",
+ "encoder": "Mediabunny v1.62.1"
+ }
+ },
+ "colors": [
+ [
+ 41,
+ 42,
+ 46
+ ],
+ [
+ 41,
+ 42,
+ 46
+ ],
+ [
+ 41,
+ 43,
+ 46
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 44,
+ 48
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 41,
+ 44,
+ 49
+ ],
+ [
+ 41,
+ 44,
+ 49
+ ],
+ [
+ 41,
+ 44,
+ 49
+ ],
+ [
+ 41,
+ 44,
+ 49
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 40,
+ 43,
+ 48
+ ],
+ [
+ 40,
+ 43,
+ 48
+ ],
+ [
+ 40,
+ 43,
+ 48
+ ],
+ [
+ 40,
+ 43,
+ 48
+ ],
+ [
+ 40,
+ 42,
+ 47
+ ],
+ [
+ 39,
+ 42,
+ 47
+ ],
+ [
+ 39,
+ 42,
+ 47
+ ],
+ [
+ 39,
+ 42,
+ 47
+ ],
+ [
+ 39,
+ 42,
+ 47
+ ],
+ [
+ 38,
+ 42,
+ 46
+ ],
+ [
+ 38,
+ 41,
+ 46
+ ],
+ [
+ 38,
+ 41,
+ 46
+ ],
+ [
+ 38,
+ 41,
+ 46
+ ],
+ [
+ 38,
+ 41,
+ 46
+ ],
+ [
+ 37,
+ 41,
+ 45
+ ],
+ [
+ 37,
+ 41,
+ 45
+ ],
+ [
+ 37,
+ 41,
+ 45
+ ],
+ [
+ 37,
+ 41,
+ 45
+ ],
+ [
+ 37,
+ 41,
+ 45
+ ],
+ [
+ 37,
+ 41,
+ 45
+ ],
+ [
+ 37,
+ 41,
+ 45
+ ],
+ [
+ 37,
+ 40,
+ 45
+ ],
+ [
+ 37,
+ 40,
+ 45
+ ],
+ [
+ 37,
+ 40,
+ 45
+ ]
+ ]
+ },
+ "landmarkComparisons": 37,
+ "frames": [
+ 0,
+ 5,
+ 10,
+ 19,
+ 20,
+ 25,
+ 30,
+ 39,
+ 40,
+ 45,
+ 50,
+ 59
+ ],
+ "maxErrorPx": 1.8792781098365718,
+ "tolerancePx": 3,
+ "comparisonRaster": [
+ 320,
+ 180
+ ]
+ }
+ ],
+ "evidenceSha256": "e1cd5abeaa1cffce716b47cd6175b3088f4422cb4fd71507c48242e995397c2e"
+ },
+ {
+ "locale": "zh-CN",
+ "projectId": "bdbded23-aa21-4f11-8de8-f2b5a547f8ed",
+ "documentId": "2ab3e91e-2afe-4927-880a-50ed23db906c",
+ "savedGeometry": {
+ "position": {
+ "x": 0.26596972164283317,
+ "y": 2,
+ "z": 10
+ },
+ "target": {
+ "x": 0.43795953847489955,
+ "y": 2.05,
+ "z": 0
+ },
+ "fov": 45,
+ "roll": 0
+ },
+ "registeredModel": {
+ "assetId": "a8bca315-697d-5c42-a10d-7d1eb7eede12",
+ "revision": 1,
+ "fingerprint": "sha256:672727744b8734a5ede57c3f9ae169126089e86830c4d6d22e2713d6cba3482f",
+ "kind": "file"
+ },
+ "renders": [
+ {
+ "source": "storyboard",
+ "acceptedEditorRevision": 6,
+ "acceptedProjectCursor": 13,
+ "acceptedClip": {
+ "id": "6fdb53f5-697a-4548-b468-97ecf89034e8",
+ "name": "Agent intervening recipe",
+ "presetId": "spiral-rise",
+ "algorithmVersion": 1,
+ "start": 0,
+ "duration": 2.4,
+ "startingPose": {
+ "position": {
+ "x": 0.26596972164283317,
+ "y": 2,
+ "z": 10
+ },
+ "target": {
+ "x": 0.43795953847489955,
+ "y": 2.05,
+ "z": 0
+ },
+ "fov": 45,
+ "roll": 0
+ },
+ "parameters": {
+ "height": 1,
+ "center": {
+ "x": 0,
+ "y": 2,
+ "z": 0
+ },
+ "orbitDirection": "clockwise",
+ "sweep": 75,
+ "distance": 1
+ },
+ "easing": {
+ "kind": "linear"
+ }
+ },
+ "publishedFingerprint": "sha256:e033160927a0b1b091f929dbb59f9d80b3779a5f66c120758387d5bef78fff24",
+ "mp4Sha256": "e033160927a0b1b091f929dbb59f9d80b3779a5f66c120758387d5bef78fff24",
+ "probe": {
+ "duration": 2.4,
+ "stream": {
+ "index": 0,
+ "codec_name": "h264",
+ "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
+ "profile": "High",
+ "level": 31,
+ "codec_type": "video",
+ "codec_tag_string": "avc1",
+ "codec_tag": "0x31637661",
+ "mime_codec_string": "avc1.640c1f",
+ "width": 1280,
+ "height": 720,
+ "coded_width": 1280,
+ "coded_height": 720,
+ "has_b_frames": 0,
+ "pix_fmt": "yuvj420p",
+ "color_range": "pc",
+ "color_space": "bt709",
+ "color_transfer": "iec61966-2-1",
+ "color_primaries": "bt709",
+ "chroma_location": "left",
+ "field_order": "progressive",
+ "refs": 1,
+ "is_avc": "true",
+ "nal_length_size": "4",
+ "id": "0x1",
+ "r_frame_rate": "25/1",
+ "avg_frame_rate": "25/1",
+ "time_base": "1/57600",
+ "start_pts": 0,
+ "start_time": "0.000000",
+ "duration_ts": 138240,
+ "duration": "2.400000",
+ "bit_rate": "1399913",
+ "bits_per_raw_sample": "8",
+ "nb_frames": "60",
+ "nb_read_frames": "60",
+ "extradata_size": 38,
+ "disposition": {
+ "default": 1,
+ "dub": 0,
+ "original": 0,
+ "comment": 0,
+ "lyrics": 0,
+ "karaoke": 0,
+ "forced": 0,
+ "hearing_impaired": 0,
+ "visual_impaired": 0,
+ "clean_effects": 0,
+ "attached_pic": 0,
+ "timed_thumbnails": 0,
+ "non_diegetic": 0,
+ "captions": 0,
+ "descriptions": 0,
+ "metadata": 0,
+ "dependent": 0,
+ "still_image": 0,
+ "multilayer": 0
+ },
+ "tags": {
+ "creation_time": "2026-12-04T14:38:36.000000Z",
+ "language": "und",
+ "handler_name": "MediabunnyVideoHandler",
+ "encoder": "Mediabunny v1.62.1"
+ }
+ },
+ "colors": [
+ [
+ 41,
+ 42,
+ 46
+ ],
+ [
+ 41,
+ 42,
+ 46
+ ],
+ [
+ 41,
+ 42,
+ 46
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ]
+ ]
+ },
+ "landmarkComparisons": 37,
+ "frames": [
+ 0,
+ 5,
+ 10,
+ 19,
+ 20,
+ 25,
+ 30,
+ 39,
+ 40,
+ 45,
+ 50,
+ 59
+ ],
+ "maxErrorPx": 1.160817528752729,
+ "tolerancePx": 3,
+ "comparisonRaster": [
+ 320,
+ 180
+ ]
+ },
+ {
+ "source": "spiral",
+ "acceptedEditorRevision": 7,
+ "acceptedProjectCursor": 16,
+ "acceptedClip": {
+ "id": "6fdb53f5-697a-4548-b468-97ecf89034e8",
+ "name": "Later storyboard",
+ "presetId": "spiral-rise",
+ "algorithmVersion": 1,
+ "start": 0,
+ "duration": 2.4,
+ "startingPose": {
+ "position": {
+ "x": 0.26596972164283317,
+ "y": 2,
+ "z": 10
+ },
+ "target": {
+ "x": 0.43795953847489955,
+ "y": 2.05,
+ "z": 0
+ },
+ "fov": 45,
+ "roll": 0
+ },
+ "parameters": {
+ "height": 1,
+ "center": {
+ "x": 0,
+ "y": 2,
+ "z": 0
+ },
+ "orbitDirection": "clockwise",
+ "sweep": 120,
+ "distance": 1
+ },
+ "easing": {
+ "kind": "linear"
+ }
+ },
+ "publishedFingerprint": "sha256:9f358400819d194cce2e93636d25b3dfa8f0f04212a56025248b14ce9cfa0360",
+ "mp4Sha256": "9f358400819d194cce2e93636d25b3dfa8f0f04212a56025248b14ce9cfa0360",
+ "probe": {
+ "duration": 2.4,
+ "stream": {
+ "index": 0,
+ "codec_name": "h264",
+ "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
+ "profile": "High",
+ "level": 31,
+ "codec_type": "video",
+ "codec_tag_string": "avc1",
+ "codec_tag": "0x31637661",
+ "mime_codec_string": "avc1.640c1f",
+ "width": 1280,
+ "height": 720,
+ "coded_width": 1280,
+ "coded_height": 720,
+ "has_b_frames": 0,
+ "pix_fmt": "yuvj420p",
+ "color_range": "pc",
+ "color_space": "bt709",
+ "color_transfer": "iec61966-2-1",
+ "color_primaries": "bt709",
+ "chroma_location": "left",
+ "field_order": "progressive",
+ "refs": 1,
+ "is_avc": "true",
+ "nal_length_size": "4",
+ "id": "0x1",
+ "r_frame_rate": "25/1",
+ "avg_frame_rate": "25/1",
+ "time_base": "1/25",
+ "start_pts": 0,
+ "start_time": "0.000000",
+ "duration_ts": 60,
+ "duration": "2.400000",
+ "bit_rate": "1758983",
+ "bits_per_raw_sample": "8",
+ "nb_frames": "60",
+ "nb_read_frames": "60",
+ "extradata_size": 38,
+ "disposition": {
+ "default": 1,
+ "dub": 0,
+ "original": 0,
+ "comment": 0,
+ "lyrics": 0,
+ "karaoke": 0,
+ "forced": 0,
+ "hearing_impaired": 0,
+ "visual_impaired": 0,
+ "clean_effects": 0,
+ "attached_pic": 0,
+ "timed_thumbnails": 0,
+ "non_diegetic": 0,
+ "captions": 0,
+ "descriptions": 0,
+ "metadata": 0,
+ "dependent": 0,
+ "still_image": 0,
+ "multilayer": 0
+ },
+ "tags": {
+ "creation_time": "2026-12-04T14:38:50.000000Z",
+ "language": "und",
+ "handler_name": "MediabunnyVideoHandler",
+ "encoder": "Mediabunny v1.62.1"
+ }
+ },
+ "colors": [
+ [
+ 41,
+ 42,
+ 46
+ ],
+ [
+ 41,
+ 42,
+ 46
+ ],
+ [
+ 41,
+ 42,
+ 46
+ ],
+ [
+ 41,
+ 43,
+ 47
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 44,
+ 48
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 42,
+ 44,
+ 49
+ ],
+ [
+ 41,
+ 44,
+ 49
+ ],
+ [
+ 41,
+ 44,
+ 49
+ ],
+ [
+ 41,
+ 44,
+ 49
+ ],
+ [
+ 41,
+ 44,
+ 49
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 41,
+ 43,
+ 48
+ ],
+ [
+ 40,
+ 43,
+ 48
+ ],
+ [
+ 40,
+ 43,
+ 48
+ ],
+ [
+ 40,
+ 43,
+ 48
+ ],
+ [
+ 40,
+ 43,
+ 48
+ ],
+ [
+ 40,
+ 42,
+ 47
+ ],
+ [
+ 40,
+ 42,
+ 47
+ ],
+ [
+ 39,
+ 42,
+ 47
+ ],
+ [
+ 39,
+ 42,
+ 47
+ ],
+ [
+ 39,
+ 42,
+ 47
+ ],
+ [
+ 38,
+ 42,
+ 46
+ ],
+ [
+ 38,
+ 42,
+ 46
+ ],
+ [
+ 38,
+ 41,
+ 46
+ ],
+ [
+ 38,
+ 41,
+ 46
+ ],
+ [
+ 38,
+ 41,
+ 46
+ ],
+ [
+ 37,
+ 41,
+ 45
+ ],
+ [
+ 37,
+ 41,
+ 45
+ ],
+ [
+ 37,
+ 41,
+ 45
+ ],
+ [
+ 37,
+ 41,
+ 45
+ ],
+ [
+ 37,
+ 41,
+ 45
+ ],
+ [
+ 37,
+ 41,
+ 45
+ ],
+ [
+ 37,
+ 40,
+ 45
+ ],
+ [
+ 38,
+ 40,
+ 45
+ ],
+ [
+ 37,
+ 40,
+ 45
+ ],
+ [
+ 37,
+ 40,
+ 45
+ ]
+ ]
+ },
+ "landmarkComparisons": 37,
+ "frames": [
+ 0,
+ 5,
+ 10,
+ 19,
+ 20,
+ 25,
+ 30,
+ 39,
+ 40,
+ 45,
+ 50,
+ 59
+ ],
+ "maxErrorPx": 1.8792781098365718,
+ "tolerancePx": 3,
+ "comparisonRaster": [
+ 320,
+ 180
+ ]
+ }
+ ],
+ "evidenceSha256": "cb7722f016c94ce550b0a9bdd2b4274f20820fbbd250a50edb4bfc000c680caa"
+ }
+ ],
+ "ordinaryUpEvidence": {
+ "build": "finalBuild",
+ "locales": [
+ "en-US",
+ "zh-CN"
+ ],
+ "videoSha256": "f9b2ac070640fe8a16634ba3c878c5caeaf32fa98ccf9611bee6ccaa1b3d7297",
+ "decodedSha256": "9aa5bee4d8636c67cd647cacd45252aa3ab271a1d8f0261f8842c41a57834995",
+ "duration": 3,
+ "stream": {
+ "index": 0,
+ "codec_name": "h264",
+ "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
+ "profile": "High",
+ "level": 31,
+ "codec_type": "video",
+ "codec_tag_string": "avc1",
+ "codec_tag": "0x31637661",
+ "mime_codec_string": "avc1.640c1f",
+ "width": 1280,
+ "height": 720,
+ "coded_width": 1280,
+ "coded_height": 720,
+ "has_b_frames": 0,
+ "pix_fmt": "yuvj420p",
+ "color_range": "pc",
+ "color_space": "bt709",
+ "color_transfer": "iec61966-2-1",
+ "color_primaries": "bt709",
+ "chroma_location": "left",
+ "field_order": "progressive",
+ "refs": 1,
+ "is_avc": "true",
+ "nal_length_size": "4",
+ "id": "0x1",
+ "r_frame_rate": "24/1",
+ "avg_frame_rate": "24/1",
+ "time_base": "1/57600",
+ "start_pts": 0,
+ "start_time": "0.000000",
+ "duration_ts": 172800,
+ "duration": "3.000000",
+ "bit_rate": "86850",
+ "bits_per_raw_sample": "8",
+ "nb_frames": "72",
+ "nb_read_frames": "72",
+ "extradata_size": 38,
+ "disposition": {
+ "default": 1,
+ "dub": 0,
+ "original": 0,
+ "comment": 0,
+ "lyrics": 0,
+ "karaoke": 0,
+ "forced": 0,
+ "hearing_impaired": 0,
+ "visual_impaired": 0,
+ "clean_effects": 0,
+ "attached_pic": 0,
+ "timed_thumbnails": 0,
+ "non_diegetic": 0,
+ "captions": 0,
+ "descriptions": 0,
+ "metadata": 0,
+ "dependent": 0,
+ "still_image": 0,
+ "multilayer": 0
+ },
+ "tags": {
+ "creation_time": "2026-12-04T14:39:34.000000Z",
+ "language": "und",
+ "handler_name": "MediabunnyVideoHandler",
+ "encoder": "Mediabunny v1.62.1"
+ }
+ },
+ "checkedFrames": 72,
+ "browserErrors": [],
+ "authoredKeys": "Preserved through ordinary edit, independent disk process and locale reload",
+ "nonfiniteBoundary": "Node renderer tests; nonfinite values cannot be serialized as project JSON"
+ },
+ "verification": {
+ "pythonTests": 422,
+ "nodeTests": 187,
+ "i18nKeys": 3867,
+ "browserManifestEntries": 126,
+ "browserLocalePages": 116,
+ "browserLocaleScripts": 127,
+ "contracts": "verified",
+ "productionBuild": "passed"
+ },
+ "focusedBrowserRegressions": [
+ {
+ "locale": "en-US",
+ "mode": "ORIENTATION",
+ "exitCode": 0,
+ "elapsedSeconds": 34.18620300292969
+ },
+ {
+ "locale": "en-US",
+ "mode": "CATALOG",
+ "exitCode": 0,
+ "elapsedSeconds": 23.532126903533936
+ },
+ {
+ "locale": "en-US",
+ "mode": "REPLACEMENT",
+ "exitCode": 0,
+ "elapsedSeconds": 25.693649291992188
+ },
+ {
+ "locale": "en-US",
+ "mode": "RECOVERY",
+ "exitCode": 0,
+ "elapsedSeconds": 63.18062424659729
+ },
+ {
+ "locale": "en-US",
+ "mode": "RESPONSE_RECOVERY",
+ "exitCode": 0,
+ "elapsedSeconds": 20.739978313446045
+ },
+ {
+ "locale": "zh-CN",
+ "mode": "ORIENTATION",
+ "exitCode": 0,
+ "elapsedSeconds": 27.880349159240723
+ },
+ {
+ "locale": "zh-CN",
+ "mode": "CATALOG",
+ "exitCode": 0,
+ "elapsedSeconds": 24.853309154510498
+ }
+ ]
+ }
+}
diff --git a/docs/development/director-stage-implementation-plan.md b/docs/development/director-stage-implementation-plan.md
new file mode 100644
index 000000000..317665fb2
--- /dev/null
+++ b/docs/development/director-stage-implementation-plan.md
@@ -0,0 +1,44 @@
+# Director Stage implementation plan
+
+This plan keeps the Director Stage work in reviewable, dependency-ordered
+feature branches. Each branch owns a complete user-facing capability and is
+stacked on the branch immediately before it.
+
+## Branch stack
+
+1. `feat/stage-output-assets` — output assets, frozen render plans, and the
+ publication contract.
+2. `feat/stage-fullscreen` — the Director Stage shell, full-screen layout, and
+ shared stage geometry contracts.
+3. `feat/director-stage-assets` — asset rail cards, thumbnail capture, and
+ registered asset references.
+4. `feat/stage-gizmo-placement` — the editable stage core: placement from
+ preview cards, mutually exclusive transform tools, viewport/view state,
+ object tree and inspector, timeline editing, environment controls, and
+ persistence validation.
+5. `feat/stage-camera-rigs` — independent camera rigs, viewpoint controls,
+ Director View, and camera monitors.
+6. `feat/stage-agent-publish` — the parallel agent publication capability,
+ based on the shared stage core and independent of the camera UI.
+
+## Delivery rules
+
+- Keep a branch limited to its capability and the contracts it must expose to
+ the next branch.
+- Move a prerequisite to the lowest branch that needs it; do not duplicate it
+ in a later feature branch.
+- Every feature unit includes focused tests, a production build, bilingual
+ message validation, and the relevant Python contract tests.
+- Every code-ready unit receives a semantic signed commit with a body starting
+ with `## summary`.
+- Rebase the stack from low to high only after the lower branch passes its
+ checks. Keep the branches local until the review targets are agreed.
+
+## Acceptance boundary
+
+The Director Stage document is the persisted source of business facts. View
+state, selection, preview mode, split view, menus, and interaction modes stay
+ephemeral. Asset cards and agent operations use the same placement and apply
+contracts as direct user interaction. Camera preview output is independent
+from the main Director View and does not make viewpoint movement move the main
+stage camera.
diff --git a/docs/development/director-stage-ui-feedback-plan.md b/docs/development/director-stage-ui-feedback-plan.md
new file mode 100644
index 000000000..adff7bd84
--- /dev/null
+++ b/docs/development/director-stage-ui-feedback-plan.md
@@ -0,0 +1,16 @@
+# Director Stage UI feedback follow-up
+
+This plan tracks the three follow-up changes identified from the annotated
+Director Stage comparison against the local Jiemeng reference screenshots.
+Work stays on the semantic `feat/stage-gizmo-placement` branch.
+
+## Acceptance stages
+
+| Stage | Scope | Acceptance | Status |
+| --- | --- | --- | --- |
+| F1 | Transform tool mode | Move, rotate, and scale are a discriminated single-choice state; only the selected helper is visible and keyboard/buttons preserve that invariant | complete |
+| F2 | Asset card previews | Stage object cards show a PNG thumbnail rendered from the corresponding 3D object at the origin, centered and cropped from the render; imported objects use their loaded scene when available | complete |
+| F3 | Object tree and inspector layout | Right rail follows the reference split between a searchable object tree and an independently scrolling property inspector, with stable grouping and scroll behavior | complete |
+
+Each stage requires a focused behavior or browser check, the relevant project
+checks, and a signed Git commit before the next stage begins.
diff --git a/docs/development/director-stage-visual-alignment-plan.md b/docs/development/director-stage-visual-alignment-plan.md
new file mode 100644
index 000000000..a03b61152
--- /dev/null
+++ b/docs/development/director-stage-visual-alignment-plan.md
@@ -0,0 +1,45 @@
+# Director Stage visual alignment plan
+
+This execution plan tracks the visual-alignment work against the native Jiemeng
+Director Stage screenshots referenced by the external audit plan. It is scoped
+to the existing `feat/stage-fullscreen` branch because the branch owns the
+Director Stage shell, layout, asset tabs, and viewport tools.
+
+The reference is the screenshot set in the local audit workspace:
+
+`C:\Users\10425\.zcode\workspace\draft-9c960b48-85bb-4dbe-8ee1-03eba20460c0\jimeng-canvas-audit\screenshots`
+
+Primary comparison states:
+
+- `02-director-console.png`: static console shell.
+- `09-director-console-dynamic.png`: dynamic-mode transition.
+- `11-director-console-dynamic-mode.png`: dynamic console and timeline.
+- `12-director-console-camera-moves.png`: camera-move asset tab.
+- `13-director-console-view-settings.png`: viewport settings popover.
+- `14-director-console-shoot.png`: camera/shoot view.
+
+## Rules
+
+- Match the reference geometry, spacing, density, color hierarchy, and state
+ transitions before introducing new visual language.
+- Keep the 3D viewport as the base layer. Panels are full-height workbench
+ regions or overlays, not document-flow dialogs.
+- Keep business values and bilingual message keys unchanged while changing
+ presentation.
+- Work on the existing semantic branch. Do not create a new branch for this
+ alignment pass.
+- Each stage must have a browser screenshot or computed-geometry check, the
+ smallest relevant automated checks, and a signed commit (`commit -s`).
+- After the shell commits land, rebase `feat/stage-gizmo-placement` onto this
+ branch before continuing work that depends on the shell.
+
+## Stages
+
+| Stage | Scope | Reference states | Acceptance | Status |
+| --- | --- | --- | --- | --- |
+| V1 | Workbench shell geometry and base color tokens: top bar, left asset rail, right inspector, viewport bounds, and bottom timeline boundary | 02, 11 | No floating-dialog margins on the main shell; panel widths and boundaries are stable at 1920×1080 and 1700×1100; existing console browser flow remains green | complete |
+| V2 | Top bar and asset-library density: compact actions, mode switch, asset tabs, search, cards, and active states | 02, 11, 12 | Header and left rail follow the reference rhythm; active tab and compact control states are visible and keyboard accessible | complete |
+| V3 | Object tree and inspector hierarchy: grouped rows, section dividers, fields, toggles, and scroll behavior | 02, 11, 13 | Right side reads as object tree above properties; selected/empty states preserve the same geometry | complete |
+| V4 | Dynamic timeline: transport, ruler, tracks, playhead, frame/keyframe density, and dynamic/static state transition | 09, 11, 12 | Dynamic mode exposes the timeline with reference density; static mode does not reserve an unexplained editor area | planned |
+| V5 | Viewport overlays and transient surfaces: tool rail, PiP, settings menu, viewfinder, help, and shoot state | 03, 13, 14 | Each overlay matches its reference anchor, z-order, padding, and dismissal behavior | planned |
+| V6 | Screenshot matrix and rebase handoff | 02, 09, 11–14 | Capture before/after comparison evidence, run required checks, commit, then rebase `feat/stage-gizmo-placement` and rerun its browser lanes | planned |
diff --git a/docs/development/i18n.md b/docs/development/i18n.md
index eb0efcd05..5f4b0d811 100644
--- a/docs/development/i18n.md
+++ b/docs/development/i18n.md
@@ -103,6 +103,7 @@ npm run check:i18n
| 时间线 | [timeline.ts](../../src/i18n/messages/zh-CN/timeline.ts) | [timeline.ts](../../src/i18n/messages/en-US/timeline.ts) |
| 素材库 | [library.ts](../../src/i18n/messages/zh-CN/library.ts) | [library.ts](../../src/i18n/messages/en-US/library.ts) |
| 助手(顶部会话切换、浮动与左右停靠、结果卡片与操作) | [assistant.ts](../../src/i18n/messages/zh-CN/assistant.ts) | [assistant.ts](../../src/i18n/messages/en-US/assistant.ts) |
+| 相机运镜 | [cameraMoves.ts](../../src/i18n/messages/zh-CN/cameraMoves.ts) | [cameraMoves.ts](../../src/i18n/messages/en-US/cameraMoves.ts) |
| 图片、图层、导演台 | [editors.ts](../../src/i18n/messages/zh-CN/editors.ts) | [editors.ts](../../src/i18n/messages/en-US/editors.ts) |
| 节点、资产 | [canvasNodes.ts](../../src/i18n/messages/zh-CN/canvasNodes.ts) | [canvasNodes.ts](../../src/i18n/messages/en-US/canvasNodes.ts) |
| 错误、状态与后端回执 | [errors.ts](../../src/i18n/messages/zh-CN/errors.ts) | [errors.ts](../../src/i18n/messages/en-US/errors.ts) |
diff --git a/docs/development/lessons.md b/docs/development/lessons.md
index 292eaf466..1c75e6e98 100644
--- a/docs/development/lessons.md
+++ b/docs/development/lessons.md
@@ -137,6 +137,7 @@ When work exposes a consequential risk or a recurring problem, add a lesson or u
- **Trigger:** A workspace timer retains its document while an editor commit installs a newer authoritative baseline.
- **Lesson:** A timer may run after the editor's saving flag clears but before React installs the new document. Comparing that old closure against the new baseline can turn a view-only save into a business rollback, invalidating a previously captured publication version.
- **Check:** Invalidate scheduled automatic callbacks when the editor transaction starts, drain queued saves and explicitly persist the current draft before the edit. Preserve publication CAS checks. Exercise the real due callback at the acknowledgment boundary; isolate projection-test gates by snapshot identity, assert release/restoration and always clean up. Distinguish a forced reproduction from proof of the exact CI schedule.
+- **Same-continuation follow-up:** The Director Stage Storyboard add (commit `33e084dc`) reproduced the rollback without a timer. After an editor save was acknowledged, the step that followed it in the same asynchronous continuation sent the next server command and first persisted `historyRef.current.present`. React had not yet installed the document the save produced, so that persist compared the previous canvas with the new baseline and wrote the saved draft back to what it was before the save; the command was then refused with `revision_conflict`. Only the real-browser journey showed it; the unit tests of either side could not. After an acknowledged editor save, a later step in the same continuation must not flush the canvas from `historyRef` again, because the save already did; `appendStageStoryboard` takes `savedDraft` for exactly that case. Cover a flow that saves a draft and then sends a command with a browser step that reads the stored document afterwards.
- **Queued-edit follow-up:** The H3 browser regression in [PR #266](https://github.com/ThinkFlowLab/OpenDirector/pull/266) holds the first import's background hydration until the second import queues an edit. A ref updated during render can still describe the old document; a late refresh then replaces both nodes with one. Track requested and rendered history writes, defer refreshes while they differ, and recheck when hydration finishes. Resume after a no-op write too. Verify both saved nodes, their bytes, and subsequent edits after reopening. / **排队编辑补充:** React 尚未显示的编辑也需要保护;后台刷新必须检查已经请求的修改,并在页面更新后继续。回归检查两张图片的保存内容及重开后的编辑,不能把人工控制的执行顺序当作原 CI 顺序的证明。
- **Preset editor follow-up:** Selecting an image preset used to queue a settings edit and a prompt-chip edit that still held the old settings. Render the chip from the saved preset and publish preset changes caused by prompt editing in the same command as the prompt. Check the saved parameters after autosave and reopening. Chrome can move the caret past a wrapped hint through native mouse-down selection. Verify the caret's rendered position after the chip with a visible multiline hint before releasing the button. Check that typing replaces the hint, retains the first character and saves only the user's text.
- **Preset submission follow-up:** Treat the selected preset as a prompt in both the button preflight and the generation service. Freeze its instructions in the accepted job, since updating only the draft's plain prompt can be ignored by structured references and can duplicate instructions on a second run. Check preset-only submission, the structured provider prompt, and adoption without modifying the draft.
@@ -166,6 +167,45 @@ When work exposes a consequential risk or a recurring problem, add a lesson or u
- **Check:** Verify the source metadata as well as reply text, multiple citations, split streaming markers, history reopening, copying and missing-source fallback. Preserve raw execution evidence and tool offsets; leave literal code examples unchanged and inspect both interface languages in the browser.
- **Presentation follow-up:** The source-link UI in #302 initially inherited a library modal's utility classes without the corresponding CSS. Text and click checks passed while the border and close-button positioning failed. Use the supported custom renderer with repository-owned styles, and check computed styles, element geometry, long URLs, keyboard close and focus restoration as well as translated text.
+## Values read back from renderer math need tolerant edit comparison
+
+- **Trigger:** Committing document values that were read back from three.js after the renderer recomputed them, such as camera orbit gesture ends or transform-handle drags in the Director Stage.
+- **Lesson:** The stage's orbit commit compared the read-back pose with exact equality while `setCamera` round-trips the pose through OrbitControls' spherical update; an unchanged camera could read one ulp away (5.000000000000001 vs 5), so every frozen gesture end committed an epsilon pose plus a phantom camera keyframe at the playhead. Unit fixtures used exact values, so only a real browser (tests/browser/director_stage_gizmo.mjs) exposed the phantom undo entry.
+- **Check:** When a gesture commits values that passed through renderer math, compare edit results within a small float tolerance while keeping parse-time validation exact, and cover the unchanged-gesture path in the browser rather than only with exact unit fixtures.
+
+## A relation rule in a stored model makes older records unreadable
+
+- **Trigger:** Adding a new business rule to a pydantic model that a stored snapshot or a stored command payload uses, so that it seems to be enforced everywhere at once.
+- **Lesson:** The first plan for the continuous Storyboard put the rule into the stored `DirectorData` model. `ProjectSnapshot.model_validate` runs on project load and on every command, and a commit record re-parses its stored command whenever history loads, so a project saved with sparse shots would have failed to open instead of refusing one Director Stage write. The same ordering hides specific rejections: the HTTP and Agent entry points parse a command payload before the application service runs, so a relation check in the payload model answers with a generic `invalid_input` before the write boundary can report its stable code, and on raw values it rejects sub-millisecond input that the normalized rule accepts.
+- **Check:** Put the rule in a domain function that the application write boundary calls on normalized copies, and leave the stored model as the last line of defence. When a command has to reach that boundary before the model's own relation checks, parse the incoming document with a sibling model that defers only those checks and dumps identically, so commit records and replay fingerprints are unaffected. Add a test that stores the unsupported shape through the store, reopens the project from disk, and asserts that the write is rejected with the stable code while the stored document is unchanged. Commit `d878d5f9` and `tests/test_creation_director.py` show the shape.
+
+
+## WebGL viewport and canvas readback use different units
+
+- **Trigger:** Drawing a preview into a WebGL canvas rectangle and copying the result into a 2D canvas.
+- **Lesson:** During Storyboard ticket 03, the viewport was sized in logical pixels to render a fixed-size device-pixel thumbnail. Multiplying the readback dimensions by the device pixel ratio again included neighboring viewport content. At 2×, a solid-color 128×72 probe contained only 2,304 of the expected 9,216 pixels of that color.
+- **Check:** Convert the viewport rectangle to device pixels once, then read that rectangle using the drawing buffer height and the 2D canvas origin. Verify the actual image at DPR greater than 1 and check that the visible viewport is restored before the thumbnail task returns. See [the Storyboard browser journey](../../tests/browser/director_stage_storyboard.mjs).
+
+## Storyboard edits and export need the same endpoint calculation
+
+- **Trigger:** Appending a block or shortening the main timeline when saved intervals contain sub-millisecond times.
+- **Evidence:** The [Director Stage command tests](../../tests/test_creation_director.py) reproduce an append that previously created an internal gap and a duration clamp that failed structural validation. The continuity check rounded each interval component, while append rounded their sum and clamp could fall below the original stored end.
+- **Check:** Compare the stored intervals, query result, applied receipt, and replay after append or clamp. Include a legacy interval whose rounded endpoint differs from its stored endpoint. Verify existing block timing and animation survive the operation.
+
+## A picture inside a dragged element takes the pointer gesture away
+
+- **Trigger:** A pointer gesture that may begin wherever the user presses inside an element holding an ``, such as a block with a thumbnail, while the gesture owns the pointer through `setPointerCapture`.
+- **Lesson:** A picture left draggable starts the browser's own drag on the press. It fires `dragstart`, then `pointercancel` at the element holding the capture and `lostpointercapture`, so a gesture that ends on a cancel is over before the pointer has moved and its release writes nothing. Commit `3a1bdd29` fixed the Director Stage Storyboard block by making its thumbnail `draggable={false}`. Measured in a minimal page in headless Chromium (a button holding a picture, the capture on its outer element): a press on the name gave `pointerdown` → `pointerup`; a press on the picture gave `pointerdown` → `dragstart` → `pointercancel` → `lostpointercapture` → `dragend`; with `draggable=false` the picture gave `pointerdown` → `pointerup`. The [Storyboard browser journey](../../tests/browser/director_stage_storyboard.mjs) started each drag from the centre of the block, which is its name, so the one press that could not drag, the one on the picture, was never made.
+- **Check:** Give every picture inside an element that is dragged `draggable={false}`, as `ReferenceThumbnail.tsx` and `SubjectNodeCard.tsx` do, and start one browser gesture from the picture itself, asserting that its release still commits. A gesture that is exercised only from text has not shown that the whole target can be dragged.
+
+## A cancelled pointer gesture keeps its capture until the pointer is let go
+
+- **Trigger:** A pointer gesture that holds its pointer through `setPointerCapture` and can be cancelled while the button is still held, by Escape, a `pointercancel` or the window losing focus.
+- **Lesson:** Commit `e2e2784e` fixed the Director Stage Storyboard drag. Its cancel released the capture at once, so the release that followed was sent to whatever lay under the pointer, and the `click` it produced went to the common ancestor of the press and the release. Over an empty stretch of the lane that ancestor was the lane itself, whose click moves the playhead: a drag cancelled with Escape moved the playhead when the mouse was let go, although nothing had been written. The [Storyboard browser journey](../../tests/browser/director_stage_storyboard.mjs) could not see it, because its lane was full of blocks and every release landed on one. The same shape, a cancel that releases the capture, is in `LayerBoard.tsx`, `TimelineEditor.tsx`, `LocalImageTools.tsx` and `TimelineTextLane.tsx`; none of them was checked for a release that lands elsewhere.
+- **Check:** Leave the capture to the browser, which gives it up with the `pointerup`, and let the surface that holds the pointer stop the `click`. Cover every way of cancelling with a release where no target of the gesture lies, on an empty part of the surface and outside it, in a real browser.
+
+- **Draft geometry follow-up:** The public `DIRECTOR_STAGE_GEOMETRY_ONLY=1` browser journey reproduced a held camera translation remaining changed after actual focus moved from its canvas to another control. Window blur alone does not cover that boundary. Cancel on the manipulation surface's blur as well as window blur and unexpected capture loss; clear the active gesture before releasing capture so cancellation cannot reenter itself. Verify the restored endpoint and later pointer release, then check unchanged project state and local undo availability. The initially invalid rolled-camera variant also reproduced a 48 px surface shift when the first endpoint edit inserted a composition disclosure. A fixed camera projection is insufficient if the DOM surface moves: keep disclosure/validation layout stable during the held gesture and present its new state on release. Check the actual canvas rectangle through invalid-to-valid edits as well as the resulting world coordinates.
+
## A component shared by two hosts needs its styling at its own root
- **Trigger:** Reusing one editor component inside a settings dialog and inside a first-run page.
@@ -201,3 +241,53 @@ When work exposes a consequential risk or a recurring problem, add a lesson or u
- **Trigger:** Launching the packaged desktop app from macOS Finder/Dock or a desktop launcher and probing an external CLI harness whose entry point uses `#!/usr/bin/env `.
- **Lesson:** Finder launches OpenDirector with `launchd`'s minimal `PATH` (`/usr/bin:/bin:/usr/sbin:/sbin`). Even when fallback discovery finds `~/.pi/agent/bin/pi`, the npm entry script invokes `/usr/bin/env node` while `node` lives in `/opt/homebrew/bin`, causing `pi --version` to exit 127. Terminal-launched smoke tests inherited the CI shell's full `PATH` and missed the failure, and discarding probe `stderr` hid the exit-127 root cause.
- **Check:** Resolve the user's login shell `PATH` once when starting the desktop Host (keeping bundled `runtime/bin` first and falling back cleanly on timeout/failure), log non-zero probe `stderr`, and run POSIX packaged desktop smoke under a stripped `/usr/bin:/bin:/usr/sbin:/sbin` `PATH` with a split-directory `#!/usr/bin/env` harness fixture.
+
+
+## Parameter recipes must participate in editor equality
+
+- **Trigger:** Adding derived animation recipes beside existing camera channels.
+- **Evidence:** The camera-move browser journey persisted an applied recipe but displayed no interval: `sameLocalStage` compared only camera poses and keys, so local history discarded the recipe-only edit. The public history regression in `tests/stageCameraMoves.test.ts` reproduces that loss.
+- **Check:** Extend semantic document equality when adding authored fields, and verify recipe-only apply, parameter edits, timing edits and undo/redo. A lens-only edit must also preserve the camera's authored position/target baseline rather than storing the pose sampled midway through a movement.
+
+- **Composition follow-up:** The guided-movement public command regression in `tests/test_creation_director.py::test_camera_move_composition_update_preserves_independently_edited_lens` reproduced an old recipe FOV snapshot overwriting a later independent static lens edit while applying a changed position. Compare intended changes with the existing recipe as well as the camera baseline, preserve untouched lens values, and exercise direct Agent requests against animated lens keys rather than relying on disabled UI controls.
+
+- **External-refresh follow-up:** The camera-move browser journey reproduced an Agent recipe being deleted by an expired canvas autosave after a clean background refresh advanced the CAS basis. Its `DIRECTOR_STAGE_REFRESH_ONLY=1` browser regression reproduced the loss twice on the old path, then preserved the authoritative recipe and revision after the fix. It retains a real due save callback and invokes it at Agent baseline installation. Run timing probes against a fresh dev server/page so timestamped HMR module instances cannot detach an imported client from the active application. Invalidate earlier autosave/visibility callbacks before advancing the projection, and synchronously install matching history so a foreground flush cannot use the previous rendered document with new versions. Verify both the authoritative recipe and revision after the original callback runs.
+
+- **Channel ownership follow-up:** Target-only pan/tilt exposed assumptions that every recipe owns position and target. `tests/stageCameraMoves.test.ts` covers retained position holds, independently animated positions, relative angular joins, and a following position move using a constant-key baseline. Resolve the latest owner per channel, include unowned effective baselines in join evaluation, and preserve unchanged composition fields when reopening recipes.
+
+- **Frozen-input follow-up:** The public accepted-export regressions in `tests/stageCameraMoves.test.ts` reproduced mutable aliases in recipe `center` and `baselineUp`: changing the editable vector after `stageExportPlan` acceptance changed its supposedly frozen samples. Starting pose and authored channel vectors already copied correctly. Parse both recipe vectors through the same validating, copying boundary, and mutate nested editable inputs after acceptance when checking snapshot isolation.
+
+- **Reviewed replacement follow-up:** The public camera-move replacement regressions in `tests/test_creation_director.py` cover distinct channel boundaries: using the earliest affected time for every channel can shorten another channel's preceding Bézier segment and change samples outside the disclosed range. Keep each channel's safe bounding key, compare dense outside samples, and disclose the union. Bind approval to the complete recipe, transitions and document revision; also check the transaction's final controlled curves so a later batch operation cannot alter an already reviewed replacement. The bilingual camera-move browser journey covers stale Apply, retained draft, explicit re-review and undo without reverting intervening Agent content.
+
+## Finite coordinates can produce an invalid movement path
+
+- **Trigger:** Rotating a camera around a faraway world-space center.
+- **Evidence:** The public orbit command and sampler regressions in `tests/test_creation_director.py` and `tests/stageCameraMoves.test.ts` use finite center coordinates of `-1e308`. Radius and rotated coordinates can overflow, although each submitted coordinate passes finite-number validation.
+- **Check:** Validate derived geometry as well as inputs. Bound both position and target circles, including extrema between samples, reject non-finite bounds atomically, and preserve the original project. Endpoint-only checks miss paths that overflow during traversal. A second public case with center `1e18` collapses a 10 m viewing vector at the midpoint even though its endpoint remains separated; require separation to exceed the conservative coordinate roundoff bound as well.
+
+- **Collection preflight follow-up:** `tests/test_creation_director.py::test_roll_validation_rejects_malformed_later_curves_without_partial_write` reproduced another derived-access failure: roll's cross-clip orientation proof read a later orbit's missing sweep before that orbit reached its own validation. Validate every recipe's primitive path contract before any cross-clip proof inspects it. Return an explicit issue with the invalid clip identity and preserve the authoritative document; adding one missing-key guard to each new proof leaves the same failure available to the next consumer.
+
+- **Interpolation and renderer follow-up:** The Dolly Zoom public command/sampler regressions in `tests/test_creation_director.py` and `tests/stageCameraMoves.test.ts` admitted up keys from `{x:1e308,y:1,z:0}` to `{x:-1e308,y:1,z:0}`: both norms were finite, but the shared right-minus-left interpolation overflowed. The renderer seam also reproduced a non-unit quaternion for constant up `{x:1e308,y:1,z:0}` because THREE normalizes using squared components. Check adjacent differences for all sampled vector channels before geometric proofs, normalize valid up with a robust norm at the shared posing boundary, and compare huge/unit-vector orientation. A large raw up magnitude must not conceal near-collinearity; prove relative orientation over the interpolation hull.
+
+- **Orientation follow-up:** `test_orbit_orientation_rejects_interior_collinearity_in_preview_put_and_save` and `test_straight_fixed_target_rejects_interior_orientation_without_partial_write` in `tests/test_creation_director.py` reproduced valid endpoints surrounding an up/view singularity. Apply complete-sweep proofs to every orbit family and prove straight sightline/up hull separation, including independent up animation during endpoint holds. Key magnitudes do not establish orientation: normalize cone generators while retaining raw interpolation overflow checks. Preserve explicit roll, and exercise the wizard's rejected and valid boundary in both languages with `DIRECTOR_STAGE_ORIENTATION_ONLY=1`.
+
+## Camera conversion boundaries and history are business facts
+
+- **Trigger:** Converting a later camera movement while keeping an earlier recipe, or restoring a converted recipe through local undo.
+- **Evidence:** `tests/test_creation_director.py::test_conversion_preserves_authentic_incoming_bezier_segment` reproduces a release marker flattening a genuine incoming Bézier curve on position, target, up and vertical FOV. `test_converted_later_move_releases_prior_hold_preserves_preroll_and_remains_editable` covers the opposite failure: an earlier held recipe masking newly baked ordinary keys. The `DIRECTOR_STAGE_CONVERSION_ONLY=1` browser journey also reproduced generic document-save rejection when local undo recreated the recipe over its baked keys, correctly triggering replacement-review validation.
+- **Check:** Separate an ordinary key's ownership release from its incoming interpolation. Preserve genuine incoming curves, raw up magnitude at joins, first-key backward extrapolation, per-channel holds and later manual motion; compare dense samples outside the converted interval as well as output-frame timestamps. Preserve the exact conversion receipt and route undo/redo across that acknowledged boundary through shared history commands. Do not weaken replacement review to admit an apparent inverse. Check exact before/after content, current versions, later committed edits and receipt scope before installing confirmed history. Ordinary unsaved key edits still use local undo.
+
+- **Precision follow-up:** The thirteen-preset conversion fixture reproduced 20-step Bézier inverse quantization as world-space jumps large enough to defeat adaptive refinement on a 10 m orbit. Use consistent precision in every shared sampler, probe quarter points as well as midpoints (symmetric easing can hide error at the midpoint), bound refinement work and reject atomically when precision cannot be met. Keep local refinement thresholds distinct from measured output and raster bounds.
+
+## A recovered receipt is historical evidence, not the current editor state
+
+- **Trigger:** A camera conversion or its undo commits while its response is unavailable, then a local numeric drag or an Agent edit changes the state before reconciliation finishes.
+- **Evidence:** The `DIRECTOR_STAGE_RECOVERY_ONLY=1` browser journey in [camera movement recovery](../../tests/browser/director_stage_camera_moves.mjs) reproduced a delayed undo response replacing a held numeric drag. `DIRECTOR_STAGE_RESPONSE_RECOVERY_ONLY=1` reproduced a later Agent snapshot being installed as the result of the original conversion. The public delivery regressions in [creation client tests](../../tests/creationClient.test.ts) also reproduced a reload minting a new camera operation ID and a changed recipe bypassing its unresolved predecessor.
+- **Check:** Retain the original command, clip identity, payload and version across unresolved delivery. Reconcile that operation before submitting a changed draft, and report which draft was actually submitted. Compare receipt versions with current authoritative content and compare local before/after content before installing history; an in-progress numeric preview may differ without replacing the history object. Keep a conflicting draft editable, provide an actual JSON download and an explicit discard/inspection path, and prevent it from silently writing against a newer basis. A receipt must remain queryable after later edits and disk reopening.
+- **Preview follow-up:** The same lost-response browser journey reproduced a successful preview recapture erasing the operation's unresolved error when saving state changed. Keep preview renderer errors separate from business delivery errors; recapture, scrubbing and ordinary draft changes cannot confirm a write or clear its recovery guidance.
+
+## Accepted video evidence must use the historical source
+
+- **Trigger:** Publishing a browser-rendered Director video after another edit changes its camera recipe.
+- **Evidence:** `tests/test_director_stage_assets.py::test_accepted_director_render_publishes_original_recipe_after_later_edit` reproduced publication requiring the current editor version even though frames and the output plan had already been accepted from an earlier revision. Comparing the execution document to the current source also rejected those valid frozen inputs.
+- **Check:** Validate the exact source document and canvas identity in the accepted recoverable snapshot, and record that revision in provenance. Keep current target binding, canvas versions, locks and asset validation; do not substitute the latest editor revision for the frozen input. Test forged historical content/cursors, current lock and source-binding mismatches, replay and disk reopening, plus decode the browser's real video after a deliberate later recipe edit. Current still publication and operations without a historical video plan retain their existing current-source checks.
diff --git a/docs/development/validation.md b/docs/development/validation.md
index c2c301086..75232b497 100644
--- a/docs/development/validation.md
+++ b/docs/development/validation.md
@@ -307,8 +307,26 @@ CREATION_WEB_URL=http://127.0.0.1:5179 CREATION_API_URL=http://127.0.0.1:8019 \
同一套隔离服务下的浏览器检查:
+分镜测试在中英文界面验证拖拽重排及其拖动反馈(抓取光标、只有被拖块跟随指针、标出块将插入位置的粗线、拖动中其余不动且不写入、被拖块在键盘焦点下也不带焦点环、松手后播放头落在被拖块的新起点、保存被拒时顺序与播放头一起回到拖动前)、波纹调整、取消(取消后在空白的轨道或标尺上松开也不移动播放头)、松手后持久化及单步撤销重做。删除流程覆盖波纹删除、机位级联、最后机位保护、预览回退和保存重开。
+
+The Storyboard test covers drag reorder and its drag feedback (the grab cursors, only the dragged block following the pointer, the line that stands where it would be let in, everything else still and nothing written while it is dragged, a carried block that shows no ring of keyboard focus, the playhead landing on the dragged block's new start once it is let go, and the order and the playhead going back together when the save is refused), ripple resize, cancellation (a release on an empty part of the lane or on the ruler after a cancelled drag moves no playhead either), persistence on release, and single-step undo and redo in both locales. Deletion coverage includes ripple deletion, camera cascades, final-camera protection, preview fallback, and reopening.
+
+生产验收使用浏览器清单的 `production` 测试层,在中英文界面连接隔离的工程服务和真实工程存储。导出通过 Chromium 在本地渲染和编码,使用 `ffprobe` 检查文件信息,并使用 `ffmpeg` 解码检查切点前后的画面。此流程的范围是单轨机位硬切,转场、多轨、音频和关闭浏览器后的后台渲染属于独立能力。模型服务使用替身,验收记录应注明浏览器和渲染环境。
+
+The `production` browser lane runs acceptance in both languages against the isolated project API and real project storage. Chromium renders and encodes locally. `ffprobe` reads the published file metadata, and `ffmpeg` decodes frames around cuts. The journey covers hard cuts on a single camera track. Transitions, multiple tracks, audio, and rendering after the browser closes are separate capabilities. The fixture uses model stubs. Record the browser and rendering environment with the results.
+
```sh
node scripts/verify_creation_browser.mjs # UI/API 主流程与重载
+node tests/browser/director_stage_entry.mjs # 导演台创建、GLB 导入、关键帧、撤销、重做与重开(默认 en-US)
+DIRECTOR_STAGE_LOCALE=zh-CN node tests/browser/director_stage_entry.mjs # 同一导演台与 GLB 流程走中文界面
+node tests/browser/director_stage_gizmo.mjs # 预览窗口内拖动操作轴摆位,不写关键帧,单次撤销还原
+DIRECTOR_STAGE_LOCALE=zh-CN node tests/browser/director_stage_gizmo.mjs # 同一摆位流程走中文界面
+node tests/browser/director_stage_storyboard.mjs # 连续分镜:时间轴 `+` 上方的机位单选栏、共享追加命令、选中与播放头、撤销重做、保存重开与 HTTP 命令等价结果;以及预览来源:来源选择器、按分镜或固定机位预览与分镜末端保持、取景器/机位预览/分屏/定格同源、位姿提交落在预览机位、机位列表点击移动机位预览而保留分镜预览,且视图状态不弄脏草稿;以及块展示:选中填充与播放头白框各自独立并可叠加、共享边界与终点的归属、按空闲时间异步生成并在机位或场景变化后刷新的缩略图、窄块先隐名称后隐缩略图、播放中缩略图刷新不影响视口与点击响应;以及拖动反馈:抓取光标、只有被拖块跟随指针、标出块将插入位置的粗线、拖动中其余不动且不写入、被拖块在键盘焦点下不带焦点环、松手后播放头落在被拖块的新起点、保存被拒时顺序与播放头一起还原、取消后在空白的轨道或标尺上松开不移动播放头(默认 en-US;设置 DIRECTOR_STAGE_STORYBOARD_SCREENSHOT_DIR 可另存界面截图)
+DIRECTOR_STAGE_LOCALE=zh-CN node tests/browser/director_stage_storyboard.mjs # 同一分镜流程走中文界面
+node tests/browser/director_stage_animation.mjs # 动画 GLB 导入、播放头采样与 MP4 同源合成
+node tests/browser/director_stage_output.mjs # 定格与 MP4 登记为工程资产并被时间线引用
+CREATION_DEVICE_SCALE_FACTOR=2 node tests/browser/director_stage_output.mjs # 同一流程在高 DPI 下复验定格尺寸
+node tests/browser/director_stage_delivery.mjs # 被后端明确拒绝的存储投递只损失一次尝试,随后重规划恢复渲染与应用
node tests/browser/reference_reconnect.mjs # 参考连线删除后重连
node tests/browser/context_menu_dismissal.mjs # 右键菜单关闭
node tests/browser/mp4_export.mjs # 合成 MP4(WebCodecs + 软件 AAC)
diff --git a/docs/guides/camera-moves.md b/docs/guides/camera-moves.md
new file mode 100644
index 000000000..5947db750
--- /dev/null
+++ b/docs/guides/camera-moves.md
@@ -0,0 +1,130 @@
+# Camera moves
+
+In Director Stage, open **Cameras**. **Camera placement** creates a new camera around a subject; **Camera moves** animates an existing camera. Choose the destination explicitly when no camera is selected. Changing the Director preview source does not redirect that destination and applying a move adds no Storyboard block.
+
+Choose **Push in**, **Pull out**, **Lateral**, **Rise**, or **Descend** to open three steps: **Starting composition**, **Movement path**, and **Timing and preview**. Back and step navigation preserve the draft. Adjust position, starting target, and field of view, then enter travel distance in metres, start and duration in seconds, and easing. The scene view shows the actual scene, movement path and endpoints beside the destination camera at its output aspect. Both use the same absolute preview time, including character animation. Play and scrub the independent preview without moving the main playhead. Parameter changes, Cancel, Escape, and Close save nothing and add no undo entry; closing restores the editing context and focus unless a newer control has focus. **Apply movement** saves the complete recipe as one edit. In Dynamic mode, the camera's movement lane shows its interval; click it to reopen parameters or delete the move. Save stage edits after using Undo or Redo to persist that history navigation.
+
+In **Starting composition**, select **Move draft camera** or **Move draft target** above the scene preview and drag a world X/Y/Z arrow. These use the stage's translation controls and edit the same values as the position and target fields. With the geometry view focused, Left/Right moves X, Up/Down moves Y, and Page Up/Down moves Z by 0.1 m; hold Shift for 0.01 m. Editing returns the independent preview to the movement start. The scene framing stays fixed while manipulating the draft; **Fit scene** reframes without changing it. The path and timing steps fit their current path automatically. Pointer cancellation or focus loss restores the gesture's original endpoint; the draft remains open. Invalid geometry keeps the last valid preview visible so you can correct it with the handles or numbers. Changes remain temporary until Apply.
+
+The move samples its initial composition from the destination camera at the proposed start time. Changing its timing retains that composition. **Resample starting composition** shows the draft position, target and FOV it will replace and the sampled replacement before you choose **Replace composition**. Capturing an object takes its world-space position at the preview time, not a continuous tracking relationship; later object movement does not change the captured point.
+
+Applying an edited first composition also changes this camera’s static framing before the move, as disclosed in the wizard. Static baseline keys change atomically with it. Existing position/target animation requires reviewed replacement; later move seams still need matching poses. An edited static starting FOV updates the static lens baseline. Animated lens keys stay independent and disable the wizard FOV input; an Agent request to replace that animated FOV is rejected. Reopening and changing the move position preserves a later independent lens edit. Position and target are controlled by the recipe; lens and up-vector channels remain independent. Push-in must stop before reaching the fixed target. After the move ends, each controlled channel holds its endpoint until the next owner or a continuous authored manual segment resumes. Deleting a move removes its influence and reveals the base/manual camera; Undo restores the same recipe identity.
+
+Times use absolute seconds, normalized to nanosecond precision, and FPS changes do not retime them. New moves need at least one current frame, must fit inside the main timeline, and cannot overlap on the same camera. Moves on different cameras may run together. Shortening the timeline below a move's end rejects the edit; delete or retime the move first.
+
+Existing animation affecting a preset-controlled channel is refused by default, including interpolation spanning the move and animation conflicting with endpoint hold; reviewed replacement is available as described below. Constant channel keys are a static baseline. Starting poses must join that effective baseline or the preceding move's endpoint within 0.000001 stage units per vector component. The renderer fixture, units and limits of this comparison are described below. Unsupported preset/algorithm versions are explicitly refused without rewriting the project.
+
+Agents use `director.cameraMove.presets`, `director.cameraMove.get`, and `director.cameraMove.preview` queries. Preset discovery includes typed parameters, defaults, units, ranges, algorithm version, controlled channels and bilingual names. The UI uses a generated copy of this same catalog for preset choices, initial values, numeric limits, options and displayed units; changing the interface language preserves business IDs and saved values. The preview reports current document version, admission reason and affected range through the timeline end, without opening an editing session. `director.cameraMove.put` inserts or updates a complete clip on an explicit camera; `director.cameraMove.delete` removes one. `applyStartingComposition: true` explicitly includes the first move’s static composition change in `put` or its side-effect-free preview; the preview discloses before/after composition and the impact from time zero when the baseline changes. Without it, the normal seam rule applies. Both mutations require the current editor-document version and normal project authorization. Retrying the same operation ID and input returns its original receipt; a changed input must use another ID. The UI's document-save operation and these commands enforce the same admission rules.
+
+Playback, helpers, thumbnails and the existing browser renderer use the shared stage sampler. Video rendering still requires the browser; camera moves do not add a background renderer.
+
+Drag a movement body in the Dynamic timeline to move it with duration preserved. Drag its left edge to keep the end fixed, or its right edge to keep the start fixed. Stretching maps the complete normalized path to the new interval; it never trims the path or ripples other moves or Storyboard blocks. Gestures snap to current FPS and commit once on release, with one undo step. No change means no save. Escape, pointer cancellation or window blur cancels; releasing afterwards over an empty lane or outside the track does not save or move the playhead.
+
+Open the interval’s **Timing and preview** step for precise start, duration and stretch endpoint inputs. Turn off **Snap timing to current FPS** for fractional seconds. Out-of-bounds intervals, less than one frame, same-camera overlaps and discontinuous composition seams reject while retaining original content. Agents use `director.cameraMove.retime` with `documentId`, `cameraId`, `clipId`, `edge` (`move`, `left`, `right`), absolute seconds `time`, and optional `snapToFrame` (default true). This preserves identity, starting composition, path, easing and distance under shared versions, authorization, admission and operation receipts.
+
+**Lateral**, **Rise**, and **Descend** require a viewing policy. **Fixed world target** holds the captured target point throughout the move. **Parallel sightline** translates camera and target by the same vector, preserving the opening viewing direction. Both control position and target; independent lens and up-vector animation remains editable. Lateral left/right follows the horizontal right axis of the opening sightline (forward crossed with world Y), not the changing view during the move. An almost vertical opening sightline has no stable horizontal lateral axis and is rejected. Rise and descend move along positive and negative world Y. All distances use stage metres, with an allowed range of 0.001–10000 m. Shortcuts **0.5 m**, **1 m**, and **2 m** write those exact resolved distances. Duration alone scales traversal speed; easing changes normalized progress, without another speed multiplier. Start, midpoint, endpoint, and held endpoint use the same shared sampler in preview and normal rendering. A fixed-target path that reaches or crosses its target is rejected even when both endpoints are separated.
+
+Agents discover translation IDs `lateral`, `rise`, and `descend` in `director.cameraMove.presets`. Supply `parameters.distance` in metres and explicit `parameters.viewingPolicy` (`fixed-target` or `parallel-sightline`); `lateral` also requires `parameters.direction` (`left` or `right`). Reopen and edit the same clip identity through `director.cameraMove.put`, or adjust timing through `director.cameraMove.retime`. Policy and direction survive saving, reopening, and parameter edits.
+
+**Orbit** and **Half arc** rotate the camera and starting target together around world Y at a fixed world center, preserving the opening pose. The center initially captures the starting target; later target edits never silently change it. With the center at the target, the camera continues to look at that point. An offset center rotates the captured sightline too; this is not live object tracking. Camera and target heights stay constant. Lens and up-vector channels remain independent. Clockwise, viewed from +Y, moves +Z toward +X; counterclockwise reverses it. A nonzero horizontal camera radius is required. Orbit accepts 0.1–360°; Half arc supplies exactly 180° using the same curved sampler. A full circle returns to its starting position while traversing the full circle, including the opposite midpoint. Duration and easing map progress along this curve. Preview, camera helpers, scene paths, thumbnails and browser rendering share this evaluation.
+
+Agents supply `presetId: "orbit"` or `"half-arc"`, `algorithmVersion: 1`, and `parameters.center` (`x`, `y`, `z` in metres), `parameters.orbitDirection` (`clockwise` or `counterclockwise`) and `parameters.sweep` in degrees (`180` for half arc). These resolved parameters persist and remain editable through the same commands, version checks, ownership, seam validation, history and timing operations as other moves.
+
+**Spiral rise** (`spiral-rise`, algorithm version 1) uses the same fixed center, direction and 0.1–360° sweep as Orbit, plus independent `parameters.height` of 0.001–10000 metres. Both camera and captured target rise equally along world Y as they rotate; the world center stays fixed. This preserves the opening pose and viewing separation without following a subject. Duration, easing and stretching apply to the complete angular and height path together. Height remains editable after reopening; lens and up channels remain independent.
+
+Orbit, half-arc and spiral orientation admission checks static up vectors analytically over the complete sweep, including interior extrema. Straight moves prove that the cross product of their entire sightline segment and the independent up-key hull stays separated from zero. This also covers parallel-sightline moves, push/pull and the held endpoint after a move. Up magnitude does not change orientation; zero and collinear paths reject. These are whole-path proofs, not checks at selected frames. Animated up remains independent and is conservatively admitted when all keys retain a common vertical sign and their vertical/horizontal bounds prove separation from the rotating sightline; ambiguous orientations reject rather than relying on sparse samples. This can reject otherwise valid strongly tilted animation; adjust the up keys or composition. Zero and collinear vectors reject.
+
+**Pan left**, **Pan right**, and **Tilt** (`pan-left`, `pan-right`, `tilt`, version 1) control only the target channel. `parameters.angle` is a positive angle in degrees: 0.1–180° for pan, 0.1–89° for tilt. Tilt also requires `parameters.tiltDirection` (`up` or `down`). Pan left rotates the captured sightline around world +Y (a forward −Z view turns toward −X); pan right reverses this. Tilt rotates around the captured horizontal right axis (opening forward crossed with world +Y); up turns toward +Y and down reverses it. These axes are captured once and do not follow later camera changes. A vertical opening sightline has no stable horizontal frame and rejects.
+
+The preset adds no position movement. Its target is the effective sampled position plus the rotated captured sightline vector, retaining its original length. With no independent position animation, the position stays fixed throughout. You can independently edit or animate position and FOV: position edits also translate the rotated target offset; they do not replace the captured angular path. Thus combining pan/tilt with manual position animation deliberately produces translation plus rotation. A preceding position-owning move retains its endpoint hold while a later angular move runs. Angular-to-angular joins compare relative sightlines rather than stale world targets, so independent position edits remain valid. Other joins retain the shared pose checks. Overlapping recipes remain forbidden even if ownership differs. Direct target edits explain recipe ownership; edit the movement instead. Reopening a recipe and changing its angle preserves untouched independent position/lens values even when applying another explicit composition change.
+
+The complete angular sweep is checked analytically against static up, including interior collinearity. Animated up is conservatively checked using the cone containing its key values; zero, collinear or unproven paths reject. This can reject valid strongly tilted animated up. Adjust its keys or the opening target. Derived target bounds must also preserve finite coordinates and representable camera-target separation. Preview, playback, thumbnails and the existing browser renderer all use the same position-relative evaluation, including eased progress, endpoint holds and stretched timing.
+
+A first angular move with a positive start must join the actual manual target at that time, using the interpolated position plus the captured offset. Stale reference positions and independent position edits that change this opening target reject with the seam reason. Keep the position at the opening boundary when authoring later position motion (for example, a position key at the move start). At time zero there is no preceding frame: the recipe defines the opening target relative to the independently sampled position.
+
+**Dolly zoom** (`dolly-zoom`, version 1) keeps a fixed framing anchor on the optical axis while moving the camera and changing its vertical field of view together. Set `parameters.anchor` explicitly to the starting target in world metres and `parameters.distance` to a signed distance: positive toward the anchor, negative away, with absolute value 0.001–10000 m. The wizard captures the starting target as the initial anchor; editing either target or anchor updates the other. Object capture records a fixed world point, without tracking later movement. The move owns **position, target, and focalLength** including their endpoint holds. Target ownership keeps the optical axis at the anchor. Up and static rig roll remain independently editable; existing animation in any owned channel requires reviewed replacement.
+
+The `focalLength` channel still stores **vertical FOV in degrees**. The wizard displays the coupled starting and ending FOV; `director.cameraMove.preview` returns the same `coupledLens` values, unit, anchor and signed distance. If opening anchor depth is `d0`, current positive depth is `d`, and opening vertical FOV is `v0`, the sampled FOV is `2 atan((d0/d) tan(v0/2))`. At 10 m and 90°, moving 5 m toward the anchor ends at 126.86989765°. The apparent scale of a plane through the anchor, perpendicular to the sightline, stays constant; foreground and background at other depths change perspective. A three-dimensional subject has depth and need not retain every silhouette point exactly.
+
+The complete eased path must remain before the anchor with sufficient floating-point separation, representable translation, and vertical FOV **1–179°**. Positive depth and FOV are monotone, so analytic endpoint bounds prove the entire interval rather than checking a few frames. Up interpolation is checked conservatively over its whole key-value hull; zero, near-collinear or unproven orientations reject. The shared interpolator also rejects finite key endpoints whose subtraction overflows. Adjust the anchor, distance, starting FOV or up keys when rejected. Duration and easing apply to translation and lens together. Reopen, retime, undo and save the same recipe through the usual workflow. Preview, playback, thumbnails and browser MP4 rendering use the shared sampler and freeze accepted export inputs. Rendering still needs the browser. Any inspector millimetre value uses its explicitly labelled 35 mm film / 16:9 sensor convention; recipe values are never reinterpreted as millimetres.
+
+When a controlled channel has existing animation, **Review existing animation** lists the destination camera, channels, interpolation/anchor/hold reasons and full replacement range. You can **Adjust movement range** or explicitly select **Replace animation in the disclosed range** before Apply. Review is a read-only query: it does not save the stage or add undo history. Static baseline keys and manual animation completed before the move remain available.
+
+Replacement keeps each channel’s original safe left bounding key and earlier curve, including its Bézier transition. The disclosed union starts at the earliest affected boundary and ends at the stage duration because the movement continues holding its endpoint. A channel whose conflict starts later keeps its own safe boundary. This can be wider than the clip; it does not stretch the clip or retime Storyboard cuts. An explicit opening-composition change discloses pre-roll from zero. If other ownership, geometry or join constraints make replacement impossible, Apply stays unavailable: adjust the range or resample the composition. Up vectors are compared as normalized orientations; positive magnitude changes alone are not animated orientation.
+
+Agent preflight uses the same `director.cameraMove.preview` query. `impact` contains `cameraId`, `channels`, per-channel `channelRanges`, the full `affectedRange`, and stable reason values. `replacement.canApply` reports whether the replacement also satisfies all remaining rules. Explicitly copy `replacement.review` (`version` and opaque `basis`) to `director.cameraMove.put.payload.replacementReview` only after reviewing that exact range. The basis includes the complete proposed recipe, original camera channels and easing, duration and composition choice. Default submission rejects conflicts. A changed document revision, recipe or curve invalidates the review; reread and review again rather than substituting a newer version automatically.
+
+The wizard preserves its draft when review expires or Apply fails. Review uses saved animation. Other stage edits can commit atomically with replacement; save pending camera/curve edits before reviewing if they differ from the saved impact basis. Replacing animation, recording manual boundaries and saving the recipe form one undoable edit. Deleting the resulting clip exposes its new manual baseline and does not restore erased animation; undo the original replacement to restore the earlier curve. Ordinary document saves and atomic batches enforce the same review requirement when erasing animation while introducing or changing a clip.
+
+
+Ordinary camera up keys can still be opened and edited when they contain a zero vector or interpolate through zero. The renderer uses world **+Y** for zero or nonfinite sampled up, without changing the authored keys. Finite nonzero vectors are normalized with scaling, including very large or small values. Opposed directions can change orientation abruptly around their zero midpoint; this fallback does not approve an unsafe movement recipe. Movement admission still proves the complete path against its up channel.
+
+## Joins, explicit alignment and manual resumption
+
+Adjacent moves own half-open intervals: the right move owns the shared timestamp. The final endpoint remains sampleable, including with Bezier easing; a completed move holds each owned channel until later authored motion takes ownership. Moving or stretching retains the stored starting composition.
+
+A discontinuity identifies the clip, absolute seam time, channel, stored value and required value. **Align … to preceding pose** proposes only that recipe’s owned starting values. Pan/tilt joins compare the captured target-minus-position sightline, except that the first angular recipe starting at time zero compares the absolute target, matching admission. Independent position continues to move the sampled sightline. Roll compares normalized baseline up; static roll remains independent. Dolly zoom includes starting vertical FOV and its disclosed framing anchor. Other geometry, times, neighbors and manual curves remain unchanged. Alignment is a draft until **Apply movement**, which revalidates geometry, every join, animation ownership, locks and the original editor document version.
+
+When changing an earlier endpoint breaks a following join, the wizard also offers that following recipe by name. Select it explicitly to include its disclosed starting-value changes in the same atomic, undoable save. Further joins must also pass; nothing is automatically propagated. Undo restores the original recipes together. A stale version rejects the complete save and preserves the draft. To retain both compositions, author a separate transition with ordinary camera keys: remove the conflicting recipe, or convert it when conversion is available, then deliberately connect the endpoints. No jump, blend or external curve rewrite is inserted.
+
+Manual resumption begins at the left anchor of the first nonconstant authored segment at or after the move’s endpoint, only if that anchor matches the held value. The entire following manual suffix then plays normally, including later segments departing from the original endpoint. A subsequent recipe is validated independently. Earlier interpolation crossing the move still conflicts. Tiny authored changes are not suppressed by the seam tolerance. First-key extrapolation remains unchanged; if a continuous resumption cannot be represented without changing earlier samples, the operation refuses it rather than synthesizing anchors. A mismatching manual anchor has no automatic alignment proposal: adjust the authored transition or explicitly review replacement of the disclosed suffix. Where replacement has no earlier safe boundary, its disclosure expands to time zero; it never claims the earlier framing was preserved.
+
+Agents read the same `director.cameraMove.preview` result: `seams` includes `clipId`, `time`, `channel`, `kind`, `actual`, `expected`, `tolerance` and `alignedClip`. A selected starting-composition proposal can be submitted as `director.cameraMove.put.clip`; manual-anchor proposals have `alignedClip: null`. To edit an earlier recipe and explicitly align selected following recipes, apply all selected changes in one `editor.save` with `expectedVersions` bound to the queried revision. A batch of separately invalid puts is not an alignment transaction. Existing stable command IDs, replay, locks, atomic receipts and history undo apply. Preview is read-only. Replacement still requires the separate reviewed `replacementReview` token.
+
+### Comparison tolerance and rendered fixture
+
+The admission tolerance is **0.000001 per component**: position and target in stage metres, vertical FOV in degrees (the stored `focalLength` channel), and normalized up-vector components. Compare only channels owned by the incoming recipe, including the relative sightline for pan/tilt. It is a numeric join tolerance, not a promise that every scene or camera scale renders identically.
+
+The serial `DIRECTOR_STAGE_SEAMS_ONLY=1` browser fixture renders three red/green/blue blocks at different depths and a floor grid through `poseStagePreviewCamera` and a real antialiased Three.js WebGL renderer. At 1920×1080, pixel ratio 1, Chromium 1255/SwiftShader, camera (5, 3.5, 7) looking at (0, 1, 0), 45° vertical FOV, each axis is perturbed independently by 0.000001. The fixture requires landmark displacement below 0.01 pixel, changed-pixel fraction below 0.001, and RGB RMS difference below one 8-bit intensity level. Actual measurements from the fixture are:
+
+| Channel | Maximum landmark displacement (pixels) |
+| --- | ---: |
+| Position | 0.0000410 |
+| Target | 0.0001420 |
+| Normalized up | 0.0002872 |
+| Vertical FOV | 0.0000084 |
+
+Across these ten comparisons, at most 116 of 2,073,600 pixels changed (0.00005595 fraction), maximum RGB RMS difference was 0.1091 and maximum individual channel difference was 27/255 at antialiased edges. A separate 0.01 m position discontinuity moved a landmark 0.2540 pixels, demonstrating fixture sensitivity. The browser retains the recognizable rendered PNG and raw per-axis readback metrics. This bounds this representative fixture only: near-singular views, extreme scales, other scenes, other GPUs and encoded video may amplify changes. Geometry admission remains separate; no MP4 accuracy claim is inferred from this fixture.
+
+## Convert a saved movement to editable keys
+
+Open a saved movement and choose **Convert saved movement to keyframes**. This converts the saved recipe, excluding unsaved inspector changes. One versioned transaction writes ordinary keys on only that preset's owned channels and removes the recipe. The camera, other recipes, unrelated channels, static roll, Storyboard and objects keep their identities. The ordinary channel controls and keyframe lanes can then edit the result; edits never reconstruct a preset. Undo restores the same original clip ID and recipe.
+
+Conversion includes each owned channel's effective endpoint hold until the next owner, existing manual resumption or stage end. Pan/tilt targets include independently sampled position; roll includes the effective viewing axis throughout the hold. Existing incoming curves and manual suffixes remain in place. Ordinary `manualBoundary` keys explicitly release earlier recipe holds, even for constant channels; this ownership flag alone does not change incoming interpolation. `holdIncoming` independently means that the preceding ordinary key holds until this timestamp. Conversion uses that incoming step only when replacing an otherwise hidden manual baseline with the accepted effective value, preventing an artificial pre-roll bridge. An ordinary zero-time anchor preserves first-key backward extrapolation when required. These flags retain no recipe or second editable projection. Editing a boundary key is an ordinary key edit; deleting or moving a boundary that would reintroduce a conflict with a retained recipe rejects the whole save. Boundaries inside an active owned recipe interval also reject. Undo is the way to recover the complete conversion.
+
+Agents use `director.cameraMove.convert` with `documentId`, `cameraId`, `clipId`, a stable `commandId`, and `expectedVersions` for the Director document. It shares UI validation, edit leases, canvas locks, atomic storage and history. Identical retries return the original receipt, including a definitive rejection; changed input under the same ID rejects. Queries discover the result as ordinary channels and no longer return the removed recipe. A failed conversion writes neither keys nor a partially removed clip.
+
+Conversion samples the public effective camera/up behavior. It seeds timing at roughly 30 Hz (at most 240 initial subdivisions per existing timing interval), includes authored keys and recipe boundaries, and adaptively probes quarter, half and three-quarter points. Probe thresholds are 0.00001 m per position/target component, 0.00001° vertical FOV and 0.0000001 per normalized-up component. Bézier inversion uses 40 binary steps in both samplers. Up magnitude has no orientation meaning; preserving its underlying magnitude at joins retains incoming interpolation. Refinement stops with an explicit, localized precision rejection at depth 22 or 100,000 samples per channel rather than claiming success on an unrepresentable path.
+
+The output fixture checks all timestamps at supported **24, 25, 30, 50 and 60 FPS**, plus fractional starts/endpoints and independent intermediate examples, for all thirteen presets. It admits Euclidean position/target error below 0.00003 m, FOV error below 0.00003° and normalized-up error below 0.0000003; orientation error is below 0.001°. Those measured output bounds are distinct from the local refinement thresholds. The real WebGL fixture at 1920×1080, pixel ratio 1, Chromium/SwiftShader compares recognizable colored blocks at multiple depths through the shared renderer, requiring landmark displacement below 0.02 pixel, changed-pixel fraction below 0.001 and RGB RMS below one 8-bit intensity level. Quarter-time symmetric easing, curved orbit/spiral, both translation policies, roll with static roll and dolly zoom are included. These are representative-scene checks, not universal bounds for arbitrary scales, singular projections, GPUs, or encoded video. The conversion check uses the current browser renderer; it does not add a background renderer.
+
+In the representative six-second fixture, each preset was checked at 675 distinct timestamps. Maximum observed errors across the thirteen presets were position **0.000009855 m**, target **0.000011514 m**, vertical FOV **0.000009461°**, normalized up **0.0000001134**, orientation **0.00005596°**, and projected landmark **0.001540 pixel**. The 26 selected full-resolution raster pairs were identical at 8-bit readback on that SwiftShader run; this does not establish subpixel identity or equality on other renderers. The retained colored-block PNG confirms recognizable scene content rather than an empty render.
+
+## Collaboration and delivery recovery
+
+Camera movements use the project's recoverable change notifications. Duplicate or older notifications do not replace newer state; a disconnected stream or unavailable event gap causes an authoritative snapshot read. Thumbnail keys include recipe parameters, algorithm version, timing, composition and easing, so a late picture from earlier camera input cannot replace the current one. Background refresh keeps an open editor's selection, focus, playhead and draft. A stale save or replacement review rejects rather than substituting a new version; explicitly review the latest saved animation before deciding to apply again.
+
+Distinguish these outcomes:
+
+- **Applied:** the original operation has a confirmed receipt. Its identity and receipt remain stable after later Agent edits.
+- **Unchanged:** an unchanged operation writes no new camera content.
+- **Rejected:** validation, versions, locks or editing ownership refused the complete operation; no partial movement or keyframe conversion was committed.
+- **Delivery unresolved:** the response and receipt lookup were unavailable. Keep the draft and retry the same operation to reconcile its original receipt. Do not create a replacement movement or change its clip ID. Camera commands and history inverses retain their original transport operation across a tab reload when session storage is available.
+
+A successful preview refresh does not clear an unresolved or rejected operation message. If an operation committed but newer local input or a later server edit makes its result differ from the expected history step, the stage keeps the local draft and blocks further project writes from it. **Download retained draft JSON** preserves its current stage content through the existing JSON export (registered asset references, not embedded model bytes; register temporary imported models first). **Close to inspect confirmed project** offers the existing keep-editing/discard-close choice. Closing discards the in-memory draft: download it first, then reopen the stage to inspect authoritative content. Reopening does not automatically merge or restore that draft. Keep a downloaded draft as a separate review copy; importing it is an explicit subsequent edit with normal validation.
+
+Undo and redo across conversion use its original command receipt and require matching before/after content. A delayed response cannot replace a newer numeric drag. Later committed edits can make history restoration conflict; reread the saved project rather than retrying with a substituted revision. Saved clip identity, versioned algorithm, parameters and effective animation survive disk reopening and supported undo/redo; receipts record past operations, not a promise that their result is still the latest camera state.
+
+The movement lane and timing inspector report **Fully visible**, **Partly visible**, or **Never visible in Storyboard**. Coverage measures the movement interval against the current cut selection, including repeated uses of the same camera. It excludes time beyond the Storyboard output. Movement still runs at absolute stage time while another camera is selected; returning to that camera shows its elapsed movement. Pinned-camera output always samples the pinned camera independently of cuts.
+
+Renaming a camera changes its lane label without changing movement IDs. Deleting a camera removes its movements and dependent Storyboard blocks together; undo restores their identities. Reducing stage duration rejects out-of-bounds movements and lists every camera/movement ID. Existing Storyboard minimum-duration clamping still applies. First explicitly adjust or delete affected movements, or submit those adjustments before the duration change in one atomic batch. No path is trimmed or deleted automatically. Whole-document saves and Agent commands enforce the same rules.
+
+## Deliver a camera-move video
+
+Choose **Render preview MP4**, select a camera or **Storyboard**, choose quality and frame rate, then **Export**. A pinned camera follows that rig for the entire stage; Storyboard selects cameras at the existing cuts and ends at the last block. Both evaluate movement at absolute stage time. Download the MP4 to inspect the actual video, or use **Add preview video to canvas** to register it as a project asset.
+
+Export accepts a fixed stage revision, movement recipes, registered media references and output plan. Later clip edits do not change that accepted video's frames or execution evidence. Publishing it creates a separate rendered asset and execution snapshot; it does not replace the currently edited stage. Current canvas binding, locks, available assets and normal publication rules still apply. If the publication target changes, inspect the saved project before retrying.
+
+Keep the browser and Director Stage open until rendering finishes. This renderer uses the browser's GPU and video encoder; closing the browser does not continue rendering in the background. File creation and technical checks do not imply creative approval. Review the decoded video before delivery.
+
+The guided preview paints controls before refreshing its two images, samples the latest requested time and keeps updating during playback. While refreshing, each image's caption retains its captured time. This temporary preview does not save movement until Apply.
diff --git a/docs/guides/camera-moves.zh-CN.md b/docs/guides/camera-moves.zh-CN.md
new file mode 100644
index 000000000..c94aacc8a
--- /dev/null
+++ b/docs/guides/camera-moves.zh-CN.md
@@ -0,0 +1,130 @@
+# 相机运镜
+
+在导演台打开「机位」。「机位放置」围绕主体创建新机位;「运镜」让现有相机运动。未选相机时,先明确选择目标。改变导演预览来源不会更换目标,应用运镜也不会添加分镜块。
+
+在“起始构图”中,选择场景预览上方的“移动草稿相机”或“移动草稿目标”,再拖动世界 X/Y/Z 轴箭头。它们复用导演台的平移控制,与位置和目标数值字段编辑相同端点。聚焦几何视图后,左右键调整 X、上下键调整 Y、Page Up/Down 调整 Z,每次 0.1 米;按住 Shift 时为 0.01 米。调整会将独立预览返回运镜起点,操控期间场景取景保持固定;「适配场景」只重新取景,不改变草稿。路径与时间步骤自动适配当前路径。指针取消或失去焦点会恢复本次手势开始前的端点,保留向导草稿。非法几何保留上次有效预览,便于继续通过箭头或数值修正。应用前所有变化均为临时草稿。
+
+选择「推近」「拉远」「横移」「上升」或「下降」,按「起始构图」「运动路径」「时间与预览」三个步骤设置。上一步和步骤导航保留草稿。调整位置、起始目标和视场角,再填写移动距离(米)、开始和时长(秒)以及缓动。场景视图显示实际场景、路径与端点,旁边的目标相机画面使用该机位的输出比例。两者以同一绝对预览时间采样角色动画。独立播放和拖动预览不改变主播放头。修改参数、取消、Escape 和关闭均不保存或增加撤销记录;退出恢复编辑上下文及焦点,同时尊重新近获得焦点的控件。「应用运镜」一次保存完整配方。在动态模式中,相机下的运镜轨道显示区间;点击区间可重新编辑参数或删除。使用撤销或重做后,需要应用导演台编辑以保存历史导航结果。
+
+运镜从目标相机在拟定开始时间的采样构图初始化;改变时间保留该构图。「重新采样起始构图」先显示将替换的草稿位置、目标、视场角以及采样后的值,选择「替换构图」后才更新。捕获对象时记录预览时间的世界坐标,不建立持续跟踪关系,之后移动对象不会改变捕获点。
+
+应用编辑后的首段起始构图还会改变运镜前的相机静态构图,向导会明确提示;常量基线关键帧与配方一并提交。现有位置或目标动画会被拒绝,后续运镜仍需接续。编辑静态起始视场角会更新静态镜头基线;已有镜头动画保持独立,并禁用向导中的视场角输入。Agent 请求覆盖已有视场角动画时会被拒绝。重新打开并调整运镜位置会保留之后独立编辑的视场角。位置和目标由配方控制,视野和上方向通道仍可独立编辑。推近必须在到达固定目标前停止。结束后,各受控通道保持终点,直到后续运镜或连续的手动动画接管。删除运镜会移除其影响并显示基础/手动相机状态,撤销可恢复相同标识的配方。
+
+时间以绝对秒数保存并规范化到纳秒精度,改变帧率不会重新定时。新增运镜至少覆盖当前一帧,必须位于主时间线内,同一相机的运镜不能重叠,不同相机可以同时运动。缩短主时间线导致运镜越界时会拒绝编辑,需要先删除或调整该运镜。
+
+默认拒绝影响预设受控通道的已有动画,包括跨越运镜区间的插值以及与终点保持冲突的动画;可按下文说明显式审查并批准替换。常量通道关键帧属于静态基线。起始构图必须与有效基线或前一个运镜的终点接续,各向量分量容差为 0.000001 舞台单位。下文说明渲染夹具、单位和此比较的适用范围。不支持的预设或算法版本会明确拒绝,原工程不被改写。
+
+Agent 可查询 `director.cameraMove.presets`、`director.cameraMove.get` 和 `director.cameraMove.preview`。预设目录包含类型化参数、默认值、单位、范围、算法版本、受控通道和中英文名称。预检返回当前文档版本、准入理由和延伸到时间线末尾的影响范围,不请求编辑会话。`director.cameraMove.put` 在明确指定的相机上添加或更新完整配方;`director.cameraMove.delete` 删除运镜。`put` 或其只读预检中的 `applyStartingComposition: true` 显式包含首段运镜的静态构图调整;预检返回构图调整前后的值,基线改变时影响范围从零秒开始。未指定时沿用正常接缝规则。两项修改命令都要求当前编辑文档版本并遵守正常工程授权。相同操作标识与输入重试返回原回执,改变输入必须换用新标识。界面的整文档保存与这些命令执行相同准入规则。 UI 使用由同一领域目录生成的契约,派生预设选项、初始值、数值限制和显示单位;切换界面语言保持业务 ID 与已保存数值不变。
+
+播放、辅助相机、缩略图和现有浏览器渲染器共用舞台采样器。视频渲染仍需浏览器参与,运镜没有增加后台渲染引擎。
+
+在动态时间线中拖动运镜主体可整体移动并保持时长;拖动左端固定结束时间,拖动右端固定开始时间。伸缩始终重映射完整路径,不裁剪、不推动其他运镜或 Storyboard。拖动按当前 FPS 吸附,释放后一次保存、一次撤销;无变化不保存。Escape、指针取消或窗口失焦取消手势,随后在空轨道或轨道外释放不会保存或移动播放头。
+
+打开区间的“时间与预览”步骤,可精确输入开始、时长和两个伸缩端点,并可关闭帧吸附。越界、不足一帧、同机重叠或构图接缝不连续均拒绝,原内容保留。Agent 使用 `director.cameraMove.retime`,指定 `documentId`、`cameraId`、`clipId`、`edge`(`move`/`left`/`right`)、绝对秒 `time` 和可选 `snapToFrame`(默认 true)。该命令保留身份、起始构图、路径、缓动和距离,共享版本、授权、接受检查与操作回执。
+
+「横移」「上升」「下降」需要明确的视线策略。「固定世界目标」始终保持捕获的世界目标点;「平行视线」将相机和目标等量平移,保留起始视线方向。两者均控制位置和目标,镜头与上方向动画仍可独立编辑。横移的左右方向由起始水平视线的右轴决定(前方向与世界 Y 轴叉乘),不会随运镜中的视角变化。起始视线接近垂直时没有稳定的水平横移轴,会被拒绝。上升和下降分别沿世界 Y 轴正向和负向移动。距离使用舞台米,允许范围为 0.001–10000 米;「0.5 m」「1 m」「2 m」快捷项写入这些明确距离。时长单独决定整体速度,缓动改变归一化进度,不叠加其他速度系数。起点、中点、终点和结束保持均由预览及正常渲染共用的采样器计算。固定目标路径若在途中到达或穿过目标,即使两个端点间距均为正也会拒绝。
+
+Agent 可通过 `director.cameraMove.presets` 发现 `lateral`、`rise`、`descend`。提交以米计的 `parameters.distance` 和明确的 `parameters.viewingPolicy`(`fixed-target` 或 `parallel-sightline`);横移还需提供 `parameters.direction`(`left` 或 `right`)。使用 `director.cameraMove.put` 重新编辑相同标识的配方,或用 `director.cameraMove.retime` 调整时间;视线策略与方向在保存、重开和参数编辑后保持不变。
+
+**环绕**与**半弧**让相机和起始目标一起绕固定世界中心的 Y 轴旋转,保留起始姿态。中心默认捕获起始目标,之后修改目标不会自动改变中心。中心与目标重合时,相机始终朝向该点;中心偏移时,捕获的视线也随之旋转,并非实时跟踪对象。相机和目标高度保持不变,镜头与上方向通道仍可独立编辑。从 +Y 看,顺时针从 +Z 转向 +X,逆时针相反。相机必须具有非零水平半径。环绕接受 0.1–360°,半弧固定为 180°,复用同一曲线采样器。整圆虽回到起点,仍经过圆周和对侧中点。时长和缓动决定沿曲线的进度,预览、辅助相机、场景路径、缩略图及浏览器渲染使用同一采样语义。
+
+Agent 提交 `presetId: "orbit"` 或 `"half-arc"`、`algorithmVersion: 1`,以及 `parameters.center`(米制 `x`、`y`、`z`)、`parameters.orbitDirection`(`clockwise` 或 `counterclockwise`)、`parameters.sweep`(度,半弧必须为 `180`)。这些确定参数持久化后可继续编辑,使用其他运镜相同的命令、版本检查、所有权、接缝验证、历史和时间操作。
+
+**螺旋上升**(`spiral-rise`,算法版本 1)复用环绕的固定中心、方向与 0.1–360° 扫角,另用独立的 `parameters.height` 指定 0.001–10000 米高度。相机与捕获的目标一起旋转并沿世界 Y 轴等量升高,世界中心保持固定。因此起始姿态与视线距离保持一致,不会跟踪主体。时长、缓动与时间伸缩同时作用于完整角度和高度路径。重开后可继续修改高度,镜头和上方向通道保持独立。
+
+环绕、半弧与螺旋上升对静态上方向在完整扫角范围内作解析校验,包括内部极值。直线运镜证明完整视线线段与独立上方向关键帧凸包的叉积始终远离零,覆盖固定目标、平行视线、推近、拉远及结束后的终点保持。上方向的正比例缩放不改变姿态;零向量和共线路径会被拒绝。这些是全路径证明,不依赖少量帧采样。动画上方向采用保守的凸包或锥体证明;无法证明安全的强倾斜动画也可能被拒绝,请调整上方向关键帧或起始构图。
+
+**向左摇摄**、**向右摇摄**与**俯仰**(`pan-left`、`pan-right`、`tilt`,算法版本 1)仅控制目标通道。`parameters.angle` 是正的角度值,单位为度:摇摄范围 0.1–180 度,俯仰范围 0.1–89 度。俯仰还需指定 `parameters.tiltDirection`(`up` 或 `down`)。向左摇摄绕世界 +Y 轴旋转捕获的视线(朝 −Z 的视线转向 −X),向右则反向。俯仰绕捕获的水平右轴(起始视线与世界 +Y 的叉积)旋转;向上转向 +Y,向下则反向。参考轴只捕获一次,不随之后的相机变更重算;垂直起始视线没有稳定的水平参考框架,会被拒绝。
+
+预设本身不移动位置。目标等于实际采样位置加上旋转后的捕获视线向量,保持原视线长度;没有独立的位置动画时,相机位置全程固定。位置和视场角仍可独立编辑或制作动画:位置变化同时平移旋转后的目标偏移,不覆盖捕获的角度路径。因此,将摇摄或俯仰与手动位置动画组合,会明确产生平移加旋转。前一段控制位置的运镜在后一段角度运镜中继续保持位置终点。相邻角度运镜按相对视线衔接,不按过时的世界目标衔接,独立位置编辑仍有效;其他组合保留共享构图衔接检查。同相机的预设仍禁止重叠,即使控制通道不同。直接编辑目标会解释运镜所有权,请改为编辑运镜。重开并修改转角时,即使同时修改另一项起始构图,也会保留未改动的独立位置与镜头值。
+
+静态上方向按完整角度路径解析校验,包含内部共线点。动画上方向按关键帧向量锥保守校验,零向量、共线或无法证明安全的路径会被拒绝;这可能拒绝部分有效但倾斜很大的动画,可调整上方向关键帧或起始目标。派生目标边界也必须保持坐标有限,以及可表示的相机与目标间距。预览、播放、缩略图和现有浏览器渲染共享以实际位置为基准的求值,包含缓动、终点保持和时长拉伸。
+
+首段角度运镜若在正时间开始,必须以插值后的位置加上捕获的视线偏移,衔接该时刻实际的手动目标。过时的参考位置,或改变该起始目标的独立位置编辑,会按构图衔接错误拒绝。制作后续位置动画时,请保留起始边界的位置(例如,在运镜开始时添加位置关键帧)。若运镜从零时刻开始,则没有之前的画面,预设会以独立采样的位置为基准定义起始目标。
+
+**滑动变焦**(`dolly-zoom`,算法版本 1)使固定构图锚点保持在光轴上,并联动相机位移与垂直视场角。显式设置 `parameters.anchor` 为以世界米为单位的起始目标,`parameters.distance` 为有符号位移:正值朝向锚点,负值远离锚点,绝对值为 0.001–10000 米。向导将起始目标捕获为初始锚点;修改目标或锚点会同步修改另一项。捕获对象只记录固定世界点,不跟踪后续运动。运镜控制**位置、目标和 focalLength**,包括终点保持;控制目标才能维持光轴指向锚点。上方向与静态滚转保持独立;受控通道已有动画时,需要显式审查并批准替换。
+
+`focalLength` 通道仍存储**以度为单位的垂直视场角**。向导显示联动起止视场角;`director.cameraMove.preview` 的 `coupledLens` 返回相同起止值、单位、锚点与有符号位移。设初始锚点深度为 `d0`,当前正深度为 `d`,初始垂直视场角为 `v0`,采样值为 `2 atan((d0/d) tan(v0/2))`。例如初始深度 10 米、视场角 90°,朝锚点移动 5 米后为 126.86989765°。经过锚点且垂直于视线的平面,其表观尺度保持恒定;其他深度的前景和背景会改变透视。立体主体具有深度,其每个轮廓点不保证严格不变。
+
+整个缓动路径都必须停在锚点前,保留足够浮点分离度和可表示的位移,并保持 **1–179°** 垂直视场角。正深度和视场角单调,解析端点界限可证明整个区间,而不是仅检查少量帧。上方向按全部关键帧值的凸包保守验证;零向量、近共线及无法证明安全的方向拒绝。共享插值器也会拒绝有限端点相减溢出的通道。被拒绝时请调整锚点、位移、起始视场角或上方向关键帧。时长与缓动共同作用于位移和镜头。通过常规流程重开、改时、撤销并保存同一运镜。预览、播放、缩略图和浏览器 MP4 渲染共用采样,并冻结已接受的导出输入。渲染仍需浏览器参与。检查器中的毫米值使用其明确标注的 35 毫米胶片 / 16:9 传感器约定;运镜值不会被重新解释为毫米。
+
+受控通道已有动画时,选择**审查已有动画**可查看目标相机、通道、插值/锚点/保持原因及完整替换范围。可**修改运镜范围**,或明确勾选**替换已披露范围内的动画**后再应用。审查是只读查询,不保存导演台,也不增加撤销记录。静态基线关键帧,以及在运镜开始前已完成的手动动画仍可使用。
+
+替换为每个通道保留原有安全左边界关键帧及更早的曲线,包括 Bézier 过渡。披露的总范围从最早受影响边界开始,持续到导演台结尾,因为运镜会保持终点。冲突较晚开始的通道使用自己的安全边界。这可能比运镜区间更宽,但不会伸缩运镜或调整分镜时间。显式修改起始构图时,披露从零开始的前段范围。如果其他所有权、几何或接缝约束使替换不可行,应用保持不可用,请修改范围或重新采样构图。上方向按归一化方向比较,仅正比例改变长度不算方向动画。
+
+Agent 使用相同的 `director.cameraMove.preview` 预检。`impact` 包含 `cameraId`、`channels`、各通道 `channelRanges`、完整 `affectedRange` 及稳定原因值。`replacement.canApply` 表示替换是否满足其余所有规则。审查准确范围后,明确将 `replacement.review`(`version` 与不透明 `basis`)传入 `director.cameraMove.put.payload.replacementReview`。依据涵盖完整拟定配方、原相机通道及缓动、时长和构图选择。默认提交拒绝冲突。文档版本、配方或曲线变化会使审查过期;请重新读取并审查,不要自动替换成较新版本。
+
+审查过期或应用失败时,向导保留草稿。审查使用已保存动画;其他导演台修改可随替换原子提交。如果待保存的相机/曲线修改与审查依据不同,请先保存这些修改再审查。动画替换、手动边界记录与配方保存构成一次可撤销编辑。删除运镜后显示新的手动基线,不会恢复已替换动画;恢复原曲线需要撤销最初的替换操作。普通文档保存和原子批处理同样检查:引入或修改运镜时删除已有动画不能绕过审查。
+
+
+普通相机上方向关键帧为零向量,或插值经过零点时,仍可打开并继续编辑。渲染器对零或非有限采样上方向使用世界 **+Y**,保留原始关键帧。有限非零向量先缩放再归一化,包括极大或极小数值。相反方向在零点附近可能突然改变姿态;此回退不代表不安全运镜通过接受检查。运镜仍按完整路径及其上方向通道验证。
+
+## 接缝、明确对齐与手动动画恢复
+
+相邻运镜采用左闭右开归属:共享时刻归右侧运镜。最终端点仍可采样,贝塞尔缓动也精确到达端点。完成后各受控通道保持终点,直到后续运镜或连续的手动动画接管。移动与伸缩保留已存储的起始构图。
+
+不连续时显示运镜、绝对接缝时间、通道、存储值和所需值。**将……对齐前序姿态**只提议修改所选运镜控制的起始值。摇摄/俯仰接缝比较目标减位置的相对视线;首个从零时刻开始的角度运镜按接受检查规则比较绝对目标。独立位置动画继续平移采样视线。滚转比较归一化基准上方向,静态滚转独立。滑动变焦包含起始垂直视场角及已披露的构图锚点。其他几何、时间、相邻运镜和手动曲线保持不变。对齐先作为草稿;**应用运镜**重新验证几何、全部接缝、动画归属、锁及原编辑器文档版本。
+
+修改前一段终点导致后一段接缝失配时,向导会按名称提供后一段对齐按钮。只有明确选择后,其披露的起始值修改才与当前运镜作为一次原子、可撤销保存一起应用。更后面的接缝也必须通过验证,不会自动传播修改。撤销一起恢复原运镜。版本过期时整次保存拒绝并保留草稿。如需保留两种构图,请另用普通相机关键帧创作过渡:移除冲突运镜,或在转换可用时转为关键帧,再明确连接两端。不会插入跳变、混合或外部曲线改写。
+
+手动动画从运镜终点之后(含终点)的第一个非常量动画段的左锚点恢复,前提是该锚点匹配保持值。之后整段手动后缀正常播放,包括偏离原终点的后续动画段。更晚的运镜独立验证。跨越运镜区间的较早插值仍是冲突。不会用接缝容差抹去细小的手动变化。首关键帧的反向外推语义不变;如果无法在保留较早采样的同时表示连续恢复,就明确拒绝,不会合成锚点。不匹配的手动锚点不提供自动对齐:可调整自己创作的过渡,或审查并明确替换已披露的后缀。替换缺少更早安全边界时,影响披露扩展至零时刻,不会声称保留了较早构图。
+
+Agent 使用相同的 `director.cameraMove.preview` 结果。`seams` 包含 `clipId`、`time`、`channel`、`kind`、`actual`、`expected`、`tolerance` 和 `alignedClip`。明确选中的起始构图提议可作为 `director.cameraMove.put.clip` 提交;手动锚点的 `alignedClip` 为 `null`。若要修改前段并明确对齐选定的后段,应在一次 `editor.save` 中提交全部选定修改,并用 `expectedVersions` 绑定查询到的版本;多个单独无效的 put 组成的 batch 不是对齐事务。已有的稳定命令 ID、重放、锁、原子回执和历史撤销规则继续适用。预览只读,动画替换仍需独立审查的 `replacementReview` 令牌。
+
+### 比较容差与渲染夹具
+
+接受检查容差为**每个分量 0.000001**:位置和目标使用舞台米,垂直视场角使用度(存储通道名为 `focalLength`),上方向比较归一化分量。仅比较新运镜拥有的通道;摇摄/俯仰比较相对视线。这是数值接缝容差,不保证任意场景和相机尺度下逐像素一致。
+
+串行运行的 `DIRECTOR_STAGE_SEAMS_ONLY=1` 浏览器夹具通过应用共用的 `poseStagePreviewCamera` 及真实抗锯齿 Three.js WebGL 渲染器,渲染不同深度的红、绿、蓝方块和地面网格。环境为 1920×1080、像素比 1、Chromium 1255/SwiftShader;相机位于 (5, 3.5, 7),朝向 (0, 1, 0),垂直视场角 45°,逐轴独立增加 0.000001。夹具要求标记点位移低于 0.01 像素、变化像素比例低于 0.001、RGB 均方根差低于一个 8 位强度级。实测结果:
+
+| 通道 | 最大标记点位移(像素) |
+| --- | ---: |
+| 位置 | 0.0000410 |
+| 目标 | 0.0001420 |
+| 归一化上方向 | 0.0002872 |
+| 垂直视场角 | 0.0000084 |
+
+十次比较中,2,073,600 个像素最多有 116 个变化(比例 0.00005595),最大 RGB 均方根差为 0.1091,抗锯齿边缘的单通道最大差为 27/255。另一个 0.01 米位置失配使标记点移动 0.2540 像素,证明夹具能观察真实差异。浏览器保留可辨识的渲染 PNG 和逐轴原始读回指标。结论仅限定此代表性夹具;接近奇异的视角、极端尺度、其他场景、GPU 和编码视频可能放大变化。几何接受检查独立执行,不能由此推断 MP4 精度。
+
+## 将已保存运镜转换为可编辑关键帧
+
+打开已保存运镜,选择 **将已保存运镜转换为关键帧**。转换使用已保存配方,不包含检查器中尚未保存的修改。一次带版本校验的事务只写入预设所控制通道的普通关键帧并移除配方。相机、其他配方、无关通道、静态滚转、分镜和对象保持原身份。随后可以使用普通通道控件和关键帧轨道自由编辑结果;编辑不会反推出预设。撤销恢复原 clip ID 和完整配方。
+
+转换包含各受控通道的终点保持段,直到下一位通道所有者、已有手动动画恢复点或舞台终点。摇摄和俯仰目标包含独立采样的位置;滚转在保持段也使用实际视线轴。已有的入段曲线和手动动画后缀保留。普通键的 `manualBoundary` 标记明确释放前序配方的保持,即使该通道恒定;此所有权标记本身不改变入段插值。独立的 `holdIncoming` 表示前一个普通键保持到本时刻;转换仅在以认可的实际值替换被配方遮蔽的手动基线时使用入段保持,防止在前段产生虚假的插值桥接。必要时添加普通的零时刻基线键,保留首键向前外推行为。这些标记不保留配方或第二份可编辑投影。修改边界键属于普通键编辑;删除或移动边界若与保留的配方重新冲突,整个保存操作会拒绝。在配方控制区间内部创建边界也会拒绝。需要恢复完整转换时使用撤销。
+
+Agent 使用 `director.cameraMove.convert`,传入 `documentId`、`cameraId`、`clipId`、稳定 `commandId` 和导演台文档的 `expectedVersions`。它与界面共用验证、编辑会话、画布锁、原子存储和历史。同输入重试返回原回执,包括明确拒绝;同 ID 不同输入会拒绝。查询结果显示普通通道,不再返回已移除配方。失败不会写入部分关键帧或只删除部分配方。
+
+转换以公共有效相机及上方向采样行为为依据。初始约按 30 Hz 取样(每段已有时间边界最多划分 240 段),纳入已有键和配方边界,并自适应检查四分之一、二分之一及四分之三处。局部检查阈值:位置及目标每分量 0.00001 米、垂直视场角 0.00001 度、归一化上方向每分量 0.0000001。两端采样器均以 40 次二分反解贝塞尔。上方向幅值不影响方向;保留衔接处的底层幅值可保留原入段插值。细分深度达到 22 或每通道超过 100,000 个样本时,返回双语精度拒绝,不把不可表达的路径报告为成功。
+
+输出夹具检查全部 **24、25、30、50、60 FPS** 输出时刻,以及非整帧起止点和独立中间位置示例,覆盖全部十三种预设。验收要求位置及目标的欧氏误差低于 0.00003 米、视场角误差低于 0.00003 度、归一化上方向误差低于 0.0000003,姿态误差低于 0.001 度。输出实测边界与局部细分阈值分别记录。真实 WebGL 夹具使用 1920×1080、像素比 1、Chromium/SwiftShader,通过共享渲染器比较不同深度的可辨认彩色方块,要求标志点位移低于 0.02 像素、变化像素占比低于 0.001、RGB 均方根差低于一个 8 位强度级。检查包含对称缓动的四分之一时刻、弧形环绕及螺旋、两种平移视线策略、带静态滚转的动态滚转和滑动变焦。这些是代表性场景检查,不是任意尺度、奇异投影、GPU 或编码视频的普遍误差保证。转换检查使用现有浏览器渲染器,没有增加后台渲染能力。
+
+代表性的六秒夹具对每种预设检查 675 个独立时刻。十三种预设中的实测最大误差为:位置 **0.000009855 米**、目标 **0.000011514 米**、垂直视场角 **0.000009461 度**、归一化上方向 **0.0000001134**、姿态 **0.00005596 度**、投影标志点 **0.001540 像素**。该次 SwiftShader 运行中选取的 26 对全分辨率图像在 8 位读回精度下相同;这不能证明亚像素位置完全相同或其他渲染器输出相同。保留的彩色方块 PNG 确认可辨认的场景内容,而非空画面。
+
+## 协作与交付恢复
+
+运镜通过工程现有的可恢复变更通知同步。重复或更旧的通知不会替换新状态;连接中断或无法补齐事件缺口时读取权威快照。缩略图键包含配方参数、算法版本、时间、构图与缓动,因此旧相机输入产生的迟到图片不能替换当前图片。后台刷新保留打开的编辑器中的选择、焦点、播放头和草稿。过期保存或替换批准会明确拒绝,不会自动换用新版本;决定再次应用前,请明确重新审查最新已保存动画。
+
+区分以下结果:
+
+- **已应用:** 原操作已有确认回执;后续 Agent 编辑不会改变原操作身份和回执。
+- **未改变:** 未发生内容变化的操作不会写入新的相机内容。
+- **已拒绝:** 验证、版本、锁或编辑权检查拒绝整个操作,不会提交部分运镜或部分关键帧转换。
+- **交付未确定:** 响应及回执查询暂不可用。保留草稿,重试同一操作以核对原回执,不要重新创建运镜或更换 clip ID。会话存储可用时,相机命令及历史逆操作在标签页重载后仍保留原传输操作。
+
+预览重新绘制成功不会清除交付未确定或拒绝信息。如果操作已提交,但较新的本地输入或后续服务端编辑使结果与预期历史步骤不同,导演台保留本地草稿,并阻止该草稿继续写入工程。**下载保留的草稿 JSON** 复用现有 JSON 导出以保留当前舞台内容(包含已登记素材引用,不内嵌模型字节;临时导入模型须先登记)。**关闭以查看已确认工程** 提供现有的继续编辑或直接关闭选择。关闭会丢弃内存草稿:请先下载,再重新打开导演台查看权威内容。重新打开不会自动合并或恢复该草稿。将下载的草稿作为单独的核对副本;导入它是后续明确操作,仍须通过正常验证。
+
+转换的撤销和重做使用原命令回执,并核对前后内容。迟到响应不能替换较新的数值拖动。后续已提交编辑可能使历史恢复发生冲突;请重新读取已保存工程,不要换用新修订号直接重试。已保存的 clip ID、算法版本、参数和实际动画在磁盘重开及支持的撤销/重做中保持;回执记录过去执行的操作,不代表结果仍是相机最新状态。
+
+运镜轨道和时间检查器显示**在分镜中全部可见**、**在分镜中部分可见**或**在分镜中从未可见**。可见范围按运镜区间与当前切镜选择计算,包含同一相机的重复选用,不计入 Storyboard 输出结束后的时间。即使当前选用其他相机,运镜仍按舞台绝对时间运行;切回相机时显示已经推进的运镜。固定相机输出独立采样所选相机。
+
+相机重命名更新轨道标签,不改变运镜身份。删除相机在同一操作中删除其运镜及关联分镜块,撤销恢复原身份。缩短舞台时间线会拒绝越界运镜,并列出全部相机/运镜标识;原有分镜最小时长约束仍然适用。请先明确调整或删除受影响的运镜,或在一个原子批处理中先调整运镜再缩短时长。不会自动裁剪路径或删除运镜。整文档保存与 Agent 命令执行相同规则。
+
+## 交付运镜视频
+
+选择 **合成预演 MP4**,指定单个机位或 **分镜编排**,设置画质与帧率后 **导出**。固定机位在整个舞台时长内使用该相机;分镜按已有切点选择相机,并在最后一个分镜块结束。两者都按舞台绝对时间采样运镜。下载 MP4 检查真实视频,或选择 **将预演视频加入画布** 将其注册为工程资产。
+
+导出接受时固定舞台版本、运镜配方、已注册媒体引用与输出计划。之后编辑运镜,不会改变已接受视频的画面或执行证据。发布会创建独立渲染资产与执行快照,不会替换当前编辑中的舞台。当前画布绑定、锁定、素材可用性和既有发布规则仍然有效;发布目标变化时,应先检查已保存工程再重试。
+
+渲染结束前请保持浏览器与导演台打开。现有渲染器使用浏览器的 GPU 与视频编码器;关闭浏览器后不会在后台继续。生成文件和通过技术检查不代表创意验收,请在交付前检查解码后的视频。
+
+引导预览先显示控件反馈,再刷新两幅图像,使用最新请求的时间,并在播放过程中持续更新。刷新期间,图像标题保留该图像实际捕获的时间。只有应用操作才保存运镜,临时预览不会自行保存。
diff --git a/docs/guides/user-guide.md b/docs/guides/user-guide.md
index b93404a6e..958d10c6a 100644
--- a/docs/guides/user-guide.md
+++ b/docs/guides/user-guide.md
@@ -260,6 +260,39 @@ Editable JSON describes the timeline within the same project and does not embed
Keep the page and editor open while rendering. Closing the editor or canceling stops the current render. MP4 rendering requires the browser; the assistant cannot render a final video after the browser is closed.
+### Direct the stage: the Director View, cameras and presets
+
+The main viewport of the Director Stage is your own view of the stage as the director. Dragging the view changes only the angle you look from: it changes no camera and adds nothing to undo. **Reset view** returns to where the stage opened.
+
+Every camera is a rig in the scene with two ends: its body and its viewpoint. Click either end to select it, in the viewport or in the object tree, and drag it with the move tool. Dragging the viewpoint changes where that camera looks. A selected camera can be moved, but not rotated or scaled.
+
+To add a camera, click a preset on the **Cameras** tab, then click a character or an object in the viewport. The new camera is placed beside it with the preset's framing, is selected, and the preview shows it. Press `Esc` to cancel. Clicking empty space places nothing. The presets are unavailable until the stage has a character or an object.
+
+To see what a camera sees, use the drop-down on the camera-preview frame: it chooses the Storyboard or one camera. Drag the frame by its handle and collapse it with its switch. The viewfinder shows the same choice full size, and the right pane of a split view has tabs of its own. Selecting a camera in the object tree does not change what the camera preview shows.
+
+The camera-preview frame takes the shape of the camera's own aspect ratio, and the stage's when it shows the Storyboard.
+
+
+### Animate frame roll
+
+In **Cameras**, choose the destination camera and **Roll**. Review composition, enter an angle from −180° to 180°, then set timing and preview before applying. Positive roll matches the static camera tilt: with a horizontal view, 30° dynamic roll plus 15° static roll produces 45° inclination. Roll captures the starting up vector once, rotates it around the current view axis, and applies static tilt afterward. Timing edits preserve that capture; resampling explicitly replaces it.
+
+Only the up channel belongs to roll. Position, target and lens remain editable and animated independently; an old recipe composition never replaces those later edits unless you explicitly edit its starting composition. The resulting orientation also holds after the interval. Zero or collinear viewing/up vectors reject; conservative full-path checks may also reject an unproven path, in which case simplify independent position/target animation. Preview, camera helpers, thumbnails, playback and browser MP4 rendering use the same orientation. Applied moves can be reopened, changed and undone. The assistant uses the same preset catalog and `director.cameraMove.put` command, with a signed `angle` and captured `baselineUp`.
+
+### Arrange a Director Stage Storyboard
+
+The Storyboard is the **Shots** row of the Director Stage timeline: blocks that each show one camera, laid end to end from zero. Choose **+** on that row to add a camera as a new block at the end. The new block is selected and the playhead moves to where it starts.
+
+Hold a block and drag it sideways to change the order. The pointer is an open hand over a block and closes when you press. Only the block you hold moves with the pointer, and it stops at the row's edges; the other blocks, the playhead and the preview stay as they are. Where letting go would change the order, a thick white line across the row stands where the block would be inserted: before the block that would then follow it, or at the end of the last block when it would come last. A block carried as far as it will go, to either edge of the row, is inserted last or first. Dragging the edge between two blocks moves the cut and shifts the blocks after it to stay end to end; dragging the end of the last block changes where the Storyboard ends.
+
+Let go and the blocks are arranged in the new order at once. Every block keeps its camera and its length, and the playhead moves to where the block you dragged now starts. The new order is saved as one step, so one undo takes it back. Let go where the order would not change, or press `Esc` while dragging, and the block returns to its place with nothing changed.
+
+### Export a Director Stage Storyboard
+
+In the Director Stage, choose **Render preview MP4** and select **Storyboard**. The video starts at zero, cuts directly between cameras, and ends with the last block. The first output frame at or after a cut uses the next block's camera. Changing the output frame rate leaves the saved cut times intact. Camera and subject animation continue on the same timeline even if a camera appears in several blocks.
+
+If a shorter **Stage duration** would cut through the Storyboard, the stage ends at the last block. The editor shows the requested and applied durations. Storyboard blocks and keyframes keep their saved times.
+
## Save, back up, and download
- Use a node's download control to save its asset.
diff --git a/docs/guides/user-guide.zh-CN.md b/docs/guides/user-guide.zh-CN.md
index 28b78c1ce..4dbd917d4 100644
--- a/docs/guides/user-guide.zh-CN.md
+++ b/docs/guides/user-guide.zh-CN.md
@@ -260,6 +260,39 @@ AI 助手可通过共用编辑命令修改同一份已保存时间线。交接
合成期间保持页面和编辑器打开。关闭编辑器或取消会停止本次合成。MP4 合成需要浏览器参与;关闭浏览器后,助手不能独立合成最终视频。
+### 导演台:导演视角、机位与预设
+
+导演台的主视口是导演自己看舞台的角度。拖动视角只改变你自己看舞台的角度:不会改动任何机位,也不会产生撤销记录。**重置视角**回到打开舞台时的位置。
+
+每台机位在场景里是一组辅助体,有两端:机身和视点。在主视口或场景树里点哪端就选中哪端,然后用移动工具拖动。拖动视点改变的是这台机位看向哪里。选中的机位只能移动,不能旋转或缩放。
+
+新增机位时,在**机位**页签点一个预设,再点画面里的一个角色或物体。新机位按预设的取景放在它旁边并被选中,预览切换到新机位。按 `Esc` 取消。点空处不会放置任何东西。舞台上没有角色或物体时,预设不可用。
+
+要看机位的画面,用机位预览框上的下拉:它选择显示分镜还是哪台机位。把手用来拖动预览框,开关用来折叠。取景器全幅显示同一选择,分屏的右窗格有自己的页签。在场景树里选中一台机位,不会改变机位预览显示的内容。
+
+机位预览框按机位自己的画幅比取形;显示分镜时用舞台的画幅比。
+
+
+### 动态画面滚转
+
+在**机位**中选择目标相机与**滚转**,检查构图,输入 −180° 至 180° 转角,再设置时间并预览后应用。正方向与机位静态倾斜一致:水平视线下,动态 30° 加静态 15° 得到 45° 倾角。滚转一次捕获起始上方向,绕当前视轴旋转,随后叠加静态倾斜。修改时间保留该捕获值;重新采样会明确替换它。
+
+滚转仅控制上方向通道;位置、目标与镜头仍可独立编辑或设置动画。除非明确修改起始构图,旧运镜构图不会覆盖这些后续编辑。运镜终点之后继续保持该滚转方向。零向量或共线的视线与上方向会被拒绝;全路径保守检查也会拒绝无法证明安全的路径,此时可简化独立的位置或目标动画。预览、相机辅助体、缩略图、播放与浏览器 MP4 合成使用相同方向。应用后可重开修改并撤销。助手使用相同预设目录与 `director.cameraMove.put` 命令,传入带正负号的 `angle` 和捕获的 `baselineUp`。
+
+### 调整导演台分镜的顺序
+
+分镜是导演台时间轴的 **分镜** 一行:每个分镜块显示一个机位的画面,首尾相接,从 0 秒排起。点击这一行的 **+**,在末尾添加一个机位块。新块处于选中状态,播放头跳到它的起点。
+
+按住一个分镜块左右拖动可以调整顺序。指针悬停在块上时是张开的小手,按下后握紧。拖动时只有按住的块跟随指针移动,到这一行的两端为止;其他块、播放头和预览都保持不动。如果松手会改变顺序,这一行会出现一条贯穿的白色粗线,标出该块将插入的位置:在排在它后面的那一块之前,排在最后时则在最后一块的末端。把块拖到这一行的尽头,它会排到最后或最前。拖动两个块之间的边界会移动切点,后面的块随之平移以保持首尾相接;拖动最后一个块的末端则改变分镜的结束位置。
+
+松手后,各块立即按新顺序排好。每个块保留自己的机位和时长,播放头跳到被拖块的新起点。新顺序作为一步保存,撤销一次即可还原。在不会改变顺序的位置松手,或拖动时按 `Esc`,块回到原位,什么都不会改变。
+
+### 导出导演台分镜
+
+在导演台选择 **合成预演 MP4**,将来源设为 **分镜编排**。视频从零秒开始,在机位间直接硬切,到最后一个分镜块结束。切点当时或之后的第一帧使用右侧分镜块的机位。修改输出帧率不会改变已保存的切点。同一机位反复出现时,机位和场景对象的动画仍按主时间轴采样。
+
+如果缩短 **舞台总时长** 会截断分镜,舞台会停在最后一个分镜块的结束位置。编辑器同时显示请求时长和实际应用时长。分镜块和关键帧保留已保存的时间。
+
## 保存、备份和下载
- 节点中的下载入口用于保存对应素材。
diff --git a/packages/core/src/opendirector/agent/tools.py b/packages/core/src/opendirector/agent/tools.py
index 43cfb1456..c6007c49e 100644
--- a/packages/core/src/opendirector/agent/tools.py
+++ b/packages/core/src/opendirector/agent/tools.py
@@ -35,8 +35,10 @@
from opendirector.installation import SOURCE_ROOT, BUNDLED
ROOT = SOURCE_ROOT or BUNDLED
+# File registration goes through artifact.publish with the turn's execution
+# directory; the HTTP upload staging behind asset.import has no tool path.
EXCLUDED = {'project.create', 'project.trash', 'project.restore', 'asset.import', 'job.checkpoint',
- 'canvas.applyEdit', 'canvas.publishMedia', 'timeline.publishRender'}
+ 'canvas.applyEdit'}
QUERY_MODELS = get_args(get_args(Query)[0])
#: The legal `type` values, read from the union itself. A new query type cannot
@@ -283,7 +285,27 @@ def invalid_path(level: str, node: dict, requested: str) -> ProjectError:
if command == 'generation.submit':
example['payload']['originItemId'] = str(project_id)
model = COMMANDS[command]
- parsed_payload = model.model_fields['payload'].annotation.model_validate(example['payload'])
+ payload_model = model.model_fields['payload'].annotation
+ # Some commands accept only some editor document kinds; walk the
+ # document union branches until one validates instead of assuming
+ # the timeline default from minimal_value.
+ candidates = [example['payload']]
+ document_node = payload.get('properties', {}).get('document')
+ if document_node is not None:
+ for key, choice in branches(resolve(document_node)).items():
+ if key != 'timeline':
+ candidates.append(
+ {**example['payload'], 'document': minimal_value(resolve(choice))})
+ parsed_payload = None
+ for candidate in candidates:
+ try:
+ parsed_payload = payload_model.model_validate(candidate)
+ example['payload'] = candidate
+ break
+ except ValidationError:
+ continue
+ if parsed_payload is None:
+ parsed_payload = payload_model.model_validate(candidates[0])
sample = model.model_construct(type=command, payload=parsed_payload, projectId=project_id)
versions = sample.required_versions()
if versions:
diff --git a/packages/core/src/opendirector/application/creation_canvas.py b/packages/core/src/opendirector/application/creation_canvas.py
index d8c83cc9d..d87d86952 100644
--- a/packages/core/src/opendirector/application/creation_canvas.py
+++ b/packages/core/src/opendirector/application/creation_canvas.py
@@ -13,12 +13,15 @@
from opendirector.domain.creation.assets import AssetRef
from opendirector.domain.creation.base import CanvasItemVersion, ObjectVersion, Point
-from opendirector.domain.creation.commands import CanvasShow, Query, ReferenceWrite, SpecWrite
+from opendirector.domain.creation.commands import CanvasShow, DirectorStoryboardResult, Query, ReferenceWrite, SpecWrite
from opendirector.domain.creation.generation import FollowingSource, ResolvedReference
from opendirector.domain.creation.canvas import CanvasReferenceSources, canvas_origin, FollowingReferenceSource, PinnedReferenceSource, media_card_size, node_capabilities, VideoCanvasItem
from opendirector.domain.creation.models import ModelConfigPublic
from opendirector.domain.creation.project import ProjectSnapshot, asset_references
from opendirector.domain.creation.index import object_index
+from opendirector.domain.creation.storyboard import (
+ STORYBOARD_DEFAULT_SECONDS, appended_block, delete_storyboard_blocks, normalize_storyboard_time, pack_storyboard,
+ storyboard_blocks, storyboard_end, storyboard_issue, storyboard_rejection, storyboard_state)
from opendirector.domain.creation.validation import ContractError
from opendirector.domain.input_rules import input_rules
from opendirector.domain.rule_facts import FRAME_IMAGE_LIMIT
@@ -310,14 +313,59 @@ def _available(self, asset):
return self.assets.reference_available(asset.projectId, asset.id)
def execute(self, command, *, session=None, source='ui'):
- return self.projects.commit(command, lambda before: self.apply(before, command), session=session, source=source)
+ durations, storyboard = [], []
+ return self.projects.commit(
+ command, lambda before: self.apply(before, command, durations=durations, storyboard=storyboard),
+ session=session, source=source, director_durations=durations, director_storyboard=storyboard,
+ )
- def apply(self, before, command):
+ def apply(self, before, command, *, durations=None, storyboard=None):
data = before.model_dump(mode='json')
operations = command.payload.operations if command.type == 'creation.batch' else [command]
- for operation in operations:
- if operation.type != 'canvas.applyEdit':
- self._mutate(data, operation.type, operation.payload)
+ storyboard_evidence = []
+ approved = {}
+ for index, operation in enumerate(operations):
+ kind, payload = operation.type, operation.payload
+ if kind == 'canvas.applyEdit':
+ continue
+ observes_storyboard = storyboard is not None and (
+ kind.startswith('director.storyboard.') or kind in {'director.duration.set', 'director.camera.delete'})
+ if observes_storyboard:
+ document = self._get(data, 'editor_document', payload.documentId)
+ old_shots = storyboard_blocks(document['data']['shots']) if document['kind'] == 'director' else ()
+ if kind == 'director.duration.set':
+ duration = self._set_director_duration(data, payload)
+ if durations is not None:
+ durations.append(duration)
+ else:
+ self._mutate(data, kind, payload)
+ if kind=='director.cameraMove.put' and payload.replacementReview is not None:
+ from copy import deepcopy
+ from opendirector.domain.creation.camera_moves import controlled_channels
+ document=self._get(data,'editor_document',payload.documentId)
+ camera=next(c for c in document['data']['cameras'] if c['id']==payload.cameraId)
+ recipe=next(c for c in camera['moveClips'] if c['id']==payload.clip.id)
+ approved[(str(payload.documentId),payload.cameraId,payload.clip.id)]=dict(clip=deepcopy(recipe),channels={channel:deepcopy(camera['channels'][channel]) for channel in controlled_channels(recipe)})
+ if observes_storyboard:
+ blocks = storyboard_blocks(document['data']['shots'])
+ old_by_id = {block.id: block for block in old_shots}
+ new_ids = {block.id for block in blocks}
+ limit = kind == 'director.storyboard.append' and blocks[-1].duration < STORYBOARD_DEFAULT_SECONDS
+ storyboard_evidence.append(dict(
+ operationIndex=index, operation=kind, documentId=payload.documentId, blocks=blocks,
+ affectedBlockIds=tuple(block.id for block in blocks if old_by_id.get(block.id) != block),
+ removedBlockIds=tuple(block.id for block in old_shots if block.id not in new_ids),
+ blockId=getattr(payload, 'blockId', None), cameraId=getattr(payload, 'cameraId', None),
+ appendLimitReason='storyboard_tail' if limit else None,
+ ))
+ # Compare the transaction's original curves too: splitting erasure and
+ # recipe introduction into batch operations must not evade review.
+ from opendirector.domain.creation.camera_moves import validate_replacement_transition
+ previous_documents = {str(d.id): d.model_dump(mode='json') for d in before.editorDocuments}
+ for document in data['editorDocuments']:
+ prior = previous_documents.get(str(document['id']))
+ if prior and document['kind']=='director':
+ validate_replacement_transition(prior,document,approved)
# Publish against the final document in this atomic batch.
published = set()
for operation in operations:
@@ -371,8 +419,32 @@ def apply(self, before, command):
if actual.kind in {'video', 'audio'} and actual.metadata.durationSeconds is None:
raise ContractError('invalid_input', '请先读取视频或音频的实际时长,再添加到目标节点。', value.sourceId)
self._available(actual)
+ if storyboard_evidence:
+ versions = {doc.id: doc.revision for doc in result.editorDocuments}
+ storyboard.extend(DirectorStoryboardResult(version=versions[evidence['documentId']], **evidence)
+ for evidence in storyboard_evidence)
return result
+ def _set_director_duration(self, data, payload):
+ document = self._get(data, 'editor_document', payload.documentId)
+ if document['kind'] != 'director':
+ raise ContractError('role_restricted', '请选择导演预演文档。 Select a Director Stage document.', payload.documentId)
+ self._editable_document(data, payload.documentId)
+ stage = document['data']
+ issue = storyboard_issue(stage['shots'], stage['duration'], [camera['id'] for camera in stage['cameras']],
+ object_id=payload.documentId)
+ if issue is not None:
+ raise issue
+ # Preserve both the effective cut endpoint and the original interval's
+ # stored bounds when clamping a legacy document.
+ raw_end = max((shot['start'] + shot['duration'] for shot in stage['shots']), default=0)
+ applied = max(payload.duration, storyboard_end(stage['shots']), raw_end)
+ from opendirector.domain.creation.camera_moves import validate_camera_moves
+ validate_camera_moves({**stage, 'duration': applied}, document['id'])
+ stage['duration'] = applied
+ return dict(documentId=payload.documentId, requestedDuration=payload.duration, appliedDuration=applied,
+ clampReason='storyboard_end' if applied > payload.duration else None)
+
def _apply_edit(self, data, payload, before, command):
item = self._editable(data, payload.itemId)
if item['kind'] != 'image' or item['binding']['role'] not in {'material', 'generation'}:
@@ -434,6 +506,24 @@ def _get(data, kind, object_id):
raise ContractError('missing_object', '业务对象不存在。', object_id)
return obj
+ @staticmethod
+ def _validate_director_locks(old, new):
+ """Reject edits to locked stage objects before the document is mutated."""
+ if old.get('kind') != 'director' or new.get('kind') != 'director':
+ raise ContractError('role_restricted', 'director.apply 只能保存 Director Stage 文档。 director.apply only accepts Director Stage documents.', UUID(str(old['id'])))
+ previous = {str(item['id']): item for item in old['data'].get('objects', [])}
+ following = {str(item['id']): item for item in new['data'].get('objects', [])}
+ for object_id, item in previous.items():
+ if not item.get('locked'):
+ continue
+ next_item = following.get(object_id)
+ if next_item is None:
+ raise ContractError('role_restricted', 'Locked stage objects cannot be removed. 已锁定的舞台对象不能删除。')
+ unlocked_only = dict(next_item)
+ unlocked_only['locked'] = True
+ if unlocked_only != item:
+ raise ContractError('role_restricted', 'Locked stage objects cannot be modified; unlock in a separate command first. 已锁定的舞台对象不能修改,请先单独解锁。')
+
@classmethod
def _editable(cls, data, item_id, *, unlocking=False):
item = cls._get(data, 'canvas_item', item_id)
@@ -448,6 +538,37 @@ def _editable(cls, data, item_id, *, unlocking=False):
current = cls._get(data, 'canvas_item', current['parentId']) if current['parentId'] else None
return item
+ @classmethod
+ def _editable_document(cls, data, document_id):
+ """Every canvas item bound to a document, or carrying it as an attached editor, must be editable."""
+ for item in data['canvasItems']:
+ binding = item['binding']
+ ref = binding.get('objectRef') or binding.get('draftSpec')
+ attached = any(str(editor['id']) == str(document_id) for editor in item.get('editors', []))
+ if (ref and str(ref.get('id')) == str(document_id)) or attached:
+ cls._editable(data, item['id'])
+
+ @staticmethod
+ def _write_director(document):
+ """The Director Stage write boundary.
+
+ Block times are normalized to milliseconds once, here, as the document enters
+ project state; the continuity rule then judges exactly what will be stored. Reads
+ and unrelated commands never pass through, so older stored values stay as they are.
+ """
+ stage = document['data']
+ from opendirector.domain.creation.camera_moves import normalize_camera_moves, validate_camera_moves
+ normalize_camera_moves(stage)
+ validate_camera_moves(stage, document['id'])
+ stage['shots'] = [
+ {**shot, 'start': normalize_storyboard_time(shot['start']),
+ 'duration': normalize_storyboard_time(shot['duration'])}
+ for shot in stage['shots']]
+ issue = storyboard_issue(stage['shots'], stage['duration'], [camera['id'] for camera in stage['cameras']],
+ object_id=UUID(str(document['id'])))
+ if issue is not None:
+ raise issue
+
@staticmethod
def _placement_lookup(items, moves=None):
def lookup(parent_id):
@@ -476,19 +597,21 @@ def _publish_render(self, data, payload):
from opendirector.domain.creation.editors import timeline_duration
item = self._editable(data, payload.itemId)
if item['kind'] != 'timeline' or item['binding']['objectRef']['id'] != str(payload.editorId):
- raise ContractError('reference_invalid', '合成来源不是当前时间线。', payload.itemId)
+ raise ContractError('reference_invalid', 'The composite source is not the current timeline. 合成来源不是当前时间线。', payload.itemId)
snapshot = ProjectSnapshot.model_validate(data)
doc = next(d for d in snapshot.editorDocuments if d.id == payload.editorId)
self._validate_timeline(doc, snapshot)
output = self.assets._reference(snapshot, payload.asset)
- if output.kind != 'video' or output.provenance.source != 'upload' or any(r.assetId == output.id for r in asset_references(snapshot)):
- raise ContractError('role_restricted', '合成输出必须是尚未发布的视频素材。', output.id)
+ # Browser sessions upload renders; agents register them through
+ # artifact.publish. Either way the render must be fresh and unused.
+ if output.kind != 'video' or output.provenance.source not in {'upload', 'agent_written'} or any(r.assetId == output.id for r in asset_references(snapshot)):
+ raise ContractError('role_restricted', 'The composite output must be a video asset that has not been published yet. 合成输出必须是尚未发布的视频素材。', output.id)
if any(r.assetId == output.id for record in self.projects.history(snapshot.project.id) for r in asset_references(record.snapshot)):
- raise ContractError('role_restricted', '合成输出已有历史用途,不能改写来源。', output.id)
+ raise ContractError('role_restricted', 'The composite output already has historical uses, so its provenance cannot be rewritten. 合成输出已有历史用途,不能改写来源。', output.id)
duration = timeline_duration(doc.data)
meta = output.metadata
if (meta.width, meta.height) != (doc.data.width, doc.data.height) or meta.durationSeconds is None or abs(meta.durationSeconds - duration) > max(.15, 2 / doc.data.fps):
- raise ContractError('invalid_input', '合成视频的实际尺寸或时长与时间线不一致。', output.id)
+ raise ContractError('invalid_input', "The composite video's actual size or duration does not match the timeline. 合成视频的实际尺寸或时长与时间线不一致。", output.id)
sources = timeline_source_refs(doc.data)
for ref in (*sources, payload.asset):
self._available(self.assets._reference(snapshot, ref))
@@ -496,25 +619,28 @@ def _publish_render(self, data, payload):
existing = next((i for i in snapshot.canvasItems if i.id == payload.outputId), None)
if existing is not None:
if payload.expectedOutputRevision is None:
- raise ContractError('revision_conflict', '输出节点已存在,请提供其当前版本。', payload.outputId)
+ raise ContractError('revision_conflict', 'The output item already exists; provide its current revision. 输出节点已存在,请提供其当前版本。', payload.outputId)
target = self._editable(data, payload.outputId)
previous = current_asset(snapshot, existing)
if (existing.kind != 'video' or existing.binding.role != 'material' or previous is None
or previous.provenance.source != 'rendered' or previous.provenance.editorDocumentId != doc.id
or previous.provenance.sourceItemId not in {None, payload.itemId}):
- raise ContractError('role_restricted', '输出节点不属于当前时间线。', payload.outputId)
+ raise ContractError('role_restricted', 'The output item does not belong to the current timeline. 输出节点不属于当前时间线。', payload.outputId)
target['binding'] = dict(role='material', objectRef=payload.asset.model_dump(mode='json'))
else:
result = VideoCanvasItem(id=payload.outputId, projectId=snapshot.project.id, kind='video', title=payload.title,
position=payload.position, binding=dict(role='material', objectRef=payload.asset))
data['canvasItems'].append(result.model_dump(mode='json'))
+ # The asset changes origin, not history: what the agent run recorded stays with it.
+ origin = asset['provenance']
asset['provenance'] = dict(source='rendered', sourceItemId=str(payload.itemId),
editorDocumentId=str(doc.id), editorRevision=doc.revision,
- sources=[ref.model_dump(mode='json') for ref in sources])
+ sources=[ref.model_dump(mode='json') for ref in sources],
+ **{key: origin[key] for key in ('agentRunId', 'agentRuntime', 'modelSnapshot') if origin.get(key) is not None})
def _mutate(self, data, kind, payload):
value = payload.model_dump(mode='json', exclude_unset=True)
- if kind in {'editor.create', 'editor.save'} and payload.document.kind == 'timeline':
+ if kind in {'editor.create', 'editor.save', 'director.apply'} and payload.document.kind == 'timeline':
self._validate_timeline(payload.document, ProjectSnapshot.model_validate(data))
if kind == 'canvas.publishMedia':
from .creation_media_publication import publish_media
@@ -535,21 +661,141 @@ def _mutate(self, data, kind, payload):
raise ContractError('invalid_input', '对象标识已存在。', UUID(obj['id']))
if key == 'spec' and obj['currentResultId'] is not None:
raise ContractError('invalid_input', '新配置不能指定生成结果。')
+ if obj['kind'] == 'director':
+ self._write_director(obj)
data[collection].append(obj)
- elif kind in {'generationSpec.update', 'editor.save'}:
+ elif kind in {'generationSpec.update', 'editor.save', 'director.apply'}:
key, object_type = ('spec', 'generation_spec') if kind.startswith('generation') else ('document', 'editor_document')
obj = getattr(payload, key).model_dump(mode='json')
old = self._get(data, object_type, obj['id'])
+ if kind in {'editor.save', 'director.apply'} and payload.document.kind == 'director':
+ self._validate_director_locks(old, obj)
immutable = ('kind', 'purpose', 'currentResultId') if key == 'spec' else ('kind',)
if any(obj[field] != old[field] for field in (*immutable, 'projectId')):
raise ContractError('role_restricted', '配置编辑不能修改对象角色或结果选择。', UUID(obj['id']))
- for item in data['canvasItems']:
- binding = item['binding']
- ref = binding.get('objectRef') or binding.get('draftSpec')
- attached = any(str(editor['id']) == str(obj['id']) for editor in item.get('editors', []))
- if (ref and str(ref.get('id')) == str(obj['id'])) or attached:
- self._editable(data, item['id'])
+ self._editable_document(data, obj['id'])
+ if obj['kind'] == 'director':
+ self._write_director(obj)
old.update(obj)
+ elif kind in {'director.cameraMove.put', 'director.cameraMove.retime', 'director.cameraMove.delete', 'director.cameraMove.convert'}:
+ document = self._get(data, 'editor_document', payload.documentId)
+ if document['kind'] != 'director':
+ raise ContractError('role_restricted', '请选择导演台文档。', payload.documentId)
+ self._editable_document(data, payload.documentId)
+ camera = next((camera for camera in document['data']['cameras'] if camera['id'] == payload.cameraId), None)
+ if camera is None:
+ raise storyboard_rejection('director_camera_unknown', payload.documentId)
+ clips = camera.get('moveClips', [])
+ if kind == 'director.cameraMove.put':
+ clip = payload.clip.model_dump(mode='json')
+ from opendirector.domain.creation.camera_moves import replacement_basis, replace_animation, primitive_issue
+ from opendirector.domain.camera_move_errors import CAMERA_MOVE_MESSAGES
+ impact, basis = replacement_basis(camera, clip, document['data']['duration'], payload.applyStartingComposition)
+ if payload.replacementReview is not None:
+ if payload.replacementReview.version != document['revision'] or payload.replacementReview.basis != basis:
+ raise ContractError('camera_move_review_stale', CAMERA_MOVE_MESSAGES['camera_move_review_stale'][0], payload.documentId)
+ invalid=primitive_issue(clip)
+ if invalid:
+ raise ContractError(invalid, CAMERA_MOVE_MESSAGES[invalid][0], payload.documentId)
+ replace_animation(camera, clip, impact)
+ if payload.applyStartingComposition:
+ from opendirector.domain.creation.camera_moves import apply_starting_composition
+ from opendirector.domain.camera_move_errors import CAMERA_MOVE_MESSAGES
+ issue = apply_starting_composition(camera, clip)
+ if issue:
+ raise ContractError(issue[0], CAMERA_MOVE_MESSAGES[issue[0]][0], payload.documentId)
+ camera['moveClips'] = [clip if item['id'] == clip['id'] else item for item in clips]
+ if not any(item['id'] == clip['id'] for item in clips):
+ camera['moveClips'].append(clip)
+ elif kind == 'director.cameraMove.convert':
+ from opendirector.domain.creation.camera_moves import convert_camera_move
+ convert_camera_move(camera, payload.clipId, document['data']['duration'])
+ elif kind == 'director.cameraMove.retime':
+ from opendirector.domain.creation.camera_moves import retime_camera_move
+ if not any(item['id'] == payload.clipId for item in clips):
+ raise ContractError('missing_object', '运镜不存在。', payload.documentId)
+ camera['moveClips'] = [retime_camera_move(item, payload.edge, payload.time,
+ document['data']['fps'], payload.snapToFrame) if item['id'] == payload.clipId else item for item in clips]
+ else:
+ if not any(item['id'] == payload.clipId for item in clips):
+ raise ContractError('missing_object', '运镜不存在。', payload.documentId)
+ camera['moveClips'] = [item for item in clips if item['id'] != payload.clipId]
+ if not camera['moveClips']:
+ camera.pop('moveClips', None)
+ self._write_director(document)
+ elif kind in {'director.storyboard.append', 'director.storyboard.reorder', 'director.storyboard.resize', 'director.storyboard.delete', 'director.camera.delete'}:
+ document = self._get(data, 'editor_document', payload.documentId)
+ if document['kind'] != 'director':
+ raise ContractError('role_restricted', '只能编辑 Director Stage 文档的分镜。', payload.documentId)
+ self._editable_document(data, payload.documentId)
+ stage = document['data']
+ camera_ids = [camera['id'] for camera in stage['cameras']]
+ if kind != 'director.storyboard.append':
+ stored = storyboard_issue(stage['shots'], stage['duration'], camera_ids, object_id=payload.documentId)
+ if stored is not None:
+ raise stored
+ shots_by_id = {shot['id']: shot for shot in stage['shots']}
+ if kind == 'director.storyboard.reorder':
+ if len(payload.blockIds) != len(shots_by_id) or set(payload.blockIds) != shots_by_id.keys():
+ raise storyboard_rejection('storyboard_order_invalid', payload.documentId)
+ shots = [shots_by_id[identity] for identity in payload.blockIds]
+ elif kind == 'director.storyboard.delete':
+ if payload.blockId not in shots_by_id:
+ raise storyboard_rejection('storyboard_block_unknown', payload.documentId)
+ shots = delete_storyboard_blocks(stage['shots'], {payload.blockId})
+ elif kind == 'director.camera.delete':
+ if payload.cameraId not in camera_ids:
+ raise storyboard_rejection('director_camera_unknown', payload.documentId)
+ if len(camera_ids) == 1:
+ raise storyboard_rejection('director_camera_required', payload.documentId)
+ removed = {shot['id'] for shot in stage['shots'] if shot['cameraId'] == payload.cameraId}
+ shots = delete_storyboard_blocks(stage['shots'], removed)
+ camera_ids.remove(payload.cameraId)
+ else:
+ if payload.blockId not in shots_by_id:
+ raise storyboard_rejection('storyboard_block_unknown', payload.documentId)
+ # Reject grossly oversized input before multiplying in normalization.
+ if payload.duration > stage['duration'] + 0.001:
+ raise storyboard_rejection('storyboard_exceeds_duration', payload.documentId)
+ if payload.duration < 0.0005:
+ raise storyboard_rejection('storyboard_duration_invalid', payload.documentId)
+ shots_by_id[payload.blockId] = {
+ **shots_by_id[payload.blockId], 'duration': normalize_storyboard_time(payload.duration)}
+ shots = shots_by_id.values()
+ packed = pack_storyboard(shots)
+ issue = storyboard_issue(packed, stage['duration'], camera_ids, object_id=payload.documentId)
+ if issue is not None:
+ raise issue
+ stage['shots'] = packed
+ if kind == 'director.camera.delete':
+ stage['cameras'] = [camera for camera in stage['cameras'] if camera['id'] != payload.cameraId]
+ if stage['activeCameraId'] not in camera_ids:
+ stage['activeCameraId'] = camera_ids[0]
+ if not packed and stage['cameraSource'] == 'storyboard':
+ stage['cameraSource'] = 'camera'
+ stage['activeCameraId'] = camera_ids[0]
+ return
+ if payload.cameraId not in camera_ids:
+ raise storyboard_rejection('storyboard_camera_unknown', payload.documentId)
+ # The payload contract already requires a non-blank identity; the service keeps
+ # the rule itself so an internal caller cannot append an unnamed block.
+ if not payload.blockId.strip():
+ raise storyboard_rejection('storyboard_block_invalid', payload.documentId)
+ if any(shot['id'] == payload.blockId for shot in stage['shots']):
+ raise storyboard_rejection('storyboard_block_exists', payload.documentId)
+ # A stored track that is not continuous is reported as it is, never repaired by appending to it.
+ stored = storyboard_issue(stage['shots'], stage['duration'], camera_ids, object_id=payload.documentId)
+ if stored is not None:
+ raise stored
+ placement = appended_block(stage['shots'], stage['duration'])
+ if placement is None:
+ raise storyboard_rejection('storyboard_exhausted', payload.documentId)
+ shots = [*stage['shots'],
+ dict(id=payload.blockId, cameraId=payload.cameraId, start=placement[0], duration=placement[1])]
+ issue = storyboard_issue(shots, stage['duration'], camera_ids, object_id=payload.documentId)
+ if issue is not None:
+ raise issue
+ stage['shots'] = shots
elif kind in {'canvas.layoutRuns', 'canvas.layoutPipelines'}:
pass # The commit arranges the authoritative canvas after validating edits.
elif kind == 'canvas.show':
@@ -1036,6 +1282,61 @@ def query_snapshot(self, query):
if query.type == 'asset.usage':
assets = [a for a in snapshot.assets if query.objectId is None or a.id == query.objectId]
return [history.usage(snapshot, a.id) for a in assets[query.offset:query.offset+query.limit]]
+ if query.type == 'director.cameraMove.presets':
+ from opendirector.domain.creation.camera_moves import CAMERA_MOVE_PRESETS
+ return CAMERA_MOVE_PRESETS
+ if query.type == 'director.cameraMove.preview':
+ from opendirector.domain.creation.camera_moves import camera_move_issue, normalize_camera_moves, controlled_channels, dolly_pose, seam_details
+ document = next((doc for doc in snapshot.editorDocuments if doc.id == query.objectId), None)
+ if document is None or document.kind != 'director':
+ raise ContractError('missing_object', '导演台文档不存在。', query.objectId)
+ stage = document.data.model_dump(mode='json')
+ camera = next((camera for camera in stage['cameras'] if camera['id'] == query.cameraId), None)
+ if camera is None:
+ raise storyboard_rejection('director_camera_unknown', query.objectId)
+ from copy import deepcopy
+ from opendirector.domain.creation.camera_moves import apply_starting_composition
+ previous_camera = deepcopy(camera)
+ previous_pose = deepcopy(camera['pose'])
+ from opendirector.domain.creation.camera_moves import replacement_basis, replace_animation
+ proposed = query.clip.model_dump(mode='json')
+ impact, basis = replacement_basis(camera, proposed, stage['duration'], query.applyStartingComposition)
+ replacement_stage = deepcopy(stage)
+ replacement_camera = next(c for c in replacement_stage['cameras'] if c['id']==query.cameraId)
+ from opendirector.domain.creation.camera_moves import primitive_issue
+ replacement_primitive_issue=primitive_issue(proposed)
+ if replacement_primitive_issue is None:
+ replace_animation(replacement_camera, proposed, impact)
+ replacement_composition_issue = apply_starting_composition(replacement_camera, proposed) if query.applyStartingComposition else None
+ replacement_camera['moveClips'] = [c for c in replacement_camera.get('moveClips',[]) if c['id']!=proposed['id']] + [proposed]
+ replacement_issue = (replacement_primitive_issue,proposed["id"]) if replacement_primitive_issue else replacement_composition_issue or camera_move_issue(normalize_camera_moves(replacement_stage))
+ composition_issue = apply_starting_composition(camera, query.clip.model_dump(mode='json')) if query.applyStartingComposition else None
+ composition_changed = previous_camera != camera
+ camera['moveClips'] = [clip for clip in camera.get('moveClips', []) if clip['id'] != query.clip.id]
+ camera['moveClips'].append(query.clip.model_dump(mode='json'))
+ issue = composition_issue or camera_move_issue(normalize_camera_moves(stage))
+ return dict(seams=seam_details(camera), rejectedClipId=None if issue is None else issue[1], impact=impact, replacement=dict(canApply=replacement_issue is None, reason=None if replacement_issue is None else replacement_issue[0], review=dict(version=document.revision,basis=basis)), documentId=str(document.id), version=document.revision, canApply=issue is None,
+ reason=None if issue is None else issue[0], affectedClipId=query.clip.id,
+ controlledChannels=controlled_channels(query.clip.model_dump(mode='json')),
+ startingComposition=dict(before=previous_pose, after=camera['pose']) if query.applyStartingComposition else None,
+ preservedChannels=[name for name in ('position','target','up') if name not in controlled_channels(query.clip.model_dump(mode='json')) and previous_pose.get(name) == camera['pose'].get(name) and previous_camera['channels'][name] == camera['channels'][name]] + (['focalLength'] if 'focalLength' not in controlled_channels(query.clip.model_dump(mode='json')) and previous_pose['fov'] == camera['pose']['fov'] and previous_camera['channels']['focalLength'] == camera['channels']['focalLength'] else []),
+ coupledLens=dict(startFov=query.clip.startingPose.fov,endFov=dolly_pose(query.clip.model_dump(mode='json'),1)['fov'],unit='deg',anchor=query.clip.parameters.anchor.model_dump(mode='json'),distance=query.clip.parameters.distance) if issue is None and query.clip.presetId=='dolly-zoom' else None,
+ affectedRange=dict(start=0 if composition_changed else query.clip.start, end=stage['duration']))
+ if query.type == 'director.cameraMove.get':
+ document = next((doc for doc in snapshot.editorDocuments if doc.id == query.objectId), None)
+ if document is None or document.kind != 'director':
+ raise ContractError('missing_object', '导演台文档不存在。', query.objectId)
+ return dict(documentId=str(document.id), version=document.revision,
+ cameras=[dict(cameraId=camera.id, clips=[clip.model_dump(mode='json') for clip in camera.moveClips]) for camera in document.data.cameras])
+ if query.type == 'director.storyboard.get':
+ document = next((doc for doc in snapshot.editorDocuments if doc.id == query.objectId), None)
+ if document is None:
+ raise ContractError('missing_object', '业务对象不存在。', query.objectId)
+ if document.kind != 'director':
+ raise ContractError('role_restricted', '只有 Director Stage 文档包含分镜。', query.objectId)
+ return storyboard_state(
+ document.id, document.revision, [shot.model_dump(mode='json') for shot in document.data.shots],
+ document.data.duration, [camera.id for camera in document.data.cameras])
def find(state):
for (kind, object_id), value in object_index(state).items():
if (object_id == query.objectId
diff --git a/packages/core/src/opendirector/application/creation_history.py b/packages/core/src/opendirector/application/creation_history.py
index df7c1c242..75f619916 100644
--- a/packages/core/src/opendirector/application/creation_history.py
+++ b/packages/core/src/opendirector/application/creation_history.py
@@ -16,7 +16,7 @@
ABSENT = object()
UNDOABLE = {'canvas.createGeneration', 'creation.batch', 'canvas.show', 'canvas.hide', 'canvas.move', 'canvas.update', 'canvas.layoutRuns', 'canvas.layoutPipelines', 'canvas.configure',
'canvas.materialize', 'canvas.applyEdit', 'timeline.publishRender', 'canvas.publishMedia', 'canvas.applyVersion', 'canvas.exportVersion', 'canvas.attachEditor', 'canvas.detachEditor', 'generationSpec.update', 'generationSpec.restore',
- 'reference.add', 'reference.update', 'reference.restore', 'reference.remove', 'result.select', 'editor.save', 'generationSpec.setPrompt'}
+ 'reference.add', 'reference.update', 'reference.restore', 'reference.remove', 'result.select', 'editor.save', 'director.apply', 'director.cameraMove.put', 'director.cameraMove.retime', 'director.cameraMove.delete', 'director.cameraMove.convert', 'director.storyboard.append', 'director.storyboard.reorder', 'director.storyboard.resize', 'director.storyboard.delete', 'director.camera.delete', 'director.duration.set', 'generationSpec.setPrompt'}
class Preview(Contract):
@@ -277,6 +277,11 @@ def _validate_editor_locks(before, data):
owner = binding.get('objectRef') if binding['role'] == 'editor' else None
if (owner and owner['id'] in changed) or any(editor['id'] in changed for editor in item.get('editors', [])):
CreationCanvas._editable(current, item['id'])
+ previous_docs = {str(doc.id): doc.model_dump(mode='json') for doc in before.editorDocuments}
+ for document in data['editorDocuments']:
+ old = previous_docs.get(document['id'])
+ if old and old.get('kind') == 'director' and old != document:
+ CreationCanvas._validate_director_locks(old, document)
def version_counts(self, project_id):
snapshot, facts, _ = self.projects.snapshot_with_history_facts(project_id)
diff --git a/packages/core/src/opendirector/application/creation_media_publication.py b/packages/core/src/opendirector/application/creation_media_publication.py
index 9c00acbe5..1cd910c31 100644
--- a/packages/core/src/opendirector/application/creation_media_publication.py
+++ b/packages/core/src/opendirector/application/creation_media_publication.py
@@ -1,9 +1,14 @@
"""Atomic publication of browser-produced media with a fixed editing basis."""
+from math import ceil, isclose
+
+from pydantic import TypeAdapter
+
+from opendirector.domain.creation.director_output import DirectorOutputPlan
+from opendirector.domain.creation.storyboard import storyboard_end, storyboard_issue
from pathlib import Path
from uuid import UUID, uuid5
from filelock import FileLock, Timeout
-from pydantic import TypeAdapter
from opendirector.domain.creation.canvas import CanvasItem, canvas_origin
from opendirector.domain.creation.commands import CanvasPublishMedia, MediaPublicationOutput, parse_command
@@ -15,6 +20,53 @@
from .creation_canvas import CreationCanvas, current_asset, asset_ref
+DIRECTOR_ASPECTS = {
+ '16:9': (16, 9),
+ '2.39:1': (2.39, 1),
+ '9:16': (9, 16),
+ '1:1': (1, 1),
+ '4:3': (4, 3),
+ '3:4': (3, 4),
+}
+
+
+def _director_plan_duration(doc, plan: DirectorOutputPlan):
+ if plan.cameraSource == 'storyboard':
+ if plan.cameraId is not None or not doc.data.shots:
+ raise ContractError(
+ 'invalid_input',
+ '导演预演的分镜执行计划无效。 The Director storyboard execution plan is invalid.',
+ doc.id,
+ )
+ shots = [shot.model_dump() for shot in doc.data.shots]
+ issue = storyboard_issue(shots, doc.data.duration, [camera.id for camera in doc.data.cameras], object_id=doc.id)
+ if issue is not None:
+ raise issue
+ expected_duration = storyboard_end(shots)
+ else:
+ if plan.cameraId is None or not any(camera.id == plan.cameraId for camera in doc.data.cameras):
+ raise ContractError(
+ 'invalid_input',
+ '导演预演引用了不存在的机位。 The Director execution plan references an unknown camera.',
+ doc.id,
+ )
+ expected_duration = doc.data.duration
+ width_ratio, height_ratio = DIRECTOR_ASPECTS[doc.data.aspectRatio]
+ if not isclose(plan.width / plan.height, width_ratio / height_ratio, rel_tol=0.002, abs_tol=0.002):
+ raise ContractError(
+ 'invalid_input',
+ '导演预演输出尺寸与舞台比例不一致。 The Director output size does not match the stage aspect ratio.',
+ doc.id,
+ )
+ if not isclose(plan.durationSeconds, expected_duration, abs_tol=1e-6):
+ raise ContractError(
+ 'invalid_input',
+ '导演预演执行时长与舞台计划不一致。 The Director execution duration does not match the frozen plan.',
+ doc.id,
+ )
+ return expected_duration
+
+
def media_edit_source(snapshot, owner, source):
actual = current_asset(snapshot, owner)
if actual is None or source != asset_ref(actual):
@@ -23,21 +75,55 @@ def media_edit_source(snapshot, owner, source):
def publish_media(service, data, payload, *, staged=frozenset()):
- service._editable(data, payload.itemId)
+ item = service._editable(data, payload.itemId)
snapshot = ProjectSnapshot.model_validate(data)
owner = next(i for i in snapshot.canvasItems if i.id == payload.itemId)
doc = payload.document
if doc.projectId != snapshot.project.id or doc.revision != 1 or any(d.id == doc.id for d in snapshot.editorDocuments):
- raise ContractError('invalid_input', '编辑执行快照必须使用新的工程内身份。', doc.id)
+ raise ContractError('invalid_input', 'The execution snapshot must use a new identity within the project. 编辑执行快照必须使用新的工程内身份。', doc.id)
if doc.inputConnections:
- raise ContractError('invalid_input', '编辑输出不能伪造装配关系。', doc.id)
+ raise ContractError('invalid_input', 'An editor output cannot forge input connections. 编辑输出不能伪造装配关系。', doc.id)
+ history = service.projects.history(snapshot.project.id) if doc.kind == 'director' else ()
+ director_evidence = None
if doc.kind == 'director':
if owner.kind != 'external' or owner.binding.role != 'editor' or owner.binding.objectRef.id != payload.sourceEditorId:
- raise ContractError('reference_invalid', '导演预演来源已变化。', owner.id)
+ raise ContractError('reference_invalid', 'The Director preview source has changed. 导演预演来源已变化。', owner.id)
original = next(d for d in snapshot.editorDocuments if d.id == payload.sourceEditorId)
+ if payload.directorPlan is not None and payload.directorAcceptedAt is not None:
+ accepted = snapshot if payload.directorAcceptedAt == snapshot.eventCursor else next(
+ (record.snapshot for record in history if record.snapshot.eventCursor == payload.directorAcceptedAt), None)
+ # Later creative edits do not rewrite an accepted render. Check the
+ # exact source in recoverable history, while _editable above and the
+ # current binding still enforce current ownership and locks.
+ historical = next((d for d in accepted.editorDocuments if d.id == payload.sourceEditorId), None) if accepted else None
+ historical_owner = next((i for i in accepted.canvasItems if i.id == owner.id), None) if accepted else None
+ if historical is None or historical_owner != owner:
+ raise ContractError('revision_conflict', '导演预演来源与接受版本不一致。 The Director source differs from the accepted version.', owner.id)
+ original = historical
if original.kind != 'director' or original.data != doc.data or payload.source is not None:
- raise ContractError('revision_conflict', '预演输出与已确认的舞台版本不一致。', owner.id)
- allowed, sources = {'video'}, []
+ raise ContractError('revision_conflict', 'The preview output does not match the confirmed stage version. 预演输出与已确认的舞台版本不一致。', owner.id)
+ # Videos render the whole preview; images flow the pinned stills.
+ allowed, sources = {'video', 'image'}, []
+ director_duration = None
+ if payload.directorPlan is not None:
+ director_duration = _director_plan_duration(doc, payload.directorPlan)
+ accepted_cursor = payload.directorAcceptedAt or snapshot.eventCursor
+ accepted = snapshot if accepted_cursor == snapshot.eventCursor else next(
+ (record.snapshot for record in history if record.snapshot.eventCursor == accepted_cursor), None)
+ if accepted is None or original not in accepted.editorDocuments or owner not in accepted.canvasItems:
+ raise ContractError(
+ 'revision_conflict',
+ '导演预演来源与接受版本不一致。 The Director source differs from the accepted version.',
+ owner.id,
+ )
+ director_evidence = dict(acceptedProjectCursor=accepted_cursor, sourceEditorId=original.id,
+ sourceEditorRevision=original.revision, plan=payload.directorPlan)
+ elif any(output.asset.kind == 'video' for output in payload.outputs):
+ raise ContractError(
+ 'invalid_input',
+ '导演视频发布缺少冻结的输出计划。 Director video publication requires a frozen output plan.',
+ doc.id,
+ )
elif doc.kind == 'motion':
if owner.kind != 'motion' or owner.binding.role != 'editor' or owner.binding.objectRef.id != payload.sourceEditorId:
raise ContractError('reference_invalid', '动效来源已变化。', owner.id)
@@ -50,7 +136,7 @@ def publish_media(service, data, payload, *, staged=frozenset()):
if doc.data.sourceItems != (owner.id,) or doc.data.sources != (payload.source,):
raise ContractError('reference_invalid', '本地编辑的来源素材已变化。', owner.id)
if payload.sourceEditorId is not None:
- raise ContractError('invalid_input', '媒体编辑须使用本次固定的素材输入。', owner.id)
+ raise ContractError('invalid_input', 'A media edit must use the media inputs fixed for this run. 媒体编辑须使用本次固定的素材输入。', owner.id)
tool = doc.data.tool
# Local operations preserve source type, except explicit frame/audio extraction.
if tool == 'video-frame-capture':
@@ -58,7 +144,7 @@ def publish_media(service, data, payload, *, staged=frozenset()):
elif tool == 'extract-audio':
expected, allowed = 'video', {'audio'}
if not actual.metadata.hasAudio:
- raise ContractError('invalid_input', '来源视频没有可提取的音轨。', actual.id)
+ raise ContractError('invalid_input', 'The source video has no audio track to extract. 来源视频没有可提取的音轨。', actual.id)
elif tool in {'video-depth-capture', 'video-extend', 'video-partial-reshoot', 'video-trim', 'video-crop', 'video-edit', 'video-upscale', 'video-frame-interpolation', 'video-subtitle-erasure', 'video-matting', 'video-translation', 'video-mask-composite', 'video-structure-reference', 'video-blockout'}:
expected, allowed = 'video', {'video'}
elif tool in {'audio-trim', 'audio-separation'}:
@@ -66,7 +152,7 @@ def publish_media(service, data, payload, *, staged=frozenset()):
else:
expected, allowed = 'image', {'image', 'video'} if tool == 'dynamic-poster' else {'image'}
if actual.kind != expected:
- raise ContractError('invalid_input', '编辑操作与来源媒体类型不匹配。', actual.id)
+ raise ContractError('invalid_input', 'The edit operation does not match the source media type. 编辑操作与来源媒体类型不匹配。', actual.id)
sources = list(asset_references(doc))
used = set()
if any(output.asset.assetId not in staged for output in payload.outputs):
@@ -76,19 +162,77 @@ def publish_media(service, data, payload, *, staged=frozenset()):
service._available(service.assets._reference(snapshot, ref))
for output in payload.outputs:
asset = service.assets._reference(snapshot, output.asset)
- if asset.kind not in allowed or asset.provenance.source != 'upload' or asset.id in used:
- raise ContractError('role_restricted', '输出必须是尚未发布且类型匹配的真实素材。', asset.id)
+ # Uploads come from the browser session; agents register the same
+ # deliverables through artifact.publish. The invariant is freshness.
+ if asset.kind not in allowed or asset.provenance.source not in {'upload', 'agent_written'} or asset.id in used:
+ raise ContractError('role_restricted', 'The output must be a real, type-matching asset that has not been published yet. 输出必须是尚未发布且类型匹配的真实素材。', asset.id)
if asset.id not in staged:
service._available(asset)
- if doc.kind == 'director' and (asset.metadata.durationSeconds is None or abs(asset.metadata.durationSeconds - doc.data.duration) > .15):
- raise ContractError('invalid_input', '预演视频实际时长与执行快照不一致。', asset.id)
+ # Verify the actual render matches the frozen plan before publishing it.
+ if doc.kind == 'director' and asset.kind == 'video':
+ plan = payload.directorPlan
+ if plan is None or director_duration is None:
+ raise ContractError(
+ 'invalid_input',
+ '导演视频发布缺少冻结的输出计划。 Director video publication requires a frozen output plan.',
+ asset.id,
+ )
+ if (asset.metadata.width, asset.metadata.height) != (plan.width, plan.height):
+ raise ContractError(
+ 'invalid_input',
+ '预演视频实际尺寸与执行计划不一致。 The preview video dimensions do not match the execution plan.',
+ asset.id,
+ )
+ # The probe reports average FPS. A shortened final Storyboard frame
+ # keeps the requested cadence but raises the whole-file average.
+ expected_fps = plan.frameRate
+ fps_tolerance = 0.01
+ storyboard = plan.cameraSource == 'storyboard'
+ if storyboard:
+ expected_frames = ceil(round(director_duration * 1000) * plan.frameRate / 1000)
+ expected_fps = expected_frames / director_duration
+ # The MP4 track timebase can represent the end to within 10 microseconds.
+ fps_tolerance = max(fps_tolerance, expected_fps * 0.00001 / (director_duration - 0.00001))
+ if asset.metadata.frameCount not in {None, expected_frames}:
+ raise ContractError(
+ 'invalid_input',
+ '预演视频实际帧数与执行计划不一致。 The preview video frame count does not match the execution plan.',
+ asset.id,
+ )
+ if asset.metadata.frameRate is None or not isclose(
+ asset.metadata.frameRate, expected_fps, rel_tol=0, abs_tol=fps_tolerance
+ ):
+ raise ContractError(
+ 'invalid_input',
+ '预演视频实际帧率与执行计划不一致。 The preview video frame rate does not match the execution plan.',
+ asset.id,
+ )
+ tolerance = 0.00002 if storyboard else 0.15
+ if asset.metadata.durationSeconds is None or not isclose(
+ asset.metadata.durationSeconds, director_duration, rel_tol=0, abs_tol=tolerance
+ ):
+ raise ContractError(
+ 'invalid_input',
+ '预演视频实际时长与执行计划不一致。 The preview video duration does not match the execution plan.',
+ asset.id,
+ )
+ # An image output must be the very bytes of a still this document
+ # pinned; a re-import keeps the asset identity fresh but the
+ # content fingerprint identical.
+ if doc.kind == 'director' and asset.kind == 'image' and all(still.fingerprint != asset.fingerprint for still in doc.data.stills):
+ raise ContractError('invalid_input', '图片输出必须是舞台已入库的定格。 Image outputs must be a still this stage pinned.', asset.id)
if doc.kind == 'motion' and (asset.metadata.durationSeconds is None or abs(asset.metadata.durationSeconds - doc.data.duration) > max(.25, 2 / doc.data.fps)):
raise ContractError('invalid_input', '动效视频实际时长与执行快照不一致。', asset.id)
if any(i['id'] == str(output.itemId) for i in data['canvasItems']):
- raise ContractError('invalid_input', '输出节点身份已存在。', output.itemId)
+ raise ContractError('invalid_input', 'The output item identity already exists. 输出节点身份已存在。', output.itemId)
record = service._get(data, 'asset', asset.id)
+ # The asset changes origin, not history: what the agent run recorded stays with it.
+ origin = asset.provenance.model_dump(mode='json')
record['provenance'] = dict(source='rendered' if doc.kind in {'director', 'motion'} else 'edited', sourceItemId=str(owner.id),
- editorDocumentId=str(doc.id), editorRevision=1, sources=[r.model_dump(mode='json') for r in dict((r.assetId, r) for r in sources).values()])
+ editorDocumentId=str(doc.id), editorRevision=1, sources=[r.model_dump(mode='json') for r in dict((r.assetId, r) for r in sources).values()],
+ **{key: origin[key] for key in ('agentRunId', 'agentRuntime', 'modelSnapshot') if origin.get(key) is not None})
+ if doc.kind == 'director' and asset.kind == 'video':
+ record['provenance']['directorRender'] = director_evidence
result = TypeAdapter(CanvasItem).validate_python(dict(id=output.itemId, projectId=snapshot.project.id, kind=asset.kind,
title=output.title, position=output.position, width=output.width, height=output.height, binding=dict(role='material', objectRef=output.asset)))
data['canvasItems'].append(result.model_dump(mode='json'))
diff --git a/packages/core/src/opendirector/cli.py b/packages/core/src/opendirector/cli.py
index f1b7da639..bc213b561 100644
--- a/packages/core/src/opendirector/cli.py
+++ b/packages/core/src/opendirector/cli.py
@@ -66,7 +66,8 @@
"generation": "Submit a configured generation task.",
"result": "Select a generated result for adoption.",
"editor": "Create and save editable media documents.",
- "timeline": "Discover resources for editable timelines.",
+ "director": "Apply authoritative Director Stage documents.",
+ "timeline": "Discover timeline resources and publish rendered timeline results as project media.",
"motion": "Inspect skills, preview frames and render Web Motion documents.",
"pipeline": "Plan, run, pause, resume, cancel and retry canvas Pipelines.",
"group": "Save and publish segment run plans.",
diff --git a/packages/core/src/opendirector/domain/camera_move_errors.py b/packages/core/src/opendirector/domain/camera_move_errors.py
new file mode 100644
index 000000000..7933e4450
--- /dev/null
+++ b/packages/core/src/opendirector/domain/camera_move_errors.py
@@ -0,0 +1,34 @@
+"""Stable camera-move diagnostics and localized presentation."""
+from typing import Literal
+from opendirector.domain.language import wants_english_language
+CameraMoveIssueCode = Literal['camera_move_conversion_precision', 'camera_move_review_stale', 'camera_move_review_required', 'camera_move_unsupported', 'camera_move_timing', 'camera_move_overlap', 'camera_move_geometry', 'camera_move_animation', 'camera_move_lens_animation', 'camera_move_seam']
+CAMERA_MOVE_MESSAGES = {
+ 'camera_move_conversion_precision': ('无法在精度和关键帧数量限制内转换此运镜。请缩短运动范围后重试。', 'This movement exceeds conversion precision or key-count limits. Shorten its range and retry.'),
+ 'camera_move_review_stale': ('替换审查已过期。草稿已保留,请重新审查完整影响范围。', 'Replacement review is stale. Your draft is preserved; review the full impact again.'),
+ 'camera_move_review_required': ('请先审查并明确批准替换已有动画,或调整运镜范围。', 'Review and explicitly approve replacement of existing animation, or adjust the movement range.'),
+ 'camera_move_unsupported': ('运镜标识或算法版本不受支持,原工程保持不变。', 'Unsupported movement identity, preset or algorithm version; the original project is preserved.'),
+ 'camera_move_timing': ('运镜时间必须为有限的非负秒数,至少一帧,且不得超过主时间线。', 'Use finite nonnegative seconds, at least one frame, and keep the move inside the main timeline.'),
+ 'camera_move_overlap': ('同一相机的运镜不能重叠。', 'Camera moves on the same camera cannot overlap.'),
+ 'camera_move_geometry': ('滑动变焦需要光轴固定锚点、有符号位移、全程分离及 1–179° 联动视场角。请使用有效的运镜参数,使相机与目标全程分离;环绕需要固定中心、非零水平半径、方向和有效扫角。螺旋上升还需正高度。摇摄和俯仰需要有效转角、方向与非垂直视线;所有运镜全程(含终点保持)的上方向不得为零或与视线共线。滚转需要 −180–180° 转角及捕获的非零上方向;独立视线全程(含终点保持)须可证明安全。请调整上方向或简化位置和目标动画。', 'Dolly zoom requires an optical-axis fixed anchor, signed distance, separated full path and 1–179° coupled FOV. Use valid movement parameters and keep camera and target separated. Orbit requires a fixed center, nonzero horizontal radius, direction and valid sweep. Spiral rise also requires positive height. Pan/tilt requires a valid angle, direction and nonvertical sightline. Every movement requires a provably safe nonzero, noncollinear up-vector path; Roll requires an angle from −180 to 180 degrees and captured nonzero baselineUp; the independent view path including endpoint hold must be provably safe. Adjust up or simplify position/target animation.'),
+ 'camera_move_animation': ('预设控制的通道已有动画,包括跨区间插值和终点保持。请调整运镜范围,或审查并明确批准替换已披露的动画;未控制的通道仍可编辑。', 'Preset-controlled channel animation conflicts, including interpolation across the interval and endpoint hold. Adjust the movement range, or review and explicitly approve replacement of the disclosed animation; uncontrolled channels remain editable.'),
+ 'camera_move_lens_animation': ('已有视场角动画保持独立。保留采样的起始视场角,或在镜头通道中编辑动画。', 'Existing field-of-view animation remains independent. Keep the sampled starting FOV, or edit animation in the lens channel.'),
+ 'camera_move_seam': ('运镜接缝或手动动画的恢复锚点不连续。请查看接缝时间与通道,明确对齐所选运镜,或用关键帧另行创作过渡;不会自动修改相邻运镜和手动曲线。', 'A movement join or manual resumption anchor is discontinuous. Inspect the seam time and channel, explicitly align the selected recipe, or author a separate keyframe transition. Neighbors and manual curves are never changed automatically.'),
+}
+def camera_move_error_message(code, language):
+ messages = CAMERA_MOVE_MESSAGES.get(code)
+ return None if messages is None else messages[1 if wants_english_language(language) else 0]
+
+
+def camera_move_conflict_message(message, identities):
+ """Keep the presentation bounded; the receipt retains every identity."""
+ tokens = list(identities)
+ shown = []
+ for token in tokens:
+ candidate = message + ' [' + ', '.join([*shown, token]) + ', …]'
+ if len(candidate) > 500:
+ break
+ shown.append(token)
+ if not tokens:
+ return message
+ suffix = ', …' if len(shown) < len(tokens) else ''
+ return message + ' [' + ', '.join(shown) + suffix + ']'
diff --git a/packages/core/src/opendirector/domain/creation/assets.py b/packages/core/src/opendirector/domain/creation/assets.py
index 99b5c3c6d..28963004b 100644
--- a/packages/core/src/opendirector/domain/creation/assets.py
+++ b/packages/core/src/opendirector/domain/creation/assets.py
@@ -6,6 +6,7 @@
from opendirector.domain.rule_facts import PROMPT_MAX_LENGTH
from .base import Contract, Fingerprint, MediaKind, NonNegative, Positive, PositiveInt, ProjectEntity, Revision
+from .director_output import DirectorRenderEvidence
from .models import ModelSnapshot
@@ -47,9 +48,13 @@ class MediaMetadata(Contract):
height: PositiveInt | None = Field(default=None, description='Height in pixels.')
durationSeconds: Positive | None = Field(default=None, description='Duration in seconds.')
frameRate: Positive | None = Field(default=None, description='Video frames per second.')
+ frameCount: PositiveInt | None = Field(default=None, exclude_if=lambda value: value is None,
+ description='Number of video frames reported by the media container.')
hasAudio: bool | None = Field(default=None, description='Whether the media contains an audio stream.')
sampleRate: PositiveInt | None = Field(default=None, description='Audio samples per second.')
channels: PositiveInt | None = Field(default=None, description='Audio channel count.')
+ selfContained: bool | None = Field(default=None, description='Whether a model container embeds all its buffers and images.')
+ animationNames: tuple[str, ...] | None = Field(default=None, description='Animation clip names declared by a parsed model container, in document order.')
videoCodec: str | None = Field(default=None, min_length=1, max_length=64, description='Primary video stream codec name.')
audioCodecs: tuple[str, ...] | None = Field(default=None, description='Audio stream codec names in stream order.')
@@ -102,6 +107,8 @@ class AssetProvenance(Contract):
sourceItemId: UUID | None = Field(default=None, description='Source canvas item ID.')
editorDocumentId: UUID | None = Field(default=None, description='Editable document ID.')
editorRevision: Revision | None = Field(default=None, description='Expected editable document revision.')
+ directorRender: DirectorRenderEvidence | None = Field(default=None, exclude_if=lambda value: value is None,
+ description='Frozen Director video output evidence and source version.')
sources: tuple[AssetRef, ...] = Field(default=(), description='Ordered source asset versions.')
inputFingerprint: str | None = Field(default=None, pattern=r'^[0-9a-f]{64}$', description='Fingerprint of the fixed execution input.')
agentRunId: UUID | None = Field(default=None, description='Agent turn ID.')
@@ -121,6 +128,8 @@ def evidence(self):
if self.source == 'agent_written' and (self.agentRunId is None or
not ((self.modelSnapshot is not None and self.modelSnapshot.kind == 'agent') or self.agentRuntime is not None)):
raise ValueError('Agent-written documents require a run and an agent model or native runtime')
+ if self.directorRender is not None and self.source != 'rendered':
+ raise ValueError('Only rendered assets carry Director output evidence')
if self.source in {'edited', 'rendered'} and (self.editorDocumentId is None or self.editorRevision is None):
raise ValueError('Edited outputs require their source document version')
if (self.editorDocumentId is None) != (self.editorRevision is None):
diff --git a/packages/core/src/opendirector/domain/creation/camera_moves.py b/packages/core/src/opendirector/domain/creation/camera_moves.py
new file mode 100644
index 000000000..14054e366
--- /dev/null
+++ b/packages/core/src/opendirector/domain/creation/camera_moves.py
@@ -0,0 +1,775 @@
+"""Shared effective-animation admission and reviewed replacement for camera moves."""
+from math import floor, hypot, isfinite, sin, cos, pi, atan2, tan, atan
+from uuid import UUID
+from opendirector.domain.camera_move_errors import CAMERA_MOVE_MESSAGES, camera_move_conflict_message
+from opendirector.domain.creation.validation import ContractError
+
+PRESET_NAMES = {'push-in': ('推近', 'Push in'), 'pull-out': ('拉远', 'Pull out'), 'lateral': ('横移', 'Lateral'), 'rise': ('上升', 'Rise'), 'descend': ('下降', 'Descend'), 'orbit': ('环绕', 'Orbit'), 'half-arc': ('半弧', 'Half arc'), 'spiral-rise': ('螺旋上升', 'Spiral rise'), 'pan-left': ('向左摇摄','Pan left'), 'pan-right': ('向右摇摄','Pan right'), 'tilt': ('俯仰','Tilt'), 'roll': ('滚转','Roll'), 'dolly-zoom': ('滑动变焦','Dolly zoom')}
+ANGULAR = {'pan-left','pan-right','tilt'}
+ORBITS = {'orbit', 'half-arc', 'spiral-rise'}
+TRANSLATIONS = {'lateral', 'rise', 'descend'}
+CAMERA_MOVE_PRESETS = tuple(dict(id=preset, algorithmVersion=1,
+ nameKey=f'cameraMove.{preset}', names=dict(zip(('zh-CN','en-US'), names)),
+ controlledChannels=['position','target','focalLength'] if preset=='dolly-zoom' else ['up'] if preset=='roll' else ['target'] if preset in ANGULAR else ['position', 'target'],
+ parameters=dict(
+ **(dict(anchor=dict(type='vector3',required=True,unit='m',default='starting-target',descriptions={'en-US':'Fixed optical-axis framing anchor, equal to starting target. Owns position, target and vertical FOV in degrees. Positive distance approaches anchor, negative retreats; FOV stays 1–179 degrees. Up and static roll remain independent.','zh-CN':'固定光轴构图锚点,须等于起始目标。控制位置、目标与以度为单位的垂直视场角。正位移朝向锚点,负位移远离;视场角保持 1–179 度。上方向与静态滚转保持独立。'})) if preset=='dolly-zoom' else {}),
+ **(dict(angle=dict(type='number',required=True,min=-180,max=180,default=30,unit='deg'),baselineUp=dict(type='vector3',required=True,default='sampled-up')) if preset=='roll' else {}),
+ **(dict(angle=dict(type='number',required=True,min=.1,max=89 if preset=='tilt' else 180,default=30,unit='deg',descriptions={'en-US':'Rotate captured sightline about world Y (pan) or captured horizontal right (tilt). Target offset follows effective position; position and lens remain independent.','zh-CN':'摇摄绕世界 Y 轴,俯仰绕捕获的水平右轴旋转视线;目标偏移跟随实际位置,位置和镜头保持独立。'}),**(dict(tiltDirection=dict(type='string',required=True,enum=['up','down'],default='up')) if preset=='tilt' else {})) if preset in ANGULAR else {}),
+ **(dict(height=dict(type='number', required=True, min=.001, max=10000,
+ default=1, unit='m', nameKey='cameraMove.height', descriptions={
+ 'en-US': 'Camera and captured target rise equally along world Y; center stays fixed. No subject tracking.',
+ 'zh-CN': '相机与捕获的目标沿世界 Y 轴等量升高,世界中心固定,不跟踪主体。',
+ })) if preset == 'spiral-rise' else {}),
+ **(dict(center=dict(type='vector3', required=True, unit='m', default='starting-target'), orbitDirection=dict(type='string', required=True, enum=['clockwise','counterclockwise'], default='clockwise'), sweep=dict(type='number', required=True, min=180 if preset=='half-arc' else .1, max=180 if preset=='half-arc' else 360, default=180 if preset=='half-arc' else 90, unit='deg')) if preset in ORBITS else {}), **(dict(distance=dict(type='number', default=1, min=-10000 if preset=='dolly-zoom' else .001, max=10000, unit='m', shortcuts=[.5,1,2], **(dict(minMagnitude=.001) if preset=='dolly-zoom' else {}))) if preset not in ORBITS | ANGULAR | {'roll'} else {}),
+ **(dict(viewingPolicy=dict(type='string', enum=['fixed-target','parallel-sightline'], default='fixed-target', required=True)) if preset in TRANSLATIONS else {}),
+ **(dict(direction=dict(type='string', enum=['left','right'], default='right', required=True)) if preset == 'lateral' else {})))
+ for preset, names in PRESET_NAMES.items())
+
+
+def controlled_channels(clip):
+ return next((preset['controlledChannels'] for preset in CAMERA_MOVE_PRESETS
+ if preset['id'] == clip['presetId'] and preset['algorithmVersion'] == clip['algorithmVersion']), [])
+
+
+def relative_angular_join(clip, has_previous):
+ """A first zero-time angular recipe joins the absolute static target."""
+ return clip['presetId'] in ANGULAR and (has_previous or clip['start'] > 0)
+
+
+def angular_basis(clip):
+ """Rodrigues coefficients a*cos(t)+b*sin(t)+c for the captured sightline."""
+ pose=clip['startingPose']
+ f=[pose['target'][axis]-pose['position'][axis] for axis in ('x','y','z')]
+ horizontal=hypot(f[0],f[2])
+ axis=[-f[2]/horizontal,0,f[0]/horizontal] if clip['presetId']=='tilt' and horizontal>1e-6 else [0,1,0]
+ dot=sum(x*y for x,y in zip(axis,f))
+ c=[x*dot for x in axis]
+ a=[x-y for x,y in zip(f,c)]
+ b=[axis[1]*f[2]-axis[2]*f[1],axis[2]*f[0]-axis[0]*f[2],axis[0]*f[1]-axis[1]*f[0]]
+ angle=(clip['parameters'].get('angle') or 0)*pi/180*(-1 if clip['presetId']=='pan-right' or (clip['presetId']=='tilt' and clip['parameters'].get('tiltDirection')=='down') else 1)
+ return a,b,c,angle,hypot(*f),horizontal
+
+
+def rotation_dot_maximum(a,b,c,angle):
+ critical=atan2(b,a)
+ angles=[0,angle]+[critical+k*pi for k in range(-3,4) if min(0,angle)<=critical+k*pi<=max(0,angle)]
+ return max(abs(a*cos(t)+b*sin(t)+c) for t in angles)
+
+
+def safe_angular_geometry(camera,clip):
+ """Exact static-up extrema; animated-up convex cone excludes every singularity."""
+ parameters=clip['parameters']
+ if parameters.get('angle') is None or not .1<=parameters['angle']<=(89 if clip['presetId']=='tilt' else 180) or (clip['presetId']=='tilt' and parameters.get('tiltDirection') not in {'up','down'}):
+ return False
+ a,b,c,angle,length,horizontal=angular_basis(clip)
+ if not isfinite(length) or length<=1e-6 or horizontal<=1e-6:
+ return False
+ up=[[key['value'][axis] for axis in ('x','y','z')] for key in camera['channels']['up']] or [[0,1,0]]
+ norm=hypot(*up[0])
+ if not isfinite(norm) or norm<=1e-6:
+ return False
+ ref=[x/norm for x in up[0]]
+ def dot(v): return sum(x*y for x,y in zip(v,ref))
+ maximum=rotation_dot_maximum(dot(a)/length,dot(b)/length,dot(c)/length,angle)
+ minimum=min(map(dot,up))
+ perpendicular=max(hypot(*(x-y*dot(v) for x,y in zip(v,ref))) for v in up)
+ if maximum>=1-1e-12 or minimum<=1e-6 or (max(0,1-maximum*maximum)**.5)*minimum<=maximum*perpendicular+1e-6:
+ return False
+ keys=camera['channels']['position']
+ # The sampler subtracts endpoints before blending; guard that arithmetic too.
+ if any(not isfinite(right['value'][axis]-left['value'][axis]) for left,right in zip(keys,keys[1:]) for axis in ('x','y','z')):
+ return False
+ positions=[camera['pose']['position']]+[k['value'] for k in keys]
+ positions += [p for m in camera.get('moveClips',()) if (end := endpoint(m)) is not None for p in (m['startingPose']['position'],end['position'])]
+ return all(isfinite(abs(p[axis])+length) and length>1e-6+64*2.220446049250313e-16*(abs(p[axis])+length) for p in positions for axis in ('x','y','z'))
+
+
+def endpoint(clip):
+ pose, parameters = clip['startingPose'], clip['parameters']
+ if clip['presetId']=='roll':return dict(pose)
+ if clip['presetId']=='dolly-zoom':return dolly_pose(clip,1)
+ if clip['presetId'] in ANGULAR:
+ a,b,c,angle,_,_=angular_basis(clip)
+ return {**pose,'target':{axis:pose['position'][axis]+a[i]*cos(angle)+b[i]*sin(angle)+c[i] for i,axis in enumerate(('x','y','z'))}}
+ if clip['presetId'] in ORBITS:
+ center = parameters.get('center')
+ if center is None or parameters.get('sweep') is None:
+ return None
+ angle=parameters['sweep']*pi/180*(1 if parameters.get('orbitDirection')=='clockwise' else -1)
+ def rotate(point):
+ x,z=point['x']-center['x'],point['z']-center['z']
+ return dict(x=center['x']+x*cos(angle)+z*sin(angle),y=point['y']+(parameters.get('height') or 0) if clip['presetId']=='spiral-rise' else point['y'],z=center['z']-x*sin(angle)+z*cos(angle))
+ return {**pose,'position':rotate(pose['position']),'target':rotate(pose['target'])}
+ delta = {axis: pose['target'][axis]-pose['position'][axis] for axis in ('x','y','z')}
+ if clip['presetId'] == 'lateral':
+ length = hypot(delta['x'], delta['z'])
+ if length <= 1e-6:
+ return None
+ sign = -1 if parameters.get('direction') == 'left' else 1
+ direction = dict(x=-delta['z']/length*sign, y=0, z=delta['x']/length*sign)
+ elif clip['presetId'] in {'rise', 'descend'}:
+ direction = dict(x=0, y=1 if clip['presetId']=='rise' else -1, z=0)
+ else:
+ length = hypot(*delta.values())
+ if length <= 1e-6:
+ return None
+ sign = 1 if clip['presetId']=='push-in' else -1
+ direction = {axis: value/length*sign for axis,value in delta.items()}
+ def translated(point):
+ return {axis: point[axis]+direction[axis]*parameters['distance'] for axis in delta}
+ return {**pose, 'position': translated(pose['position']),
+ 'target': translated(pose['target']) if clip['presetId'] in TRANSLATIONS and parameters.get('viewingPolicy') == 'parallel-sightline' else dict(pose['target'])}
+
+
+def valid_geometry(clip):
+ if clip['presetId']=='roll': return True
+ if clip['presetId']=='dolly-zoom': return valid_dolly_geometry(clip)
+ end = endpoint(clip)
+ if end is None:
+ return False
+ if clip['presetId'] in ORBITS:
+ if clip['presetId']=='spiral-rise' and (clip['parameters'].get('height') is None or not .001 <= clip['parameters']['height'] <= 10000):
+ return False
+ center=clip['parameters'].get('center')
+ if not center:
+ return False
+ separation=hypot(*(clip["startingPose"]["target"][axis]-clip["startingPose"]["position"][axis] for axis in ("x","y","z")))
+ # Bound the complete circle and leave enough precision to represent its sightline.
+ for point in (clip['startingPose']['position'], clip['startingPose']['target']):
+ radius=hypot(point['x']-center['x'],point['z']-center['z'])
+ end_y=point['y']+(clip['parameters'].get('height') or 0) if clip['presetId']=='spiral-rise' else point['y']
+ scale=max(1,abs(center['x'])+radius,abs(center['z'])+radius,abs(point['y']),abs(end_y))
+ if separation <= 1e-6 + 64 * 2.220446049250313e-16 * scale:
+ return False
+ if not all(isfinite(value) for value in (end_y, radius, center['x']+radius, center['x']-radius, center['z']+radius, center['z']-radius)):
+ return False
+ return bool(clip['parameters'].get('orbitDirection') in {'clockwise','counterclockwise'} and
+ clip['parameters'].get('sweep') is not None and (clip['presetId']!='half-arc' or clip['parameters']['sweep']==180) and
+ hypot(clip['startingPose']['position']['x']-center['x'],clip['startingPose']['position']['z']-center['z'])>1e-6)
+ if clip['presetId'] in TRANSLATIONS and clip['parameters'].get('viewingPolicy') == 'parallel-sightline':
+ return True
+ pose = clip['startingPose']
+ delta = [end['position'][axis]-pose['position'][axis] for axis in ('x','y','z')]
+ toward = [pose['target'][axis]-pose['position'][axis] for axis in ('x','y','z')]
+ squared_distance = sum(v*v for v in delta)
+ if squared_distance == 0:
+ return False
+ nearest = max(0,min(1,sum(a*b for a,b in zip(toward,delta))/squared_distance))
+ return hypot(*(a-b*nearest for a,b in zip(toward,delta))) > 1e-6
+
+def safe_spiral_orientation(camera, clip):
+ # The complete up interpolation is in its key-value hull. A common vertical
+ # sign and separated cones prove non-collinearity at every yaw angle.
+ pose = clip['startingPose']
+ horizontal = hypot(pose['target']['x']-pose['position']['x'], pose['target']['z']-pose['position']['z'])
+ vertical = abs(pose['target']['y']-pose['position']['y'])
+ up = [key['value'] for key in camera['channels']['up']] or [dict(x=0,y=1,z=0)]
+ # For static up, extrema of dot(gaze(theta), up) find interior singularities.
+ if all(value == up[0] for value in up):
+ gaze_length = hypot(horizontal, vertical)
+ up_length = hypot(up[0]['x'],up[0]['y'],up[0]['z'])
+ if not isfinite(up_length) or up_length <= 1e-6:
+ return False
+ fx,fy,fz = ((pose['target'][axis]-pose['position'][axis])/gaze_length for axis in ('x','y','z'))
+ ux,uy,uz = (up[0][axis]/up_length for axis in ('x','y','z'))
+ a,b,c = fx*ux+fz*uz,fz*ux-fx*uz,fy*uy
+ sweep = clip['parameters']['sweep']*pi/180*(1 if clip['parameters']['orbitDirection']=='clockwise' else -1)
+ angles = [0,sweep]
+ critical = atan2(b,a)
+ angles.extend(critical+k*pi for k in range(-3,4) if min(0,sweep) <= critical+k*pi <= max(0,sweep))
+ return all(abs(a*cos(angle)+b*sin(angle)+c) < 1-1e-12 for angle in angles)
+ norms = [hypot(*value.values()) for value in up]
+ if any(not isfinite(n) or n <= 1e-6 for n in norms):
+ return False
+ # Positive key scaling preserves the interpolation cone, not its magnitude.
+ directions = [{axis: value[axis]/norm for axis in ('x', 'y', 'z')} for value, norm in zip(up, norms)]
+ sign = 1 if directions[0]['y'] > 0 else -1 if directions[0]['y'] < 0 else 0
+ minimum = min(value['y']*sign for value in directions)
+ maximum = max(hypot(value['x'], value['z']) for value in directions)
+ return minimum > 1e-6 and horizontal*minimum > vertical*maximum + 1e-6
+
+def safe_linear_orientation(camera, clip):
+ """Separate the whole bilinear view/up hull from zero, including endpoint holds.
+
+ A straight recipe's gaze is a segment. Up interpolation stays in its key
+ hull (easing is bounded), so every cross product is a convex combination
+ of the endpoint/key cross products. A separating plane proves the complete
+ path, without checking selected times. For static up the witness is the
+ exact nearest point of the cross-product segment.
+ """
+ axes = ('x', 'y', 'z')
+ poses = (clip['startingPose'], endpoint(clip))
+ gazes = [[pose['target'][a]-pose['position'][a] for a in axes] for pose in poses]
+ ups = [[key['value'][a] for a in axes] for key in camera['channels']['up']] or [[0, 1, 0]]
+ lengths = [hypot(*v) for v in gazes + ups]
+ if any(not isfinite(n) or n <= 1e-6 for n in lengths):
+ return False
+ # Positive scaling preserves the generated cone, while removing magnitude
+ # from orientation tolerances. The raw interpolator is checked separately.
+ gazes = [[v/lengths[i] for v in gaze] for i, gaze in enumerate(gazes)]
+ ups = [[v/lengths[i+2] for v in up] for i, up in enumerate(ups)]
+ def cross(a, b):
+ return [a[1]*b[2]-a[2]*b[1], a[2]*b[0]-a[0]*b[2], a[0]*b[1]-a[1]*b[0]]
+ first, last = (cross(gaze, ups[0]) for gaze in gazes)
+ delta = [b-a for a, b in zip(first, last)]
+ squared = sum(v*v for v in delta)
+ nearest = max(0, min(1, -sum(a*b for a, b in zip(first, delta))/squared)) if squared else 0
+ witness = [a+nearest*b for a, b in zip(first, delta)]
+ norm = hypot(*witness)
+ if norm <= 1e-6:
+ return False
+ witness = [v/norm for v in witness]
+ return all(sum(a*b for a, b in zip(witness, cross(gaze, up))) > 1e-6 for gaze in gazes for up in ups)
+
+
+def primitive_issue(clip):
+ """Validate every recipe before another recipe can inspect its derived path.
+
+ Cross-clip orientation and seam proofs may read later clips. A malformed
+ later path must yield a business issue rather than an unchecked derived read.
+ """
+ preset, parameters = clip['presetId'], clip['parameters']
+ if preset not in PRESET_NAMES or clip['algorithmVersion'] != 1:
+ return 'camera_move_unsupported'
+ distance=parameters.get('distance',1)
+ if not isfinite(distance) or abs(distance)>10000 or (abs(distance)<.001 if preset=='dolly-zoom' else distance<.001):
+ return 'camera_move_geometry'
+ angle = parameters.get('angle')
+ if angle is not None and not (.1 <= angle <= 180 if preset != 'roll' else -180 <= angle <= 180):
+ return 'camera_move_geometry'
+ if preset == 'roll':
+ up = parameters.get('baselineUp')
+ if angle is None or not up or not isfinite(hypot(*up.values())) or hypot(*up.values()) <= 1e-6:
+ return 'camera_move_geometry'
+ elif preset in ANGULAR:
+ if angle is None or angle > (89 if preset == 'tilt' else 180) or (preset == 'tilt' and parameters.get('tiltDirection') not in {'up', 'down'}):
+ return 'camera_move_geometry'
+ _, _, _, _, length, horizontal = angular_basis(clip)
+ if not isfinite(length) or length <= 1e-6 or horizontal <= 1e-6:
+ return 'camera_move_geometry'
+ elif not valid_geometry(clip):
+ return 'camera_move_geometry'
+ if (preset in TRANSLATIONS and parameters.get('viewingPolicy') not in {'fixed-target', 'parallel-sightline'}) or (preset == 'lateral' and parameters.get('direction') not in {'left', 'right'}):
+ return 'camera_move_geometry'
+ return None
+
+
+def camera_move_issue(stage):
+ identities = set()
+ for camera in stage['cameras']:
+ previous = None
+ if camera.get('moveClips') and not finite_vector_interpolation(camera):
+ return 'camera_move_geometry',camera['moveClips'][0]['id']
+ for clip in camera.get('moveClips', ()):
+ issue = primitive_issue(clip)
+ if issue:
+ return issue, clip['id']
+ for clip in sorted(camera.get('moveClips', ()), key=lambda clip: clip['start']):
+ if clip['id'] in identities or clip['presetId'] not in PRESET_NAMES or clip['algorithmVersion'] != 1:
+ return 'camera_move_unsupported', clip['id']
+ identities.add(clip['id'])
+ start, duration = clip['start'], clip['duration']
+ if not all(isfinite(t) for t in (start,duration)) or start < 0 or duration+1e-8 < 1/stage['fps'] or start+duration > stage['duration']+1e-8:
+ return 'camera_move_timing', clip['id']
+ if previous and previous['start']+previous['duration'] > start+1e-8:
+ return 'camera_move_overlap', clip['id']
+ pose = clip['startingPose']
+ length = hypot(*(pose['target'][axis]-pose['position'][axis] for axis in ('x','y','z')))
+ if (not isfinite(length) or length <= 1e-6 or
+ (clip['presetId'] in TRANSLATIONS and clip['parameters'].get('viewingPolicy') not in {'fixed-target','parallel-sightline'}) or
+ (clip['presetId']=='lateral' and clip['parameters'].get('direction') not in {'left','right'}) or (not safe_roll_geometry(camera,clip) if clip['presetId']=='roll' else not safe_angular_geometry(camera,clip) if clip['presetId'] in ANGULAR else not valid_geometry(clip)) or
+ (clip['presetId'] in ORBITS and not safe_spiral_orientation(camera,clip)) or
+ (clip['presetId']=='dolly-zoom' and not safe_dolly_orientation(camera,clip)) or
+ (clip['presetId'] in TRANSLATIONS | {'push-in', 'pull-out'} and not safe_linear_orientation(camera,clip))):
+ return 'camera_move_geometry', clip['id']
+ if any((k.get('manualBoundary') or k.get('holdIncoming')) and startstart and c['start']<=resume and channel in controlled_channels(c) for c in camera.get('moveClips',())):
+ held_camera = {**camera, 'channels': {**camera['channels'], channel: []}}
+ held = effective_up(held_camera,resume) if channel=='up' else effective_pose(held_camera,resume)['fov' if channel=='focalLength' else channel]
+ if not values_equal(channel, held, sample_channel(camera,channel,resume)):
+ return 'camera_move_seam', clip['id']
+ if clip['presetId']=='roll':
+ expected_up=effective_up({**camera,'moveClips':[c for c in camera.get('moveClips',()) if c['start']1e-6:
+ return 'camera_move_seam',clip['id']
+ relative = relative_angular_join(clip, previous is not None)
+ if any(abs((pose[channel][axis]-(pose['position'][axis] if relative and channel=='target' else 0))-(expected[channel][axis]-(expected['position'][axis] if relative and channel=='target' else 0))) > 1e-6 for channel in controlled_channels(clip) if channel in {'position','target'} for axis in ('x','y','z')):
+ return 'camera_move_seam', clip['id']
+ previous = clip
+ return None
+
+def normalize_camera_moves(stage):
+ # Nanosecond precision retains fractional frame durations while removing float noise.
+ for camera in stage['cameras']:
+ for clip in camera.get('moveClips', ()):
+ for field in ('start', 'duration'):
+ value = clip[field]
+ if isfinite(value) and value >= 0 and isfinite(value * 1_000_000_000):
+ clip[field] = floor(value * 1_000_000_000 + .5) / 1_000_000_000
+ return stage
+
+def validate_camera_moves(stage, document_id):
+ # Report every affected identity at the shared document write boundary.
+ # The duration command judges the applied (Storyboard-clamped) duration.
+ conflicts = [dict(cameraId=camera['id'], clipId=clip['id'])
+ for camera in stage['cameras'] for clip in camera.get('moveClips', ())
+ if not all(isfinite(t) for t in (clip['start'], clip['duration']))
+ or clip['start'] < 0 or clip['duration'] + 1e-8 < 1 / stage['fps']
+ or clip['start'] + clip['duration'] > stage['duration'] + 1e-8]
+ if conflicts:
+ identities = (f"{item['cameraId']}/{item['clipId']}" for item in conflicts)
+ raise ContractError('camera_move_timing', camera_move_conflict_message(CAMERA_MOVE_MESSAGES['camera_move_timing'][0], identities),
+ UUID(str(document_id)), field=f"data.cameras.moveClips.{conflicts[0]['clipId']}",
+ camera_move_conflicts=conflicts)
+ issue = camera_move_issue(stage)
+ if issue:
+ code, identity = issue
+ detail = next((d for camera in stage['cameras'] for d in seam_details(camera) if d['clipId']==identity), None) if code=='camera_move_seam' else None
+ suffix = f".{detail['channel']}@{detail['time']}s" if detail else ''
+ raise ContractError(code, CAMERA_MOVE_MESSAGES[code][0], UUID(str(document_id)), field=f'data.cameras.moveClips.{identity}{suffix}')
+
+
+def sample_channel(camera, channel, time):
+ """Manual vector/FOV channel at absolute time, with the shared Bezier timing semantics."""
+ keys = camera['channels'][channel]
+ if not keys:
+ return dict(x=0,y=1,z=0) if channel=='up' else camera['pose']['fov' if channel == 'focalLength' else channel]
+ left = next((key for key in reversed(keys) if key['time'] <= time), keys[0])
+ right = next((key for key in keys if key['time'] >= time), keys[-1])
+ progress = 0 if left['time'] == right['time'] or right.get('holdIncoming') and time < right['time'] else (time-left['time'])/(right['time']-left['time'])
+ transition = left.get('transition')
+ if 0 < progress < 1 and transition and transition['kind'] == 'bezier':
+ x1, y1, x2, y2 = transition['controlPoints']
+ def cubic(a, b, t):
+ return 3*(1-t)*(1-t)*t*a + 3*(1-t)*t*t*b + t*t*t
+ low, high = 0, 1
+ for _ in range(40):
+ midpoint = (low+high)/2
+ if cubic(x1, x2, midpoint) < progress:
+ low = midpoint
+ else:
+ high = midpoint
+ progress = cubic(y1, y2, (low+high)/2)
+ if channel != 'focalLength':
+ return {axis:left['value'][axis]+(right['value'][axis]-left['value'][axis])*progress for axis in ('x','y','z')}
+ return left['value']+(right['value']-left['value'])*progress
+
+
+def sample_lens(camera, time):
+ return sample_channel(camera, 'focalLength', time)
+
+
+def apply_starting_composition(camera, clip):
+ """Explicit static composition edit; never erase animated/manual evidence."""
+ if any(other['id'] != clip['id'] and other['start'] <= clip['start']
+ for other in camera.get('moveClips', ())):
+ return 'camera_move_seam', clip['id']
+ changes = {}
+ old = next((old for old in camera.get('moveClips', ()) if old['id'] == clip['id']), None)
+ for channel, field in (('position', 'position'), ('target', 'target'), ('focalLength', 'fov')):
+ keys = camera['channels'][channel]
+ value = clip['startingPose'][field]
+ baseline = keys[0]['value'] if keys else camera['pose'][field]
+ equal = (lambda a, b: all(abs(a[axis]-b[axis]) <= 1e-6 for axis in ('x','y','z'))) if channel != 'focalLength' else (lambda a, b: abs(a-b) <= 1e-6)
+ if equal(value, sample_channel(camera,channel,clip['start'])) or (old and equal(value, old['startingPose'][field])):
+ continue
+ # Lens keys are an independent channel: composing a positional recipe
+ # never changes them. The wizard disables lens edits in this case.
+ if channel == 'focalLength' and keys and any(not equal(key['value'], baseline) for key in keys):
+ if not equal(value, sample_lens(camera, clip['start'])):
+ return 'camera_move_lens_animation', clip['id']
+ continue
+ if any(not equal(key['value'], baseline) for key in keys):
+ return 'camera_move_animation', clip['id']
+ if not equal(value, baseline):
+ changes[channel] = (field, value)
+ for channel, (field, value) in changes.items():
+ camera['pose'][field] = value
+ for key in camera['channels'][channel]:
+ key['value'] = value
+ for key in camera.get('keyframes', ()):
+ key['value'][field] = value
+ return None
+
+
+def retime_camera_move(clip, edge, time, fps, snap=True):
+ """Endpoint arithmetic shared by body moves and either stretch operation.
+
+ Only the edited endpoint snaps. The fixed endpoint and path remain intact.
+ Admission rejects invalid intervals after this pure calculation.
+ """
+ def normalized(value):
+ return floor(value * 1_000_000_000 + .5) / 1_000_000_000 if isfinite(value * 1_000_000_000) else value
+ value = normalized(floor(time * fps + .5) / fps if snap and isfinite(time * fps) else time)
+ start = clip['start'] if edge == 'right' else value
+ duration = clip['duration'] if edge == 'move' else (
+ value - clip['start'] if edge == 'right' else clip['start'] + clip['duration'] - value)
+ return {**clip, 'start': start, 'duration': normalized(duration)}
+
+
+def roll_up(clip, progress, pose):
+ captured=clip['parameters']['baselineUp'];norm=hypot(*captured.values())
+ up={a:v/norm for a,v in captured.items()}
+ d=[pose['position'][a]-pose['target'][a] for a in ('x','y','z')]
+ length=hypot(*d);a=[v/length for v in d];u=[up[k] for k in ('x','y','z')]
+ t=clip['parameters']['angle']*pi/180*max(0,min(1,progress));c,s=cos(t),sin(t)
+ dot=sum(x*y for x,y in zip(a,u));cross=[a[1]*u[2]-a[2]*u[1],a[2]*u[0]-a[0]*u[2],a[0]*u[1]-a[1]*u[0]]
+ return dict(zip(('x','y','z'),(u[i]*c+cross[i]*s+a[i]*dot*(1-c) for i in range(3))))
+
+
+def safe_roll_geometry(camera,clip):
+ up=clip['parameters'].get('baselineUp');angle=clip['parameters'].get('angle')
+ if not up or angle is None or not -180<=angle<=180 or not isfinite(hypot(*up.values())) or hypot(*up.values())<=1e-6:return False
+ positions=[camera['pose']['position']]+[k['value'] for k in camera['channels']['position']]
+ targets=[camera['pose']['target']]+[k['value'] for k in camera['channels']['target']]
+ for other in camera.get('moveClips',()):
+ if other['presetId']=='roll':continue
+ if other['presetId'] in ORBITS|ANGULAR:
+ oriented={**camera,'channels':{**camera['channels'],'up':[dict(value=up)]}}
+ if not (safe_angular_geometry(oriented,other) if other['presetId'] in ANGULAR else safe_spiral_orientation(oriented,other)):return False
+ continue
+ end=endpoint(other)
+ if end is None:return False
+ positions.extend((other['startingPose']['position'],end['position']));targets.extend((other['startingPose']['target'],end['target']))
+ axes=('x','y','z')
+ def bounds(values,project):
+ projected=[project(v) for v in values]
+ return min(projected),max(projected)
+ pb=[bounds(positions,lambda v,a=a:v[a]) for a in axes]
+ tb=[bounds(targets,lambda v,a=a:v[a]) for a in axes]
+ if any(not isfinite(hi-lo) for lo,hi in pb+tb):return False
+ view_bounds=[max(abs(tlo-phi),abs(thi-plo)) for (plo,phi),(tlo,thi) in zip(pb,tb)]
+ if not isfinite(hypot(*view_bounds)):return False
+ # Linear extrema factor across independent channels, without a key product.
+ projections=(lambda v:v['y']*up['z']-v['z']*up['y'],lambda v:v['z']*up['x']-v['x']*up['z'],lambda v:v['x']*up['y']-v['y']*up['x'])
+ for project in projections:
+ plo,phi=bounds(positions,project);tlo,thi=bounds(targets,project)
+ lo,hi=tlo-phi,thi-plo
+ if isfinite(lo) and isfinite(hi) and (lo>1e-6 or hi< -1e-6):return True
+ return False
+
+
+def eased_progress(clip,time):
+ p=max(0,min(1,(time-clip['start'])/clip['duration']))
+ transition=clip.get('easing',{})
+ if 0 < p < 1 and transition.get('kind')=='bezier':
+ x1,y1,x2,y2=transition['controlPoints']
+ def cubic(a,b,t):return 3*(1-t)*(1-t)*t*a+3*(1-t)*t*t*b+t*t*t
+ low,high=0,1
+ for _ in range(40):
+ mid=(low+high)/2
+ if cubic(x1,x2,mid)1e-6 for k in ('x','y','z')):return False
+ depth=hypot(*(a[k]-p['position'][k] for k in ('x','y','z')));remaining=depth-clip['parameters']['distance']
+ scale=max(1,*(abs(v) for point in (a,p['position']) for v in point.values()))
+ if not all(isfinite(v) for v in (depth,remaining)) or min(depth,remaining)<=1e-6+64*2.220446049250313e-16*scale or abs(clip['parameters']['distance'])<=64*2.220446049250313e-16*(scale+abs(clip['parameters']['distance'])):return False
+ end=dolly_pose(clip,1)
+ return all(isfinite(v) for v in end['position'].values()) and isfinite(end['fov']) and 1<=end['fov']<=179
+
+
+def safe_dolly_orientation(camera,clip):
+ p=clip['startingPose'];f=[p['target'][k]-p['position'][k] for k in ('x','y','z')];length=hypot(*f);f=[v/length for v in f]
+ ups=[[k['value'][axis] for axis in ('x','y','z')] for k in camera['channels']['up']] or [[0,1,0]]
+ if any(not isfinite(hypot(*u)) for u in ups):return False
+ max_norm=max(hypot(*u) for u in ups)
+ if max_norm<=1e-6:return False
+ ups=[[v/max_norm for v in u] for u in ups]
+ cross=[[f[1]*u[2]-f[2]*u[1],f[2]*u[0]-f[0]*u[2],f[0]*u[1]-f[1]*u[0]] for u in ups]
+ return any(all(isfinite(c[k]) and c[k]>1e-6 for c in cross) or all(isfinite(c[k]) and c[k]<-1e-6 for c in cross) for k in range(3))
+
+
+def finite_vector_interpolation(camera):
+ """Finite key values can still overflow the shared right-left interpolation.
+
+ Check all sampled vector channels once, before recipe-specific proofs.
+ """
+ return all(isfinite(right['value'][axis]-left['value'][axis]) for channel in ('position','target','up') for left,right in zip(camera['channels'][channel],camera['channels'][channel][1:]) for axis in ('x','y','z'))
+
+
+def values_equal(channel, left, right, tolerance=1e-6):
+ if channel=='up':
+ norms=[hypot(*value.values()) for value in (left,right)]
+ if any(not isfinite(n) or n<=1e-6 for n in norms):return False
+ return all(abs(left[a]/norms[0]-right[a]/norms[1])<=tolerance for a in ('x','y','z'))
+ return abs(left-right)<=tolerance if channel=='focalLength' else all(abs(left[a]-right[a])<=tolerance for a in ('x','y','z'))
+
+
+# Per-component world metres, vertical FOV degrees, normalized-up components.
+# Renderer fixture and scope: docs/guides/camera-moves.md.
+SEAM_TOLERANCE = 1e-6
+
+
+def manual_resume_time(camera, clip, channel):
+ keys = camera['channels'][channel]
+ explicit = next((k['time'] for k in keys if k['time'] >= clip['start'] + clip['duration'] and k.get('manualBoundary')), float('inf'))
+ return min(explicit, next((left['time'] for left, right in zip(keys, keys[1:])
+ if left['time'] >= clip['start'] + clip['duration']
+ and (not values_equal(channel, left['value'], right['value'], tolerance=0) if channel=='up' else left['value']!=right['value'])), float('inf')))
+
+
+def seam_details(camera):
+ """Disclose stored start joins, including relative sightlines and manual anchors."""
+ details = []
+ clips = sorted(camera.get('moveClips', ()), key=lambda c: c['start'])
+ if any(primitive_issue(c) for c in clips): return []
+ for index, clip in enumerate(clips):
+ if primitive_issue(clip):
+ continue
+ before = {**camera, 'moveClips': [c for c in clips if c['start'] < clip['start']]}
+ pose = effective_pose(before, clip['start'])
+ aligned = {**clip, 'startingPose': {**clip['startingPose']}, 'parameters': {**clip['parameters']}}
+ for channel in controlled_channels(clip):
+ field = 'fov' if channel == 'focalLength' else channel
+ actual = clip['parameters']['baselineUp'] if channel == 'up' else clip['startingPose'][field]
+ expected = effective_up(before, clip['start']) if channel == 'up' else pose[field]
+ if channel == 'target' and relative_angular_join(clip, index > 0):
+ expected = {a: clip['startingPose']['position'][a] + pose['target'][a] - pose['position'][a] for a in ('x','y','z')}
+ if not values_equal(channel, actual, expected):
+ details.append(dict(clipId=clip['id'], time=clip['start'], channel=channel,
+ kind='starting_composition', actual=actual, expected=expected, tolerance=SEAM_TOLERANCE))
+ if channel == 'up': aligned['parameters']['baselineUp'] = expected
+ else: aligned['startingPose'][field] = expected
+ if clip['presetId'] == 'dolly-zoom':
+ aligned['parameters']['anchor'] = aligned['startingPose']['target']
+ for channel in controlled_channels(clip):
+ resume = manual_resume_time(camera, clip, channel)
+ if not isfinite(resume) or any(k['time']==resume and k.get('manualBoundary') for k in camera['channels'][channel]) or any(c['start']>clip['start'] and c['start']<=resume and channel in controlled_channels(c) for c in clips): continue
+ held_camera = {**camera, 'channels': {**camera['channels'], channel: []}}
+ expected = effective_up(held_camera,resume) if channel=='up' else effective_pose(held_camera,resume)['fov' if channel=='focalLength' else channel]
+ actual = sample_channel(camera,channel,resume)
+ if not values_equal(channel, actual, expected):
+ details.append(dict(clipId=clip['id'],time=resume,channel=channel,kind='manual_anchor',actual=actual,expected=expected,tolerance=SEAM_TOLERANCE,alignedClip=None))
+ # Only this recipe is offered. Neighbors and manual curves are never rewritten.
+ for detail in details:
+ if detail['clipId'] == clip['id'] and detail['kind']=='starting_composition': detail['alignedClip'] = aligned
+ return details
+
+
+def animation_impact(camera, clip, duration):
+ """Disclose complete interpolation segments and the move's endpoint hold.
+
+ Keeping the original left bounding key (including its outgoing transition)
+ makes samples strictly before that key identical. No partial Bezier is split.
+ """
+ channels=[]; start=clip['start']; reasons=set(); ranges={}
+ for channel in controlled_channels(clip):
+ keys=camera['channels'][channel]
+ anchor=sample_channel(camera,channel,clip['start']) if channel=='up' else None
+ resume = manual_resume_time(camera, clip, channel)
+ mismatch = False
+ if isfinite(resume) and not any(k['time']==resume and k.get('manualBoundary') for k in camera['channels'][channel]) and primitive_issue(clip) is None and not any(c['id']!=clip['id'] and c['start']>clip['start'] and c['start']<=resume and channel in controlled_channels(c) for c in camera.get('moveClips',())):
+ held_camera = {**camera, 'moveClips': [c for c in camera.get('moveClips',()) if c['id']!=clip['id']] + [clip], 'channels': {**camera['channels'], channel: []}}
+ held = effective_up(held_camera,resume) if channel=='up' else effective_pose(held_camera,resume)['fov' if channel=='focalLength' else channel]
+ mismatch = not values_equal(channel,held,sample_channel(camera,channel,resume))
+ affected=[(left,right) for left,right in zip(keys,keys[1:])
+ if not right.get('holdIncoming') and right['time']>clip['start'] and left['time']=resume)
+ and ((not values_equal(channel,left['value'],anchor) or not values_equal(channel,right['value'],anchor)) if channel=='up' else left['value']!=right['value'])]
+ if affected:
+ channels.append(channel)
+ boundary=max(0,min(clip['start'],*(left['time'] for left,right in affected)))
+ desired=clip['parameters'].get('baselineUp') if channel=='up' else clip['startingPose']['fov' if channel=='focalLength' else channel]
+ if boundary==clip['start'] and desired!=sample_channel(camera,channel,clip['start']):
+ earlier=[key['time'] for key in keys if key['time'] start and channel in controlled_channels(c)]
+ end = min(duration, manual_resume_time(original, clip, channel), *following)
+ def value(time):
+ if channel == 'up':
+ actual=effective_up(original,time)
+ norm=hypot(*actual.values())
+ manual=sample_channel(original,channel,time)
+ magnitude=hypot(*manual.values())
+ if not isfinite(magnitude) or magnitude<=1e-6:magnitude=1
+ # Up magnitude has no orientation meaning. Retaining it keeps
+ # authentic incoming manual interpolation unchanged at joins.
+ if values_equal(channel,actual,manual,tolerance=1e-12):return deepcopy(manual)
+ return {a:actual[a]/norm*magnitude for a in ('x','y','z')}
+ return deepcopy(effective_pose(original,time)['fov' if channel == 'focalLength' else channel])
+ def error(actual,left,right,p):
+ if channel == 'focalLength':return abs(actual-(left+(right-left)*p))
+ mixed={a:left[a]+(right[a]-left[a])*p for a in ('x','y','z')}
+ if channel == 'up':
+ na,nb=hypot(*actual.values()),hypot(*mixed.values())
+ if nb<=1e-6:return float('inf')
+ return max(abs(actual[a]/na-mixed[a]/nb) for a in ('x','y','z'))
+ return max(abs(actual[a]-mixed[a]) for a in ('x','y','z'))
+ tolerance=1e-7 if channel=='up' else 1e-5
+ samples={start:value(start),end:value(end)}
+ times={start,end, min(end,start+clip['duration'])}
+ times.update(k['time'] for keys in original['channels'].values() for k in keys if start100000:
+ raise ContractError('camera_move_conversion_precision',CAMERA_MOVE_MESSAGES['camera_move_conversion_precision'][0])
+ if max(error(v,a,b,p) for time,p,v in values)<=tolerance:return
+ if depth>=22:
+ raise ContractError('camera_move_conversion_precision',CAMERA_MOVE_MESSAGES['camera_move_conversion_precision'][0])
+ mid,_,v=values[1];samples[mid]=v
+ refine(left,mid,depth+1);refine(mid,right,depth+1)
+ seed=sorted(samples)
+ for left,right in zip(seed,seed[1:]):refine(left,right)
+ keys=[deepcopy(k) for k in original['channels'][channel] if k['time']end]
+ # Preserve first-key backward extrapolation when the recipe was the
+ # first authored channel input; zero is an ordinary baseline anchor.
+ if start>0 and not any(k['time'] list[tuple[str, UUID]]:
payload = self.payload
required = []
- if self.type in {'project.rename', 'project.trash', 'project.restore'}:
+ if self.type == 'creation.batch':
+ created = {op.payload.document.id for op in payload.operations if op.type == 'editor.create'}
+ required = list(dict.fromkeys(
+ ('editor_document', op.payload.documentId) for op in payload.operations
+ if op.type in {'director.cameraMove.put', 'director.cameraMove.retime', 'director.cameraMove.delete', 'director.cameraMove.convert', 'director.storyboard.reorder', 'director.storyboard.resize', 'director.storyboard.delete', 'director.camera.delete', 'director.duration.set'}
+ and op.payload.documentId not in created))
+ elif self.type in {'project.rename', 'project.trash', 'project.restore'}:
required = [('project', self.projectId)]
elif self.type in {'group.saveRunPlan', 'group.publishRun'}:
required = [('canvas_item', payload.groupId)]
elif self.type == 'canvas.publishMedia':
required = [('canvas_item', payload.itemId), *[('asset', o.asset.assetId) for o in payload.outputs]]
- if payload.sourceEditorId:
+ if payload.sourceEditorId and not (payload.directorPlan and payload.directorAcceptedAt):
required.append(('editor_document', payload.sourceEditorId))
elif self.type in {'canvas.applyEdit', 'timeline.publishRender'}:
required = [('canvas_item', payload.itemId), ('asset', payload.asset.assetId), ('editor_document', payload.editorId)]
@@ -478,6 +610,10 @@ def required_versions(self) -> list[tuple[str, UUID]]:
required = [('generation_spec', payload.specId)]
elif self.type == 'editor.save':
required = [('editor_document', payload.document.id)]
+ elif self.type == 'director.apply':
+ required = [('editor_document', payload.document.id)]
+ elif self.type in {'director.cameraMove.put', 'director.cameraMove.retime', 'director.cameraMove.delete', 'director.cameraMove.convert', 'director.storyboard.append', 'director.storyboard.reorder', 'director.storyboard.resize', 'director.storyboard.delete', 'director.camera.delete', 'director.duration.set'}:
+ required = [('editor_document', payload.documentId)]
return required
def parse_required_versions(self) -> list[tuple[str, UUID]]:
@@ -550,6 +686,17 @@ def missing_versions_message(self, supplied) -> str:
('ResultSelectCommand', 'result.select', ResultSelect, 'Adopt an existing generation result.'),
('EditorCreateCommand', 'editor.create', EditorWrite, 'Create an editable document.'),
('EditorSaveCommand', 'editor.save', EditorWrite, 'Save an editable document.'),
+ ('DirectorCameraMovePutCommand', 'director.cameraMove.put', DirectorCameraMovePut, 'Create or update an editable camera movement by stable ID on an explicitly named camera.'),
+ ('DirectorCameraMoveRetimeCommand', 'director.cameraMove.retime', DirectorCameraMoveRetime, 'Move or stretch the complete normalized camera path without trimming or rippling other content.'),
+ ('DirectorCameraMoveConvertCommand', 'director.cameraMove.convert', DirectorCameraMoveConvert, 'Atomically convert a recipe to ordinary editable keys on owned channels, preserving sampled motion and boundary holds; undo restores the same recipe identity.'),
+ ('DirectorCameraMoveDeleteCommand', 'director.cameraMove.delete', DirectorCameraMoveDelete, 'Delete one movement and its derived influence; undo restores the recipe.'),
+ ('DirectorApplyCommand', 'director.apply', DirectorApply, 'Apply an authoritative Director Stage document atomically.'),
+ ('DirectorStoryboardAppendCommand', 'director.storyboard.append', DirectorStoryboardAppend, 'Append an existing camera to the end of the continuous Director Stage Storyboard.'),
+ ('DirectorStoryboardReorderCommand', 'director.storyboard.reorder', DirectorStoryboardReorder, 'Reorder the continuous Storyboard by block ID, preserving durations and camera references.'),
+ ('DirectorStoryboardResizeCommand', 'director.storyboard.resize', DirectorStoryboardResize, 'Resize the given block and shift all subsequent blocks, preserving their durations.'),
+ ('DirectorStoryboardDeleteCommand', 'director.storyboard.delete', DirectorStoryboardDelete, 'Delete a Storyboard block and shift later blocks without changing their durations.'),
+ ('DirectorSetDurationCommand', 'director.duration.set', DirectorSetDuration, 'Set the Director Stage main timeline duration, preserving the Storyboard and animation.'),
+ ('DirectorCameraDeleteCommand', 'director.camera.delete', DirectorCameraDelete, 'Delete a non-final Director Stage camera and its Storyboard blocks atomically.'),
('HistoryUndoCommand', 'history.undo', HistoryReplay, 'Undo a recorded reversible command.'),
('HistoryRedoCommand', 'history.redo', HistoryReplay, 'Reapply an undone command.'),
)
@@ -562,7 +709,8 @@ def missing_versions_message(self, supplied) -> str:
_BATCH_TYPES = {'canvas.createGeneration', 'canvas.show', 'canvas.move', 'canvas.update', 'canvas.layoutRuns', 'canvas.layoutPipelines', 'canvas.hide', 'canvas.materialize', 'canvas.applyEdit',
'canvas.configure', 'canvas.attachEditor', 'canvas.detachEditor', 'generationSpec.create', 'generationSpec.update',
- 'reference.add', 'reference.update', 'reference.restore', 'reference.remove', 'editor.create', 'editor.save', 'result.select', 'generationSpec.setPrompt'}
+ 'reference.add', 'reference.update', 'reference.restore', 'reference.remove', 'editor.create', 'editor.save', 'director.apply', 'director.cameraMove.put', 'director.cameraMove.retime', 'director.cameraMove.delete', 'director.cameraMove.convert', 'director.storyboard.reorder', 'director.storyboard.resize', 'director.storyboard.delete', 'director.camera.delete', 'director.duration.set',
+ 'result.select', 'generationSpec.setPrompt'}
_OPERATIONS = tuple(create_model(name + 'Operation', __base__=Contract,
__doc__=description, type=(Literal[kind], Field(description='Operation discriminator.')),
payload=(payload, Field(description=description)))
@@ -594,7 +742,9 @@ def command_fingerprint(command: Command) -> str:
from opendirector.domain.timeline_errors import TimelineIssueCode
-IssueCode = Literal[TimelineIssueCode, 'invalid_input', 'revision_conflict', 'version_required', 'role_restricted', 'canvas_run_layout_group', 'canvas_run_layout_conflict', 'canvas_run_layout_extent', 'canvas_run_layout_shared_object', 'missing_object', 'reference_invalid', 'image_quality_unsupported',
+from opendirector.domain.camera_move_errors import CameraMoveIssueCode
+
+IssueCode = Literal[CameraMoveIssueCode, TimelineIssueCode, StoryboardIssueCode, 'invalid_input', 'revision_conflict', 'version_required', 'role_restricted', 'canvas_run_layout_group', 'canvas_run_layout_conflict', 'canvas_run_layout_extent', 'canvas_run_layout_shared_object', 'missing_object', 'reference_invalid', 'image_quality_unsupported',
'keyframe_unsupported', 'keyframe_mode', 'keyframe_kind', 'keyframe_count', 'keyframe_needs_reference', 'keyframe_time', 'keyframe_image',
'bigmodel_video_model', 'bigmodel_video_output', 'bigmodel_video_image',
'bigmodel_video_frames', 'bigmodel_video_prompt', 'bigmodel_video_cancel',
@@ -618,7 +768,15 @@ def command_fingerprint(command: Command) -> str:
'voice_name_taken', 'voice_provider_quota']
+class CameraMoveConflictIdentity(Contract):
+ cameraId: str = Field(description='Stable camera identity owning the invalid movement.')
+ clipId: str = Field(description='Stable invalid movement identity.')
+
+
class ContractIssue(Contract):
+ cameraMoveConflicts: tuple[CameraMoveConflictIdentity, ...] = Field(default=(),
+ exclude_if=lambda value: not value,
+ description='All invalid movement identities for a timing rejection; no movement was altered.')
code: IssueCode = Field(description='Stable error or issue code.')
message: str = Field(min_length=1, max_length=500, description='Human-readable issue description.')
objectId: UUID | None = Field(default=None, description='Target business object ID.')
@@ -642,6 +800,8 @@ class CommandReceipt(Contract):
changed: tuple[ObjectVersion, ...] = Field(default=(), description='Business objects changed by the operation.')
jobIds: tuple[UUID, ...] = Field(default=(), description='Generation jobs associated with this operation.')
issues: tuple[ContractIssue, ...] = Field(default=(), description='Validation or execution issues.')
+ directorDurations: tuple[DirectorDurationResult, ...] = Field(default=(), exclude_if=lambda value: not value, description='Director main timeline results in operation order.')
+ directorStoryboard: tuple[DirectorStoryboardResult, ...] = Field(default=(), exclude_if=lambda value: not value, description='Storyboard outcomes in command operation order.')
eventCursor: int | None = Field(default=None, strict=True, ge=0, description='Latest committed project event cursor.')
canvasPlacements: tuple[CanvasPlacementReceipt, ...] = Field(default=(), exclude_if=lambda value: not value,
description='Final persisted geometry for explicit canvas placement operations.')
@@ -651,7 +811,7 @@ class CommandReceipt(Contract):
@model_validator(mode='after')
def outcome(self):
unique(self.jobIds, 'receipt job IDs')
- if self.status == 'rejected' and (self.changed or self.jobIds or not self.issues):
+ if self.status == 'rejected' and (self.changed or self.jobIds or self.directorStoryboard or not self.issues):
raise ValueError('Rejected commands need issues and cannot claim changes')
if self.status == 'accepted' and not self.jobIds:
raise ValueError('Accepted background work needs a task receipt')
@@ -712,6 +872,28 @@ class AssetPreviewQuery(QueryBase):
objectId: UUID = Field(description='Asset ID.')
+class DirectorCameraMovePresetsQuery(QueryBase):
+ type: Literal['director.cameraMove.presets'] = Field(description='Discover versioned camera-move presets, parameters, units and channel ownership without editing the project.')
+
+
+class DirectorCameraMovePreviewQuery(QueryBase):
+ type: Literal['director.cameraMove.preview'] = Field(description='Validate a complete recipe without a write or session switch. Returns per-channel seams (clipId, time, actual, expected, tolerance) and explicit alignedClip proposals. Apply a selected proposal with put; edit and explicitly align multiple recipes atomically with editor.save and expectedVersions. Manual-anchor seams never rewrite curves.')
+ objectId: UUID = Field(description='Director Stage document ID.')
+ cameraId: Identifier = Field(description='Explicit destination camera.')
+ clip: CameraMoveClip = Field(description='Proposed new recipe or replacement of the same clip ID.')
+ applyStartingComposition: bool = Field(default=False, description='Preview the explicit static baseline adjustment with the movement, without writing.')
+
+
+class DirectorCameraMovesQuery(QueryBase):
+ type: Literal['director.cameraMove.get'] = Field(description='Read persisted camera movement recipes and their explicit owning cameras.')
+ objectId: UUID = Field(description='Director Stage document ID.')
+
+
+class DirectorStoryboardQuery(QueryBase):
+ type: Literal['director.storyboard.get'] = Field(description='Read the stored Director Stage Storyboard and whether a block can be appended.')
+ objectId: UUID = Field(description='Director Stage document ID.')
+
+
class ReceiptQuery(QueryBase):
type: Literal['receipt.get'] = Field(description='Read the persisted receipt for a command ID or current-turn operation ID.')
objectId: UUID = Field(description='Command ID or operation ID to inspect.')
@@ -737,7 +919,7 @@ class PipelineExecutionsQuery(QueryBase):
Query = Annotated[ProjectQuery | ObjectQuery | VersionsQuery | AssetSearchQuery | AssetUsageQuery |
- CanvasStatusQuery | JobStatusQuery | AssetPreviewQuery | ReceiptQuery | PipelinePlanQuery |
+ CanvasStatusQuery | JobStatusQuery | AssetPreviewQuery | DirectorCameraMovePresetsQuery | DirectorCameraMovesQuery | DirectorCameraMovePreviewQuery | DirectorStoryboardQuery | ReceiptQuery | PipelinePlanQuery |
PipelineExecutionQuery | PipelineExecutionsQuery, Field(discriminator='type')]
diff --git a/packages/core/src/opendirector/domain/creation/director_output.py b/packages/core/src/opendirector/domain/creation/director_output.py
new file mode 100644
index 000000000..b035fe74e
--- /dev/null
+++ b/packages/core/src/opendirector/domain/creation/director_output.py
@@ -0,0 +1,31 @@
+"""Fixed Director render inputs recorded with the published asset."""
+from typing import Literal
+from uuid import UUID
+
+from pydantic import Field, model_validator
+
+from .base import Contract, Identifier, Positive, PositiveInt, Revision
+
+
+class DirectorOutputPlan(Contract):
+ cameraSource: Literal['camera', 'storyboard'] = Field(description='Camera selection strategy fixed for this render.')
+ cameraId: Identifier | None = Field(default=None, description='Camera rig fixed for a camera render; omitted for storyboard renders.')
+ width: PositiveInt = Field(description='Expected output width in pixels.')
+ height: PositiveInt = Field(description='Expected output height in pixels.')
+ durationSeconds: Positive = Field(description='Expected output duration in seconds.')
+ frameRate: Positive = Field(description='Expected output frames per second.')
+
+ @model_validator(mode='after')
+ def camera_selection(self):
+ if self.cameraSource == 'camera' and self.cameraId is None:
+ raise ValueError('Camera renders require a camera ID. 相机渲染需要相机 ID。')
+ if self.cameraSource == 'storyboard' and self.cameraId is not None:
+ raise ValueError('Storyboard renders cannot select a camera ID. 分镜渲染不能选择相机 ID。')
+ return self
+
+
+class DirectorRenderEvidence(Contract):
+ acceptedProjectCursor: PositiveInt = Field(description='Event cursor of the accepted project snapshot.')
+ sourceEditorId: UUID = Field(description='Editable Director Stage document fixed at acceptance.')
+ sourceEditorRevision: Revision = Field(description='Source stage revision fixed at acceptance.')
+ plan: DirectorOutputPlan = Field(description='The accepted camera strategy, output size, duration and frame rate.')
diff --git a/packages/core/src/opendirector/domain/creation/editors.py b/packages/core/src/opendirector/domain/creation/editors.py
index b97343050..54aaf4167 100644
--- a/packages/core/src/opendirector/domain/creation/editors.py
+++ b/packages/core/src/opendirector/domain/creation/editors.py
@@ -1,9 +1,10 @@
"""Typed retained editors. AssetRef replaces transient src/data/blob URLs."""
from math import ceil, floor, isfinite
+import re
from typing import Annotated, Literal
from uuid import UUID
-from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator, model_validator
+from pydantic import ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator, model_validator
from opendirector.domain.rule_facts import (
TIMELINE_FONT_LIMIT, TIMELINE_OVERLAY_LIMIT, TIMELINE_TEXT_MAX_LENGTH, TIMELINE_TEXT_TOTAL_LENGTH,
@@ -12,7 +13,7 @@
from .assets import AssetRef
from .base import Contract, Identifier, NonNegative, Number, Point, Positive, PositiveInt, ProjectEntity, unique
-Color = Annotated[str, Field(pattern=r'^#[0-9a-fA-F]{6}$')]
+Color = Annotated[str, Field(pattern=r'^#[0-9a-fA-F]{6}$', examples=['#000000'])]
Unit = Annotated[float, Field(strict=True, ge=0, le=1)]
@@ -357,10 +358,23 @@ def positive_scale(self):
return self
+class StageBezierTransition(Contract):
+ kind: Literal['bezier'] = Field(description='Cubic Bezier interpolation for the outgoing segment.')
+ controlPoints: tuple[Unit, Unit, Unit, Unit] = Field(description='Normalized x1, y1, x2 and y2 control points.')
+
+
+class StageTransformTransitions(Contract):
+ position: StageBezierTransition | None = Field(default=None, description='Outgoing position interpolation.')
+ rotation: StageBezierTransition | None = Field(default=None, description='Outgoing rotation interpolation.')
+ scale: StageBezierTransition | None = Field(default=None, description='Outgoing scale interpolation.')
+
+
class TransformFrame(Contract):
id: Identifier = Field(description='Stable object ID.')
time: NonNegative = Field(description='Keyframe time in seconds.')
value: StageTransform = Field(description='Keyframed transform or camera pose.')
+ keyedChannels: tuple[Literal['position', 'rotation', 'scale'], ...] | None = Field(default=None, description='Transform properties explicitly keyed at this frame.')
+ transitions: StageTransformTransitions | None = Field(default=None, description='Per-property interpolation for the outgoing segment.')
class StageMotion(Contract):
@@ -378,17 +392,68 @@ class MotionClip(Contract):
class StageObject(StageTransform):
id: Identifier = Field(description='Stable object ID.')
- kind: Literal['person', 'box', 'sphere'] = Field(description='Business object or media type.')
+ kind: Literal['person', 'box', 'sphere', 'gltf', 'cylinder', 'cone', 'pyramid', 'torus', 'plane', 'capsule', 'disk', 'arc', 'halfCylinder'] = Field(description='Business object or media type.')
name: str = Field(max_length=255, description='User-visible name.')
color: Color = Field(description='Serialized display color.')
+ visible: StrictBool = Field(default=True, description='Whether this object is displayed.')
+ locked: StrictBool = Field(default=False, description='Whether edits to this object are blocked.')
+ opacity: Unit = Field(default=1, description='Layer opacity from zero to one.')
keyframes: tuple[TransformFrame, ...] = Field(default=(), description='Ordered animation keyframes.')
motionClips: tuple[MotionClip, ...] = Field(default=(), description='Ordered procedural motion intervals.')
+ asset: AssetRef | None = Field(default=None, description='Registered GLB or self-contained GLTF asset for an imported stage object.')
+ thumbnailAsset: AssetRef | None = Field(default=None, description='Registered image asset used by the stage object card thumbnail.')
+ role: Literal['character', 'scene'] | None = Field(default=None, description='Imported stage object role.')
+ format: Literal['glb', 'gltf'] | None = Field(default=None, description='Imported stage asset container format.')
+ animationNames: tuple[str, ...] = Field(default=(), description='Animation clip names discovered in the imported asset.')
+ hasAnimation: bool = Field(default=False, description='Whether the imported asset contains animation clips.')
+
+ @model_validator(mode='after')
+ def imported_asset(self):
+ imported_fields = (self.asset, self.role, self.format)
+ if self.animationNames and any(not name.strip() for name in self.animationNames):
+ raise ValueError('Imported animation names cannot be blank. 导入的动画名称不能为空。')
+ if self.kind == 'gltf':
+ if self.asset is None or self.role is None or self.format is None:
+ raise ValueError(
+ 'Imported stage objects require a registered asset, role and format. '
+ '导入的舞台对象需要已注册的素材、角色和格式。'
+ )
+ if self.asset.kind != 'file':
+ raise ValueError('Imported stage assets must be file assets. 导入的舞台素材必须是文件素材。')
+ if self.role == 'scene' and self.motionClips:
+ raise ValueError('Scene assets cannot have character motion clips. 场景素材不能携带角色动作片段。')
+ if not self.hasAnimation and self.motionClips:
+ raise ValueError(
+ 'Imported characters without animation cannot have motion clips. '
+ '没有动画数据的导入人物不能携带动作片段。'
+ )
+ if self.hasAnimation != bool(self.animationNames):
+ raise ValueError(
+ 'Imported animation metadata must match animation names. '
+ '导入的动画信息必须与动画名称一致。'
+ )
+ elif any(value is not None for value in imported_fields) or self.animationNames or self.hasAnimation:
+ raise ValueError(
+ 'Procedural stage objects cannot carry imported asset metadata. '
+ '非导入的舞台对象不能携带导入素材信息。'
+ )
+ if self.thumbnailAsset is not None and self.thumbnailAsset.kind != 'image':
+ raise ValueError('Stage thumbnails must be image assets. 舞台缩略图必须是图片素材。')
+ return self
class StageCamera(Contract):
+ model_config = ConfigDict(json_schema_extra={'examples': [{
+ 'position': {'x': 0, 'y': 0, 'z': 1},
+ 'target': {'x': 0, 'y': 0, 'z': 0},
+ 'fov': 45,
+ 'roll': 0,
+ }]})
+
position: Vector3 = Field(description='Position in the owning canvas or stage.')
target: Vector3 = Field(description='Camera look-at position.')
fov: Annotated[float, Field(strict=True, gt=0, lt=180)] = Field(description='Camera vertical field of view in degrees.')
+ roll: Annotated[float, Field(strict=True, ge=-3.141592653589793, le=3.141592653589793)] = Field(default=0.0, description='Roll around the view axis in radians.')
@model_validator(mode='after')
def direction(self):
@@ -403,11 +468,93 @@ class CameraFrame(Contract):
value: StageCamera = Field(description='Keyframed transform or camera pose.')
+class CameraVectorFrame(Contract):
+ id: Identifier = Field(description='Stable channel keyframe ID.')
+ time: NonNegative = Field(description='Keyframe time in seconds.')
+ value: Vector3 = Field(description='Keyframed camera vector.')
+ holdIncoming: StrictBool = Field(default=False, exclude_if=lambda v: not v, description="Hold the preceding ordinary key until this timestamp, instead of interpolating toward this key. Explicitly authored incoming step; independent of movement ownership.")
+ manualBoundary: StrictBool = Field(default=False, exclude_if=lambda v: not v, description='Explicit ordinary-key ownership boundary: earlier movement holds yield at this timestamp, including constant segments. Does not retain a movement recipe.')
+ transition: StageBezierTransition | None = Field(default=None, description='Interpolation for the outgoing segment.')
+
+
+class CameraNumberFrame(Contract):
+ id: Identifier = Field(description='Stable channel keyframe ID.')
+ time: NonNegative = Field(description='Keyframe time in seconds.')
+ value: Annotated[float, Field(strict=True, gt=0)] = Field(description='Keyframed camera vertical field of view in degrees; historical channel name is focalLength, not millimetres.')
+ holdIncoming: StrictBool = Field(default=False, exclude_if=lambda v: not v, description="Hold the preceding ordinary key until this timestamp, instead of interpolating toward this key. Explicitly authored incoming step; independent of movement ownership.")
+ manualBoundary: StrictBool = Field(default=False, exclude_if=lambda v: not v, description='Explicit ordinary-key ownership boundary: earlier movement holds yield at this timestamp, including constant segments. Does not retain a movement recipe.')
+ transition: StageBezierTransition | None = Field(default=None, description='Interpolation for the outgoing segment.')
+
+
+class CameraChannels(Contract):
+ position: tuple[CameraVectorFrame, ...] = Field(default=(), description='Independent camera position channel.')
+ target: tuple[CameraVectorFrame, ...] = Field(default=(), description='Independent camera target channel.')
+ up: tuple[CameraVectorFrame, ...] = Field(default=(), description='Independent camera up-vector channel.')
+ focalLength: tuple[CameraNumberFrame, ...] = Field(default=(), description='Independent vertical field-of-view channel in degrees; historical name focalLength does not mean millimetres.')
+
+
+class CameraMoveParameters(Contract):
+ anchor: Vector3 | None = Field(default=None, exclude_if=lambda value: value is None, description="Required dolly-zoom fixed world framing anchor in metres, equal to captured starting target. Owns position, target and focalLength (vertical FOV degrees). Positive distance moves toward anchor, negative away; lens stays within 1–179 degrees throughout. No subject tracking.")
+ angle: Annotated[float, Field(strict=True, ge=-180, le=180)] | None = Field(default=None, exclude_if=lambda value: value is None, description="Required signed roll angle −180–180, additive to static rig roll; positive rotates about camera backward. Required pan/tilt angle in degrees: pan .1–180, tilt .1–89. Pan left/right rotates the sightline about world Y; tilt rotates about captured horizontal camera-right. Only target is owned, evaluated relative to independently sampled position.")
+ baselineUp: Vector3 | None = Field(default=None, exclude_if=lambda value: value is None, description="Required roll captured baseline up vector before static rig roll; immutable during timing edits. Roll owns up only and rotates about the effective sampled backward view axis.")
+ tiltDirection: Literal["up", "down"] | None = Field(default=None, exclude_if=lambda value: value is None, description="Required tilt direction; up rotates the opening sightline toward world +Y, down toward -Y. Singular up/view paths reject.")
+ height: Annotated[float, Field(strict=True, ge=.001, le=10000)] | None = Field(default=None, exclude_if=lambda value: value is None, description="Required spiral-rise height in metres. Camera and captured target rise equally along world Y; fixed center does not rise. No subject tracking.")
+ center: Vector3 | None = Field(default=None, exclude_if=lambda value: value is None, description="Required fixed world-space orbit center in metres; capture starting target by default.")
+ orbitDirection: Literal["clockwise", "counterclockwise"] | None = Field(default=None, exclude_if=lambda value: value is None, description="World Y rotation: clockwise moves +Z toward +X, viewed from +Y.")
+ sweep: Annotated[float, Field(strict=True, ge=.1, le=360)] | None = Field(default=None, exclude_if=lambda value: value is None, description="Required orbit sweep in degrees; half-arc requires exactly 180. Position and target rotate together, preserving opening composition.")
+ distance: Annotated[float, Field(strict=True, ge=-10000, le=10000)] = Field(default=1, description='Resolved travel in metres: dolly-zoom requires signed distance with absolute value .001–10000, positive toward anchor and negative away. Other distance presets require positive .001–10000.')
+ direction: Literal['left', 'right'] | None = Field(default=None, exclude_if=lambda value: value is None, description='Lateral direction relative to the horizontal opening sightline; required for lateral moves.')
+ viewingPolicy: Literal['fixed-target', 'parallel-sightline'] | None = Field(default=None, exclude_if=lambda value: value is None, description='Required for translations: hold the captured world target or translate both camera and target.')
+
+
+class CameraMoveLinear(Contract):
+ kind: Literal['linear'] = Field(default='linear', description='Constant progress.')
+
+
+class CameraMoveClip(Contract):
+ id: Identifier = Field(description='Stable movement identity, retained through edits and history.')
+ name: str = Field(default='', max_length=255, description='Optional user name; otherwise use localized preset name.')
+ presetId: str = Field(description='Versioned preset ID: push-in, pull-out, lateral, rise, descend, orbit, half-arc, spiral-rise, pan-left, pan-right, tilt, roll, dolly-zoom. Unknown IDs reject on write.')
+ algorithmVersion: Annotated[int, Field(strict=True, ge=1)] = Field(default=1, description='Sampling algorithm version; currently 1.')
+ start: Number = Field(description='Absolute start in seconds, normalized at the application boundary.')
+ duration: Number = Field(description='Complete path duration in seconds; at least one stage frame.')
+ startingPose: StageCamera = Field(description='Explicit starting composition; timing edits do not resample it.')
+ parameters: CameraMoveParameters = Field(default_factory=CameraMoveParameters, description='Resolved path parameters.')
+ easing: CameraMoveLinear | StageBezierTransition = Field(default_factory=CameraMoveLinear, description='Normalized path progress curve.')
+
+
class CameraRig(Contract):
id: Identifier = Field(description='Stable object ID.')
name: str = Field(max_length=255, description='User-visible name.')
+ aspectRatio: Literal['16:9', '2.39:1', '9:16', '1:1', '4:3', '3:4'] = Field(default='16:9', description='Camera output aspect ratio.')
pose: StageCamera = Field(description='Camera position and look-at target.')
keyframes: tuple[CameraFrame, ...] = Field(default=(), description='Ordered animation keyframes.')
+ channels: CameraChannels = Field(default_factory=CameraChannels, description='Independent authoritative camera channels.')
+ moveClips: tuple[CameraMoveClip, ...] = Field(default=(), exclude_if=lambda value: not value, description='Parameterized camera moves; channel ownership is derived from the preset version.')
+
+ @model_validator(mode='before')
+ @classmethod
+ def migrate_legacy_keyframes(cls, value):
+ if not isinstance(value, dict) or value.get('channels') is not None:
+ return value
+ frames = value.get('keyframes') or ()
+ if any(
+ not isinstance(frame, dict)
+ or not isinstance(frame.get('value'), dict)
+ or not {'id', 'time'} <= set(frame)
+ or not {'position', 'target', 'fov'} <= set(frame.get('value', {}))
+ for frame in frames
+ ):
+ return value
+ return {
+ **value,
+ 'channels': {
+ 'position': [dict(id=f['id'], time=f['time'], value=f['value']['position']) for f in frames],
+ 'target': [dict(id=f['id'], time=f['time'], value=f['value']['target']) for f in frames],
+ 'up': [dict(id=f['id'], time=f['time'], value={'x': 0, 'y': 1, 'z': 0}) for f in frames],
+ 'focalLength': [dict(id=f['id'], time=f['time'], value=f['value']['fov']) for f in frames],
+ },
+ }
class StageShot(Contract):
@@ -417,17 +564,96 @@ class StageShot(Contract):
duration: Positive = Field(description='Interval duration in seconds.')
-def check_frames(frames, duration):
+class StageEnvironment(Contract):
+ """The named environment used by the retained Director scene."""
+ preset: Literal['studio', 'warm-sunset', 'moonlit'] = Field(default='studio', description='Environment preset reference. 环境预设引用。')
+ groundColor: Color = Field(default='#181818', description='Ground plane color. 地面颜色。')
+ groundVisible: StrictBool = Field(default=True, description='Whether the ground plane is visible. 是否显示地面。')
+ exposure: Annotated[float, Field(strict=True, ge=0, le=4)] = Field(default=1.0, description='Scene exposure from zero to four. 场景曝光范围为 0 到 4。')
+ backgroundAsset: AssetRef | None = Field(default=None, description='Optional registered image asset used as the stage background. 可选的已登记图片背景素材。')
+
+ @model_validator(mode='after')
+ def background_asset(self):
+ if self.backgroundAsset and self.backgroundAsset.kind != 'image':
+ raise ValueError('Stage background assets must be image assets. 舞台背景素材必须是图片素材。')
+ return self
+
+ @field_validator('preset', mode='before')
+ @classmethod
+ def environment_preset(cls, value):
+ if value not in {'studio', 'warm-sunset', 'moonlit'}:
+ raise ValueError('Environment preset must be studio, warm-sunset or moonlit. 环境预设必须是 studio、warm-sunset 或 moonlit。')
+ return value
+
+ @field_validator('exposure', mode='before')
+ @classmethod
+ def environment_exposure(cls, value):
+ if isinstance(value, bool) or not isinstance(value, (int, float)) or not isfinite(value) or not 0 <= value <= 4:
+ raise ValueError('Environment exposure must be between 0 and 4. 场景曝光必须在 0 到 4 之间。')
+ return value
+
+
+class StageLight(Contract):
+ id: Literal['hemisphere', 'key', 'fill'] = Field(description='Stable light role. 稳定灯光角色。')
+ color: Color = Field(description='Light color in #RRGGBB format. 灯光颜色。')
+ intensity: Annotated[float, Field(strict=True, ge=0, le=10)] = Field(description='Light intensity from zero to ten. 灯光强度范围为 0 到 10。')
+ position: Vector3 = Field(description='Light position in stage coordinates. 灯光在舞台坐标中的位置。')
+ castShadow: StrictBool = Field(default=False, description='Whether the light casts shadows. 是否投射阴影。')
+
+ @field_validator('id', mode='before')
+ @classmethod
+ def light_id(cls, value):
+ if value not in {'hemisphere', 'key', 'fill'}:
+ raise ValueError('Light role must be hemisphere, key or fill. 灯光角色必须是 hemisphere、key 或 fill。')
+ return value
+
+ @field_validator('color', mode='before')
+ @classmethod
+ def light_color(cls, value):
+ if not isinstance(value, str) or re.fullmatch(r'#[0-9a-fA-F]{6}', value) is None:
+ raise ValueError('Light color must use #RRGGBB. 灯光颜色必须使用 #RRGGBB 格式。')
+ return value
+
+ @field_validator('intensity', mode='before')
+ @classmethod
+ def light_intensity(cls, value):
+ if isinstance(value, bool) or not isinstance(value, (int, float)) or not isfinite(value) or not 0 <= value <= 10:
+ raise ValueError('Light intensity must be between 0 and 10. 灯光强度必须在 0 到 10 之间。')
+ return value
+
+ @field_validator('position', mode='before')
+ @classmethod
+ def light_position(cls, value):
+ if isinstance(value, Vector3):
+ return value
+ if not isinstance(value, dict) or any(not isinstance(value.get(axis), (int, float)) or isinstance(value.get(axis), bool) or not isfinite(value[axis]) for axis in ('x', 'y', 'z')):
+ raise ValueError('Light position must contain finite x, y and z values. 灯光位置必须包含有限的 x、y、z 数值。')
+ return value
+
+ @model_validator(mode='after')
+ def role_constraints(self):
+ if self.id == 'hemisphere' and self.castShadow:
+ raise ValueError('Hemisphere lights cannot cast shadows. 半球光不能投射阴影。')
+ return self
+
+
+def default_stage_lights() -> tuple[StageLight, ...]:
+ return (
+ StageLight(id='hemisphere', color='#ffffff', intensity=2.4, position=Vector3(x=0, y=1, z=0)),
+ StageLight(id='key', color='#ffffff', intensity=3.5, position=Vector3(x=5, y=10, z=6), castShadow=True),
+ StageLight(id='fill', color='#ffffff', intensity=1.6, position=Vector3(x=-6, y=5, z=-5)),
+ )
+
+
+def check_frames(frames):
unique([frame.id for frame in frames], 'keyframe IDs')
unique([frame.time for frame in frames], 'keyframe times')
- if any(frame.time > duration for frame in frames):
- raise ValueError('Keyframe exceeds stage duration')
-def check_intervals(items, duration):
+def check_intervals(items, duration=None):
unique([item.id for item in items], 'interval IDs')
ordered = sorted(items, key=lambda item: item.start)
- if any(item.start + item.duration > duration + 1e-8 for item in ordered):
+ if duration is not None and any(item.start + item.duration > duration + 1e-8 for item in ordered):
raise ValueError('Interval exceeds stage duration')
if any(a.start + a.duration > b.start + 1e-8 for a, b in zip(ordered, ordered[1:])):
raise ValueError('Stage intervals cannot overlap')
@@ -437,30 +663,83 @@ class DirectorData(Contract):
background: Color = Field(description='Composition background color.')
grid: bool = Field(default=True, description='Whether to display the stage grid.')
duration: Positive = Field(description='Interval duration in seconds.')
- aspectRatio: Literal['16:9', '9:16', '1:1', '4:3', '3:4'] = Field(default='16:9', description='Output width-to-height ratio.')
+ fps: Literal[24, 25, 30, 50, 60] = Field(default=30, description='Frames per second. 帧率。')
+ aspectRatio: Literal['16:9', '2.39:1', '9:16', '1:1', '4:3', '3:4'] = Field(default='16:9', description='Output width-to-height ratio.')
cameras: tuple[CameraRig, ...] = Field(min_length=1, description='Editable stage cameras.')
activeCameraId: Identifier = Field(description='Active stage camera ID.')
cameraSource: Literal['camera', 'storyboard'] = Field(default='camera', description='Camera selection strategy.')
shots: tuple[StageShot, ...] = Field(default=(), description='Ordered camera shot intervals.')
objects: tuple[StageObject, ...] = Field(default=(), description='Editable stage objects.')
+ environment: StageEnvironment = Field(default_factory=StageEnvironment, description='Authoritative environment reference and ground configuration. 权威环境引用和地面配置。')
+ lights: tuple[StageLight, ...] = Field(default_factory=default_stage_lights, min_length=3, max_length=3, description='The three retained stage lights. 舞台保留的三盏灯光。')
+ stills: tuple[AssetRef, ...] = Field(default=(), description='Captured still frames pinned as project image assets, oldest first.')
+
+ @field_validator('fps', mode='before')
+ @classmethod
+ def stage_fps(cls, value):
+ if isinstance(value, bool) or not isinstance(value, int) or value not in {24, 25, 30, 50, 60}:
+ raise ValueError('Stage FPS must be one of 24, 25, 30, 50 or 60. 舞台帧率必须是 24、25、30、50 或 60。')
+ return value
@model_validator(mode='after')
def stage_relations(self):
camera_ids = [camera.id for camera in self.cameras]
unique(camera_ids, 'camera IDs')
unique([obj.id for obj in self.objects], 'stage object IDs')
- if self.activeCameraId not in camera_ids or any(shot.cameraId not in camera_ids for shot in self.shots):
+ light_ids = [light.id for light in self.lights]
+ if set(light_ids) != {'hemisphere', 'key', 'fill'}:
+ raise ValueError('Stage lights must contain exactly one hemisphere, key and fill light. 舞台灯光必须各包含一盏半球光、主光和辅光。')
+ # One asset can back at most one drawer entry; the read path keys
+ # drawer items by assetId.
+ unique([still.assetId for still in self.stills], 'stage still asset IDs')
+ if self.activeCameraId not in camera_ids:
raise ValueError('Stage references an unknown camera')
- check_intervals(self.shots, self.duration)
- if self.cameraSource == 'storyboard' and not self.shots:
- raise ValueError('Local camera-shot playback needs shots')
+ self.check_storyboard(camera_ids)
+ # A duration edit changes the playback window. Animation outside it remains authored.
for camera in self.cameras:
- check_frames(camera.keyframes, self.duration)
+ check_frames(camera.keyframes)
+ for channel in (camera.channels.position, camera.channels.target, camera.channels.up, camera.channels.focalLength):
+ check_frames(channel)
for obj in self.objects:
- check_frames(obj.keyframes, self.duration)
- check_intervals(obj.motionClips, self.duration)
+ check_frames(obj.keyframes)
+ check_intervals(obj.motionClips)
return self
+ def check_storyboard(self, camera_ids):
+ """Shot relations of a stored Director Stage document.
+
+ A document entering through a command defers them (see ``DirectorDataWrite``):
+ the write boundary checks the Storyboard once, on millisecond-normalized times
+ and with a stable issue code, before the stored model validates the result.
+ """
+ if any(shot.cameraId not in camera_ids for shot in self.shots):
+ raise ValueError('Stage references an unknown camera')
+ from .storyboard import storyboard_issue
+
+ # A continuous Storyboard uses millisecond boundaries. Legacy tracks
+ # that fail continuity can still load under the original interval rules.
+ shots = [shot.model_dump() for shot in self.shots]
+ if storyboard_issue(shots, self.duration, camera_ids) is not None:
+ check_intervals(self.shots, self.duration)
+ if any(shot.start + shot.duration > self.duration + 1e-8 for shot in self.shots):
+ raise ValueError('Interval exceeds stage duration')
+ if self.cameraSource == 'storyboard' and not self.shots:
+ raise ValueError('Local camera-shot playback needs shots')
+
+
+class DirectorDataWrite(DirectorData):
+ """A Director Stage document entering the project through a command.
+
+ It has the same fields and dump as the stored ``DirectorData``. Shot relations are
+ not checked while the command is parsed: both HTTP and Agent entry points parse the
+ payload before the application service runs, so checking here would reject the write
+ with a generic code before the write boundary could report the specific one. The
+ stored model still validates the committed snapshot as the last line of defence.
+ """
+
+ def check_storyboard(self, camera_ids):
+ return None
+
class ToolSelection(Contract):
source: AssetRef = Field(description='Input source or recorded provenance.')
@@ -634,6 +913,11 @@ class DirectorDocument(EditorDocumentBase):
data: DirectorData = Field(description='Typed editable document contents.')
+class DirectorDocumentWrite(EditorDocumentBase):
+ kind: Literal['director'] = Field(description='Business object or media type.')
+ data: DirectorDataWrite = Field(description='Typed editable document contents.')
+
+
class MediaEditDocument(EditorDocumentBase):
kind: Literal['media_edit'] = Field(description='Business object or media type.')
data: MediaEditData = Field(description='Typed editable document contents.')
@@ -772,3 +1056,6 @@ class MotionDocument(EditorDocumentBase):
EditorDocument = Annotated[TimelineDocument | SubjectDocument | LayerDocument | ImageCropDocument | StackDocument |
ToolDocument | DirectorDocument | MediaEditDocument | MotionDocument, Field(discriminator='kind')]
+# Documents entering the project through editor.create, editor.save and director.apply.
+EditorDocumentWrite = Annotated[TimelineDocument | SubjectDocument | LayerDocument | ImageCropDocument | StackDocument |
+ ToolDocument | DirectorDocumentWrite | MediaEditDocument | MotionDocument, Field(discriminator='kind')]
diff --git a/packages/core/src/opendirector/domain/creation/project.py b/packages/core/src/opendirector/domain/creation/project.py
index 3d5e4e0a8..872f8de48 100644
--- a/packages/core/src/opendirector/domain/creation/project.py
+++ b/packages/core/src/opendirector/domain/creation/project.py
@@ -7,10 +7,12 @@
from .assets import Asset, AssetRef
from .base import Contract, NonNegative, ObjectVersion, Point, ProjectEntity, Revision, unique
from .canvas import CanvasItem, EditorBinding, GenerationBinding, MaterialBinding, MediaCanvasItem
-from .editors import EditorDocument, MediaEditDocument, LayerDocument, StackDocument, SubjectDocument, TimelineDocument
+from .editors import DirectorDocument, EditorDocument, MediaEditDocument, LayerDocument, StackDocument, SubjectDocument, TimelineDocument
from .generation import FollowingReference, GenerationSpec, Job, PromptReference, Reference, ResultVersion
from ..rule_facts import TIMELINE_DURATION_EPSILON
+STAGE_MODEL_MIME = {'glb': 'model/gltf-binary', 'gltf': 'model/gltf+json'}
+
class Project(Contract):
id: UUID = Field(description='Stable object ID.')
@@ -83,7 +85,7 @@ def project_relations(self):
for ref in asset_references(objects):
asset = assets.get(ref.assetId)
if asset is None or ref.revision > asset.revision or ref.fingerprint != asset.fingerprint or ref.kind != asset.kind:
- raise ValueError('Missing or inconsistent pinned asset reference')
+ raise ValueError('Missing or inconsistent pinned asset reference. 缺失或不一致的固定素材引用。')
parents = {}
for item in self.canvasItems:
if item.parentId:
@@ -214,6 +216,20 @@ def project_relations(self):
duration = asset.metadata.durationSeconds
if asset.kind != 'image' and duration is not None and clip.outPoint > duration + TIMELINE_DURATION_EPSILON:
raise ValueError('时间线片段超过素材的实际时长。')
+ if isinstance(doc, DirectorDocument):
+ for obj in doc.data.objects:
+ if obj.kind == 'gltf':
+ asset = assets[obj.asset.assetId]
+ if asset.metadata.mimeType != STAGE_MODEL_MIME[obj.format] or asset.metadata.selfContained is not True:
+ raise ValueError('Imported stage objects require a matching self-contained GLB or GLTF asset. 导入的舞台对象需要匹配的自包含 GLB 或 GLTF 素材。')
+ # Animation metadata is attested by the client; verify it
+ # against the names the pinned bytes actually declare.
+ names = asset.metadata.animationNames or ()
+ if tuple(obj.animationNames) != names or obj.hasAnimation != bool(names):
+ raise ValueError('Imported animation metadata must match the pinned asset bytes. 导入的动画信息必须与固定素材的实际字节一致。')
+ for still in doc.data.stills:
+ if assets[still.assetId].kind != 'image':
+ raise ValueError('Captured stage stills must pin image assets. 舞台定格必须固定为图片素材。')
return self
diff --git a/packages/core/src/opendirector/domain/creation/storyboard.py b/packages/core/src/opendirector/domain/creation/storyboard.py
new file mode 100644
index 000000000..e19073429
--- /dev/null
+++ b/packages/core/src/opendirector/domain/creation/storyboard.py
@@ -0,0 +1,144 @@
+"""The continuous Director Stage Storyboard rule: one implementation for every entry point.
+
+A Storyboard is a single exclusive camera-cut track. It starts at 0, every block starts
+where the previous one ends, durations are positive, and its end never passes the main
+timeline. These functions are pure: the application write boundary calls them when a
+Director Stage document enters or changes project state, and the read model calls them
+to report a stored track. Nothing here sorts, compacts or repairs the blocks it is given.
+"""
+from decimal import Decimal
+from math import floor, isfinite
+from uuid import UUID
+
+from opendirector.domain.creation.commands import DirectorStoryboardBlock, DirectorStoryboardState
+from opendirector.domain.creation.validation import ContractError
+from opendirector.domain.storyboard_errors import STORYBOARD_MESSAGES, StoryboardIssueCode
+
+# The stored interval checks use this tolerance; the guard judges against the same line
+# so a document it accepts is never rejected later by the model.
+STORYBOARD_TIME_TOLERANCE = 1e-8
+# Duration of an appended block when at least this much main-timeline time remains.
+STORYBOARD_DEFAULT_SECONDS = 2.0
+
+
+def normalize_storyboard_time(value: float) -> float:
+ """Seconds rounded to milliseconds: half toward positive infinity, as JavaScript's Math.round.
+
+ Both runtimes first form the same double ``value * 1000``. Rounding that exact value
+ with decimals avoids Python's banker's ``round``, which sends 1000.5 down to 1000
+ where JavaScript sends it up to 1001.
+ """
+ scaled = value * 1000
+ return floor(Decimal(scaled) + Decimal(0.5)) / 1000 if isfinite(scaled) else value
+
+
+def storyboard_rejection(code: StoryboardIssueCode, object_id: UUID | None = None,
+ index: int | None = None) -> ContractError:
+ """A rejection carrying the Chinese catalog copy; the presentation boundary selects the language by code."""
+ return ContractError(code, STORYBOARD_MESSAGES[code][0], object_id,
+ field=None if index is None else f'data.shots.{index}')
+
+
+def storyboard_issue(shots, duration, camera_ids, *, object_id: UUID | None = None) -> ContractError | None:
+ """The first continuity violation of a shot list, or None when the list is continuous.
+
+ ``shots`` is read in stored order and never changed. Times are judged after
+ millisecond normalization, so float noise is neither a gap nor an overlap and a
+ duration that rounds to nothing is not positive. The caller decides whether a
+ returned issue rejects a write or is reported for a stored track.
+ """
+ camera_ids = set(camera_ids)
+ identities: set[str] = set()
+ previous_end = 0.0
+ for index, shot in enumerate(shots):
+ identity = shot['id']
+ if identity in identities:
+ return storyboard_rejection('storyboard_block_exists', object_id, index)
+ identities.add(identity)
+ if shot['cameraId'] not in camera_ids:
+ return storyboard_rejection('storyboard_camera_unknown', object_id, index)
+ start = normalize_storyboard_time(shot['start'])
+ span = normalize_storyboard_time(shot['duration'])
+ if span <= 0:
+ return storyboard_rejection('storyboard_duration_invalid', object_id, index)
+ if index == 0 and start != 0:
+ return storyboard_rejection('storyboard_leading_gap', object_id, index)
+ if start > previous_end:
+ return storyboard_rejection('storyboard_internal_gap', object_id, index)
+ if start < previous_end:
+ return storyboard_rejection('storyboard_overlap', object_id, index)
+ end = normalize_storyboard_time(start + span)
+ if end - duration > STORYBOARD_TIME_TOLERANCE:
+ return storyboard_rejection('storyboard_exceeds_duration', object_id, index)
+ previous_end = end
+ return None
+
+
+def pack_storyboard(shots):
+ """Place consecutive blocks from zero, preserving identities and stored durations."""
+ start = 0.0
+ packed = []
+ for shot in shots:
+ packed.append({**shot, 'start': start})
+ start = normalize_storyboard_time(start + normalize_storyboard_time(shot['duration']))
+ return packed
+
+
+def delete_storyboard_blocks(shots, block_ids):
+ """Remove blocks in stored time order; packing applies the cumulative ripple."""
+ return (shot for shot in shots if shot['id'] not in block_ids)
+
+
+def storyboard_end(shots):
+ if not shots:
+ return 0.0
+ last = shots[-1]
+ return normalize_storyboard_time(normalize_storyboard_time(last['start']) + normalize_storyboard_time(last['duration']))
+
+
+def appended_block(shots, duration):
+ """Start and duration of the block appended to a continuous shot list.
+
+ Returns None when no positive usable time remains. A block lasts
+ ``STORYBOARD_DEFAULT_SECONDS`` and takes all of the remaining time when less than
+ that is left. The remainder is normalized first, because the block is stored in
+ milliseconds; when rounding it up would run past a main duration that itself has
+ sub-millisecond precision, the block gives one millisecond back instead of
+ exceeding the main timeline.
+ """
+ start = storyboard_end(shots)
+ remaining = duration - start
+ span = normalize_storyboard_time(remaining)
+ if remaining <= 0 or span <= 0:
+ return None
+ span = min(STORYBOARD_DEFAULT_SECONDS, span)
+ if span - remaining > STORYBOARD_TIME_TOLERANCE:
+ span = normalize_storyboard_time(span - 0.001)
+ if span <= 0:
+ return None
+ return start, span
+
+
+def storyboard_blocks(shots) -> tuple[DirectorStoryboardBlock, ...]:
+ return tuple(DirectorStoryboardBlock(order=index, **shot) for index, shot in enumerate(shots))
+
+
+def storyboard_state(document_id, version, shots, duration, camera_ids) -> DirectorStoryboardState:
+ """The Storyboard of one stored document, reported exactly as stored.
+
+ Blocks are listed in stored order with their stored times; nothing is sorted, compacted
+ or normalized here. ``canAppend`` is False with the stable reason when the stored track
+ is not continuous or no positive usable time remains.
+ """
+ issue = storyboard_issue(shots, duration, camera_ids, object_id=document_id)
+ if issue is not None:
+ reason = issue.issue.code
+ elif appended_block(shots, duration) is None:
+ reason = 'storyboard_exhausted'
+ else:
+ reason = None
+ return DirectorStoryboardState(
+ documentId=document_id, version=version,
+ storyboardEnd=storyboard_end(shots),
+ canAppend=reason is None, cannotAppendReason=reason,
+ blocks=storyboard_blocks(shots))
diff --git a/packages/core/src/opendirector/domain/creation/validation.py b/packages/core/src/opendirector/domain/creation/validation.py
index 96bb76c09..22f633df3 100644
--- a/packages/core/src/opendirector/domain/creation/validation.py
+++ b/packages/core/src/opendirector/domain/creation/validation.py
@@ -11,9 +11,9 @@
class ContractError(ValueError):
- def __init__(self, code, message, object_id=None, *, related_object_id=None):
+ def __init__(self, code, message, object_id=None, *, field=None, related_object_id=None, camera_move_conflicts=()):
super().__init__(message)
- self.issue = ContractIssue(code=code, message=message, objectId=object_id, relatedObjectId=related_object_id)
+ self.issue = ContractIssue(code=code, message=message, objectId=object_id, field=field, relatedObjectId=related_object_id, cameraMoveConflicts=camera_move_conflicts)
@classmethod
def from_error(cls, error: ValueError | ProjectError, object_id: UUID | None = None) -> 'ContractError':
@@ -102,10 +102,12 @@ def get(kind, object_id):
if command.type == 'reference.update':
if get('reference', payload.reference.id).targetSpecId != payload.reference.targetSpecId:
raise ContractError('invalid_input', 'A reference cannot be moved to another generation spec', payload.reference.id)
- if command.type == 'editor.save':
+ if command.type in {'editor.save', 'director.apply'}:
current = get('editor_document', payload.document.id)
if current.kind != payload.document.kind:
raise ContractError('invalid_input', 'Editor document kind cannot change', current.id)
+ if command.type == 'director.apply' and current.kind != 'director':
+ raise ContractError('role_restricted', 'director.apply 只能保存 Director Stage 文档。 director.apply only accepts Director Stage documents.', current.id)
def validate_published_plans(command: Command, before: ProjectSnapshot, after: ProjectSnapshot) -> None:
diff --git a/packages/core/src/opendirector/domain/language.py b/packages/core/src/opendirector/domain/language.py
new file mode 100644
index 000000000..a3b6ac088
--- /dev/null
+++ b/packages/core/src/opendirector/domain/language.py
@@ -0,0 +1,15 @@
+"""Which language a caller reads, as far as the interface is concerned.
+
+The rule is the one the interface documents: a `zh*` language tag is Chinese and every
+other tag is English. It lives in the domain so a code-keyed catalog and the HTTP
+boundary cannot drift into two different decisions about the same request.
+"""
+
+
+def wants_english_language(value: str | None) -> bool:
+ """Judge the primary language tag, matching the browser decision. No tag is not English."""
+ value = (value or "").strip()
+ if not value:
+ return False
+ primary = value.split(",", 1)[0].split(";", 1)[0].strip().lower()
+ return not primary.startswith("zh")
diff --git a/packages/core/src/opendirector/domain/storyboard_errors.py b/packages/core/src/opendirector/domain/storyboard_errors.py
new file mode 100644
index 000000000..0016f92e3
--- /dev/null
+++ b/packages/core/src/opendirector/domain/storyboard_errors.py
@@ -0,0 +1,90 @@
+"""Stable Director Stage Storyboard diagnostics shared by business and presentation boundaries.
+
+Every Storyboard rejection carries one code from this catalog. The write boundary
+raises the Chinese copy for CLI and Agent traces; the HTTP boundary selects the
+caller's language from the same code, so wording never becomes business identity
+and one message never carries two languages.
+"""
+from typing import Literal
+
+from opendirector.domain.language import wants_english_language
+
+StoryboardIssueCode = Literal[
+ 'storyboard_leading_gap',
+ 'storyboard_internal_gap',
+ 'storyboard_overlap',
+ 'storyboard_exceeds_duration',
+ 'storyboard_duration_invalid',
+ 'storyboard_camera_unknown',
+ 'storyboard_block_invalid',
+ 'storyboard_block_exists',
+ 'storyboard_exhausted',
+ 'storyboard_order_invalid',
+ 'storyboard_block_unknown',
+ 'director_camera_unknown',
+ 'director_camera_required',
+]
+
+# Display copy is selected by code; business identity never depends on wording.
+STORYBOARD_MESSAGES = {
+ 'director_camera_unknown': (
+ '要删除的机位不存在。',
+ 'The camera to delete could not be found.',
+ ),
+ 'director_camera_required': (
+ '至少保留一个机位。',
+ 'Keep at least one camera.',
+ ),
+ 'storyboard_leading_gap': (
+ '分镜必须从 0 秒开始,第一个分镜块之前不能留空。',
+ 'The Storyboard must start at 0; the first block cannot begin later.',
+ ),
+ 'storyboard_internal_gap': (
+ '分镜块之间不能留有空隙,请让每个分镜块从前一个分镜块结束的位置开始。',
+ 'Storyboard blocks cannot leave gaps; start each block where the previous one ends.',
+ ),
+ 'storyboard_overlap': (
+ '分镜块之间不能重叠,请让每个分镜块从前一个分镜块结束的位置开始。',
+ 'Storyboard blocks cannot overlap; start each block where the previous one ends.',
+ ),
+ 'storyboard_exceeds_duration': (
+ '分镜的结束时间不能超过主时间轴时长,请缩短分镜块或延长主时间轴。',
+ 'The Storyboard cannot end after the main timeline; shorten the blocks or lengthen the main timeline.',
+ ),
+ 'storyboard_duration_invalid': (
+ '每个分镜块的时长都必须大于 0,请延长该分镜块。',
+ 'Every Storyboard block needs a duration greater than 0; lengthen this block.',
+ ),
+ 'storyboard_camera_unknown': (
+ '分镜块引用的机位不存在,请选择已有机位。',
+ 'A Storyboard block references a camera that does not exist; choose an existing camera.',
+ ),
+ 'storyboard_block_invalid': (
+ '分镜块标识不能为空。',
+ 'A Storyboard block needs a non-empty identity.',
+ ),
+ 'storyboard_block_exists': (
+ '该分镜块标识已被使用,请换一个标识。',
+ 'This Storyboard block identity is already in use; choose another one.',
+ ),
+ 'storyboard_block_unknown': (
+ '要编辑的分镜块不存在。',
+ 'The Storyboard block to edit could not be found.',
+ ),
+ 'storyboard_order_invalid': (
+ '请在目标顺序中为每个分镜块提供且仅提供一个标识。',
+ 'Include each Storyboard block ID exactly once in the desired order.',
+ ),
+ 'storyboard_exhausted': (
+ '主时间轴已没有可用时长,无法再添加分镜块。',
+ 'No main-timeline time remains for another Storyboard block.',
+ ),
+}
+
+
+def storyboard_error_message(code: str, language: str | None) -> str | None:
+ messages = STORYBOARD_MESSAGES.get(code)
+ if messages is None:
+ return None
+ # One decision for the whole HTTP boundary: `zh*` is Chinese, anything else English.
+ return messages[1 if wants_english_language(language) else 0]
diff --git a/packages/core/src/opendirector/infrastructure/creation_publication.py b/packages/core/src/opendirector/infrastructure/creation_publication.py
index bba3ef818..7a51386ca 100644
--- a/packages/core/src/opendirector/infrastructure/creation_publication.py
+++ b/packages/core/src/opendirector/infrastructure/creation_publication.py
@@ -82,15 +82,15 @@ def replay(self, command):
def commit(self, command: Command,
apply: Callable[[ProjectSnapshot], ProjectSnapshot] | Callable[[ProjectSnapshot, tuple[CommitRecord | HistoryFact, ...]], ProjectSnapshot], *,
- session=None, source='ui', files=(), deletes=(), with_history=False):
+ session=None, source='ui', files=(), deletes=(), with_history=False, director_durations=(), director_storyboard=()):
if source not in {'ui', 'agent', 'background', 'external'}:
raise ProjectError('无效的命令来源。')
if command.type in {'project.rename', 'project.trash'}:
- return self._commit(command, apply, session, source, files, deletes, with_history)
+ return self._commit(command, apply, session, source, files, deletes, with_history, director_durations, director_storyboard)
with self._publication_lock(command.projectId):
- return self._commit(command, apply, session, source, files, deletes, with_history)
+ return self._commit(command, apply, session, source, files, deletes, with_history, director_durations, director_storyboard)
- def _commit(self, command, apply, session, source, files, deletes, with_history):
+ def _commit(self, command, apply, session, source, files, deletes, with_history, director_durations=(), director_storyboard=()):
with self._write_basis(command.projectId, command.commandId, with_history=with_history) as (db, path, manifest, head, records, duplicate):
if duplicate is not None:
return self._replay((duplicate,), command)
@@ -141,7 +141,7 @@ def _commit(self, command, apply, session, source, files, deletes, with_history)
snapshot, changed, placements = before, [], ()
elif changed:
snapshot = ProjectSnapshot.model_validate({**snapshot.model_dump(), 'eventCursor': before.eventCursor + 1})
- record = self._make_record(command, manifest.head, snapshot, changed, source, issue, placements=placements)
+ record = self._make_record(command, manifest.head, snapshot, changed, source, issue, director_durations, director_storyboard, placements=placements)
to_name = snapshot.project.name if command.type == 'project.rename' and changed else path.name
intent = CommitIntent(
fromName=path.name, toName=to_name, beforeFingerprint=digest(before),
@@ -155,14 +155,16 @@ def _commit(self, command, apply, session, source, files, deletes, with_history)
return self._publish_intent(intent, validated_history=True)
@staticmethod
- def _make_record(command, head, snapshot, changed, source, issue=None, *, placements=()):
+ def _make_record(command, head, snapshot, changed, source, issue=None, director_durations=(), director_storyboard=(), *, placements=()):
job_ids = tuple(item['version'].id for item in changed if item['version'].objectType == 'job' and item['change'] == 'created'
and next(job for job in snapshot.jobs if job.id == item['version'].id).status == 'queued')
event = ProjectEvent(projectId=command.projectId, cursor=snapshot.eventCursor, commandId=command.commandId,
source=source, changed=changed, jobIds=job_ids) if changed else None
receipt = CommandReceipt(commandId=command.commandId, projectId=command.projectId,
inputFingerprint=command_fingerprint(command), status='rejected' if issue else 'accepted' if job_ids else 'applied' if changed else 'noop',
- changed=[item['version'] for item in changed], jobIds=job_ids, issues=[issue] if issue else [], eventCursor=snapshot.eventCursor,
+ changed=[item['version'] for item in changed], jobIds=job_ids, issues=[issue] if issue else [],
+ directorDurations=() if issue else director_durations,
+ directorStoryboard=() if issue else director_storyboard, eventCursor=snapshot.eventCursor,
canvasPlacements=placements)
return CommitRecord(command=command, previousHead=head, snapshot=snapshot, receipt=receipt, event=event)
diff --git a/packages/core/src/opendirector/infrastructure/creation_uploads.py b/packages/core/src/opendirector/infrastructure/creation_uploads.py
index eead9a10f..5956003af 100644
--- a/packages/core/src/opendirector/infrastructure/creation_uploads.py
+++ b/packages/core/src/opendirector/infrastructure/creation_uploads.py
@@ -1,5 +1,6 @@
"""Project/session-scoped streaming staging; no project facts before commit."""
import hashlib
+import json
import os
from pathlib import Path
import tempfile
@@ -14,7 +15,7 @@
from opendirector.domain.creation.base import Contract, Fingerprint, MediaKind
from opendirector.domain.projects import ProjectError
from opendirector.infrastructure.creation_files import file_identity, upload_directory
-from opendirector.ports.files import MAX_CREATION_TEXT_BYTES
+from opendirector.ports.files import MAX_STAGE_MODEL_BYTES, MAX_CREATION_TEXT_BYTES
from opendirector.infrastructure.creation_projects import directory, durable_json, sync_directory
from opendirector.infrastructure.local_projects import child, read_json
from opendirector.infrastructure.rename import rename_path
@@ -30,10 +31,30 @@ def asset_name(value):
return value
+STAGE_MODEL_TOO_LARGE = '舞台模型文件应不超过 100 MiB,与浏览器导入上限一致。Stage model files must not exceed 100 MiB, matching the browser import limit.'
+
+
def upload_asset_id(project_id, handle):
return uuid5(UUID(str(project_id)), 'upload:' + str(handle))
+def _has_external_gltf_resources(document):
+ entries = [entry for key in ('buffers', 'images') if isinstance(document.get(key), list) for entry in document[key]]
+ return any(isinstance(entry, dict) and isinstance(entry.get('uri'), str) and not entry['uri'].startswith('data:')
+ for entry in entries)
+
+
+def _gltf_animation_names(document):
+ """Names must match what a browser loader derives: declared names
+ trimmed, unnamed clips falling back to animation_{index}."""
+ animations = document.get('animations')
+ if not isinstance(animations, list):
+ return ()
+ return tuple((entry.get('name') if isinstance(entry, dict) and isinstance(entry.get('name'), str) else '').strip()
+ or f'animation_{index}'
+ for index, entry in enumerate(animations))
+
+
class UploadOwner(Contract):
projectId: UUID = Field(description='Owning project ID.')
id: UUID = Field(description='Stable object ID.')
@@ -70,7 +91,9 @@ def inspect_file(path: Path, name: str, *, expected_kind=None):
raise ProjectError('文件包含非文本内容,请导入 UTF-8 文本。')
return 'text', MediaMetadata(size=size, mimeType='text/markdown' if suffix == '.md' else 'text/plain')
with path.open('rb') as stream:
- prefix = stream.read(16)
+ # Wide enough to skip leading whitespace before a glTF JSON document;
+ # image and container magic detection needs only the first 12 bytes.
+ prefix = stream.read(4096)
image_bytes = (prefix.startswith((b'\x89PNG\r\n\x1a\n', b'\xff\xd8\xff', b'GIF87a', b'GIF89a'))
or prefix.startswith(b'RIFF') and prefix[8:12] == b'WEBP' or heif_type(prefix))
if suffix in {'.png', '.jpg', '.jpeg', '.gif', '.webp', '.heic', '.heif'} or image_bytes or expected_kind == 'image':
@@ -110,6 +133,44 @@ def inspect_file(path: Path, name: str, *, expected_kind=None):
return kind, MediaMetadata(size=size, mimeType=mime, **value)
except ValueError:
raise ProjectError('媒体尺寸、时长或音频信息无效,请检查文件。') from None
+ if prefix.startswith(b'glTF') and size >= 12:
+ if size > MAX_STAGE_MODEL_BYTES:
+ raise ProjectError(STAGE_MODEL_TOO_LARGE, 413)
+ version, total = int.from_bytes(prefix[4:8], 'little'), int.from_bytes(prefix[8:12], 'little')
+ if version == 2 and 12 <= total <= size:
+ document = None
+ with path.open('rb') as stream:
+ stream.seek(12)
+ while len(header := stream.read(8)) == 8:
+ length = int.from_bytes(header[:4], 'little')
+ payload = stream.read(length)
+ if len(payload) < length:
+ break
+ if header[4:] == b'JSON':
+ document = payload
+ break
+ try:
+ parsed = json.loads(document) if document is not None else None
+ except ValueError:
+ parsed = None
+ self_contained = (isinstance(parsed, dict) and isinstance(parsed.get('asset'), dict)
+ and 'version' in parsed['asset'] and not _has_external_gltf_resources(parsed))
+ return 'file', MediaMetadata(size=size, mimeType='model/gltf-binary', selfContained=self_contained,
+ animationNames=_gltf_animation_names(parsed) if isinstance(parsed, dict) else None)
+ # Stage models are probed as whole JSON documents, so oversized files are
+ # rejected up front instead of being fully loaded into memory; oversized
+ # JSON without a .gltf suffix stays a generic file.
+ if size <= MAX_STAGE_MODEL_BYTES and (prefix.lstrip()[:1] == b'{' or suffix == '.gltf'):
+ try:
+ parsed = json.loads(path.read_text(encoding='utf-8-sig'))
+ except (UnicodeDecodeError, ValueError):
+ parsed = None
+ if isinstance(parsed, dict) and isinstance(parsed.get('asset'), dict) and 'version' in parsed['asset']:
+ return 'file', MediaMetadata(size=size, mimeType='model/gltf+json',
+ selfContained=not _has_external_gltf_resources(parsed),
+ animationNames=_gltf_animation_names(parsed))
+ elif suffix == '.gltf':
+ raise ProjectError(STAGE_MODEL_TOO_LARGE, 413)
with path.open('rb') as stream:
mime = 'application/pdf' if stream.read(5) == b'%PDF-' else 'application/octet-stream'
return 'file', MediaMetadata(size=size, mimeType=mime)
diff --git a/packages/core/src/opendirector/media/probe.py b/packages/core/src/opendirector/media/probe.py
index 27966424f..2b590d835 100644
--- a/packages/core/src/opendirector/media/probe.py
+++ b/packages/core/src/opendirector/media/probe.py
@@ -84,6 +84,8 @@ def probe_file(file: Path, kind: str, *, include_container=False, include_codecs
fps = float(numerator) / float(denominator) if float(denominator) else None
if fps is not None and (not math.isfinite(fps) or fps < 0):
raise ValueError()
+ if include_container and (count := str(stream.get("nb_frames", ""))).isdigit() and int(count) > 0:
+ common["frameCount"] = int(count)
return {**common, "width": stream["width"], "height": stream["height"], "frameRate": fps or None,
"hasAudio": any(item.get("codec_type") == "audio" for item in value["streams"])}
return {**common, "sampleRate": int(stream["sample_rate"]), "channels": stream["channels"]}
diff --git a/packages/core/src/opendirector/ports/files.py b/packages/core/src/opendirector/ports/files.py
index 18ced2885..517b8f03f 100644
--- a/packages/core/src/opendirector/ports/files.py
+++ b/packages/core/src/opendirector/ports/files.py
@@ -15,6 +15,7 @@
CHUNK_BYTES = 1024 * 1024
MAX_CREATION_TEXT_BYTES = 1024 * 1024
+MAX_STAGE_MODEL_BYTES = 100 * 1024 * 1024
class AssetFileWrite(Contract):
diff --git a/public/fonts/NunitoSans-Latin.woff2 b/public/fonts/NunitoSans-Latin.woff2
new file mode 100644
index 000000000..4361be683
Binary files /dev/null and b/public/fonts/NunitoSans-Latin.woff2 differ
diff --git a/public/fonts/NunitoSans-OFL.txt b/public/fonts/NunitoSans-OFL.txt
new file mode 100644
index 000000000..59f596f91
--- /dev/null
+++ b/public/fonts/NunitoSans-OFL.txt
@@ -0,0 +1,93 @@
+Copyright 2016 The Nunito Sans Project Authors (https://github.com/Fonthausen/NunitoSans)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/scripts/check-browser-locale.mjs b/scripts/check-browser-locale.mjs
index e99088d33..80d0d3797 100644
--- a/scripts/check-browser-locale.mjs
+++ b/scripts/check-browser-locale.mjs
@@ -6,7 +6,8 @@
* follows the browser language while no preference is stored. A script that
* asserts localized text without pinning `locale` therefore passes on one
* machine and times out on another (issue #160). Every page states its
- * language — through `newPage({ locale })` or through a stored
+ * language — through `newPage({ locale })` (including a validated environment-
+ * backed local variable) or through a stored
* `opendirector.locale.v1` preference that the app applies before first
* paint — and that language must match the selectors the script asserts.
*
@@ -78,6 +79,14 @@ function newPageCalls(text) {
}
}
+/** Return the fallback locale for a local variable backed by the suite env. */
+function environmentLocale(text, name) {
+ const escaped = name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
+ return new RegExp(
+ `\\b(?:const|let|var)\\s+${escaped}\\s*=\\s*process\\.env\\.DIRECTOR_STAGE_LOCALE\\s*\\?\\?\\s*["']([^"']+)["']`,
+ ).exec(text)?.[1];
+}
+
const names = (await readdir(browserDir)).filter((name) => name.endsWith(".mjs"));
const files = [...names.map((name) => join(browserDir, name)), ...extraScripts];
const problems = [];
@@ -99,7 +108,12 @@ for (const file of files) {
const expected = assertsChinese ? "zh-CN" : "en-US";
for (const call of calls) {
checked += 1;
- const found = /locale:\s*"([^"]+)"/.exec(call.args)?.[1];
+ const literal = /locale:\s*["']([^"']+)["']/.exec(call.args)?.[1];
+ const variable =
+ /locale:\s*([A-Za-z_$][\w$]*)/.exec(call.args)?.[1] ??
+ (/\blocale\s*[,}]/.test(call.args) ? "locale" : undefined);
+ const found =
+ literal ?? (variable ? environmentLocale(text, variable) : undefined);
if (!found) {
if (storesLocale) continue;
problems.push(
diff --git a/scripts/generate_camera_move_presets.py b/scripts/generate_camera_move_presets.py
new file mode 100644
index 000000000..e3d875313
--- /dev/null
+++ b/scripts/generate_camera_move_presets.py
@@ -0,0 +1,37 @@
+"""Generate the browser camera move contract from its domain owner.
+
+Run with --check in CI to reject missing or stale catalog artifacts.
+"""
+import argparse
+import json
+from pathlib import Path
+import sys
+
+ROOT = Path(__file__).resolve().parents[1]
+sys.path.insert(0, str(ROOT / 'packages/core/src'))
+from opendirector.domain.creation.camera_moves import CAMERA_MOVE_PRESETS
+
+
+def artifacts():
+ return {
+ 'cameraMovePresets.json': json.dumps(CAMERA_MOVE_PRESETS, ensure_ascii=False, indent=2) + '\n',
+ 'cameraMovePresetIds.ts': '// Generated by scripts/generate_camera_move_presets.py.\n'
+ + 'export type CameraMovePresetId = ' + ' | '.join(json.dumps(p['id']) for p in CAMERA_MOVE_PRESETS) + ';\n',
+ }
+
+
+def main():
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument('--check', action='store_true')
+ args = parser.parse_args()
+ for name, content in artifacts().items():
+ path = ROOT / 'src/contracts' / name
+ if args.check:
+ if not path.exists() or path.read_text(encoding='utf-8') != content:
+ raise SystemExit(f'Stale camera move contract: {path.relative_to(ROOT)}; run scripts/generate_camera_move_presets.py')
+ else:
+ path.write_text(content, encoding='utf-8')
+
+
+if __name__ == '__main__':
+ main()
diff --git a/scripts/generate_contracts.py b/scripts/generate_contracts.py
index f017aa414..12e3d0f48 100644
--- a/scripts/generate_contracts.py
+++ b/scripts/generate_contracts.py
@@ -16,6 +16,7 @@
from pydantic import BaseModel, TypeAdapter
from opendirector.domain.creation.schema import ALIASES, CreationContracts
from opendirector.domain.rule_facts import typescript_module
+from generate_camera_move_presets import artifacts as camera_move_artifacts
MODULES = ('base', 'assets', 'models', 'generation', 'editors', 'canvas', 'pipeline', 'project', 'commands', 'timeline_packages', 'schema')
@@ -122,6 +123,7 @@ def artifacts():
ROOT / 'src/contracts/creation.schema.json': json.dumps(document, ensure_ascii=False, indent=2) + '\n',
ROOT / 'src/contracts/generated.ts': typescript(catalogs, definitions),
ROOT / 'src/contracts/ruleFacts.generated.ts': typescript_module(),
+ **{ROOT / 'src/contracts' / name: content for name, content in camera_move_artifacts().items()},
}
diff --git a/scripts/run-browser-suite.mjs b/scripts/run-browser-suite.mjs
index ec4ccaf17..803148c00 100644
--- a/scripts/run-browser-suite.mjs
+++ b/scripts/run-browser-suite.mjs
@@ -50,6 +50,46 @@ const workflows = [
{ name: "session lease", script: "tests/browser/session_lease.mjs" },
{ name: "mp4 export", script: "tests/browser/mp4_export.mjs" },
{ name: "editor save", script: "tests/browser/editor_save.mjs" },
+ {
+ name: "director stage entry",
+ script: "tests/browser/director_stage_entry.mjs",
+ },
+ {
+ name: "director stage entry (zh-CN)",
+ script: "tests/browser/director_stage_entry.mjs",
+ env: { DIRECTOR_STAGE_LOCALE: "zh-CN" },
+ },
+ {
+ name: "director stage gizmo",
+ script: "tests/browser/director_stage_gizmo.mjs",
+ },
+ {
+ name: "director stage gizmo (zh-CN)",
+ script: "tests/browser/director_stage_gizmo.mjs",
+ env: { DIRECTOR_STAGE_LOCALE: "zh-CN" },
+ },
+ {
+ name: "director stage pointer alignment",
+ script: "tests/browser/director_stage_pointer_alignment.mjs",
+ },
+ {
+ name: "director stage storyboard",
+ script: "tests/browser/director_stage_storyboard.mjs",
+ },
+ {
+ name: "director stage storyboard (zh-CN)",
+ script: "tests/browser/director_stage_storyboard.mjs",
+ env: { DIRECTOR_STAGE_LOCALE: "zh-CN" },
+ },
+ {
+ name: "director stage camera preset",
+ script: "tests/browser/director_stage_camera_preset.mjs",
+ },
+ {
+ name: "director stage camera preset (zh-CN)",
+ script: "tests/browser/director_stage_camera_preset.mjs",
+ env: { DIRECTOR_STAGE_LOCALE: "zh-CN" },
+ },
{ name: "canvas crop", script: "tests/browser/canvas_crop.mjs" },
{ name: "canvas text Markdown", script: "tests/browser/canvas_text_markdown.mjs" },
{
diff --git a/src/backend/creationClient.ts b/src/backend/creationClient.ts
index f63cdc192..ebf1c47c7 100644
--- a/src/backend/creationClient.ts
+++ b/src/backend/creationClient.ts
@@ -82,11 +82,49 @@ export class CreationCommandError extends Error {
}
}
+/** The server may have committed; callers must reconcile this operation. */
+export class CreationDeliveryUnknownError extends Error {
+ readonly commandId: string;
+ constructor(commandId: string, cause: unknown) {
+ super(tNow("errors.backend.deliveryUnresolved", { operation: commandId }), { cause });
+ this.name = "CreationDeliveryUnknownError";
+ this.commandId = commandId;
+ }
+}
+
+/** The operation is confirmed, but its result is no longer the current content. */
+export class CreationEditSupersededError extends Error {
+ constructor() {
+ super(tNow("errors.backend.editChangedAfterSave"));
+ this.name = "CreationEditSupersededError";
+ }
+}
+
+/** A changed draft must not be reported as submitted while reconciling its predecessor. */
+export class CreationPriorOperationResolvedError extends Error {
+ readonly receipt: CommandReceipt;
+ constructor(receipt: CommandReceipt) {
+ super(tNow("errors.backend.priorEditSaved"));
+ this.name = "CreationPriorOperationResolvedError";
+ this.receipt = receipt;
+ }
+}
+
type ReferenceEdgeEvidence = {
referenceId: string;
state: "used" | "pending" | "unknown" | "unavailable";
};
+/** These operations must retain their exact transport identity across reloads.
+ * Camera history is included because a lost inverse response is still a commit. */
+function recoverableDelivery(type: unknown) {
+ return typeof type === "string" && (
+ type === "generation.submit" || type === "asset.import" ||
+ type.startsWith("director.cameraMove.") ||
+ type === "history.undo" || type === "history.redo"
+ );
+}
+
/** One server snapshot and one command queue per open project. No writable
* business graph, browser result ownership or generation history is persisted. */
export class CreationClient {
@@ -127,14 +165,14 @@ export class CreationClient {
constructor(id: string) {
this.id = id;
// This is a transport outbox, not a second job store. A page reload must
- // retain the original command ID when a paid submission's reply is lost.
+ // retain the original command ID when a recoverable operation reply is lost.
try {
const pending: [string, Record][] = JSON.parse(
sessionStorage.getItem(this.deliveryKey()) ?? "[]",
);
for (const [intent, body] of pending)
if (
- body.type === "generation.submit" &&
+ recoverableDelivery(body.type) &&
body.projectId === id &&
typeof body.commandId === "string"
)
@@ -148,8 +186,8 @@ export class CreationClient {
}
private saveDeliveries() {
try {
- const pending = [...this.deliveries].filter(
- ([, body]) => body.type === "generation.submit",
+ const pending = [...this.deliveries].filter(([, body]) =>
+ recoverableDelivery(body.type),
);
if (pending.length)
sessionStorage.setItem(this.deliveryKey(), JSON.stringify(pending));
@@ -396,8 +434,13 @@ export class CreationClient {
commandId?: string,
importedFrom?: "generated" | "edited",
) {
- const intent =
- type === "generation.submit"
+ const cameraOperation = type.startsWith("director.cameraMove.");
+ const movement = payload as { documentId?: string; cameraId?: string; clipId?: string; clip?: { id: string } };
+ // An unresolved movement belongs to its logical clip, even when a user
+ // changes parameters while its reply is unavailable. Reconcile first.
+ const intent = cameraOperation
+ ? JSON.stringify({type,documentId:movement.documentId,cameraId:movement.cameraId,clipId:movement.clipId ?? movement.clip?.id})
+ : type === "generation.submit"
? `${type}:${(payload as { specId: string }).specId}`
: JSON.stringify({ type, payload });
// Archive provenance is delivered as a header, not a payload field: the
@@ -405,7 +448,9 @@ export class CreationClient {
const extra: Record = importedFrom
? { "X-Canvas-Import": importedFrom }
: {};
- const body = (!commandId && this.deliveries.get(intent)) || {
+ const pending = this.deliveries.get(intent);
+ const resolvingPrevious = cameraOperation && pending && JSON.stringify(pending.payload) !== JSON.stringify(payload);
+ const body = ((!commandId || cameraOperation) && pending) || {
commandId: commandId ?? crypto.randomUUID(),
projectId: this.id,
type,
@@ -438,6 +483,8 @@ export class CreationClient {
[400, 401, 403, 413, 422].includes(error.status ?? 0)
) {
clearDelivery();
+ } else if (type.startsWith("director.cameraMove.") || type === "history.undo" || type === "history.redo") {
+ throw new CreationDeliveryUnknownError(String(body.commandId), error);
}
throw error;
}
@@ -451,6 +498,7 @@ export class CreationClient {
}
await this.refresh(receipt.eventCursor ?? undefined, ["canvas.applyVersion", "canvas.exportVersion"].includes(type));
clearDelivery();
+ if(resolvingPrevious)throw new CreationPriorOperationResolvedError(receipt);
return receipt;
};
return perform;
diff --git a/src/backend/creationEditorSession.ts b/src/backend/creationEditorSession.ts
index f658763a8..b5e5d5cfb 100644
--- a/src/backend/creationEditorSession.ts
+++ b/src/backend/creationEditorSession.ts
@@ -1,10 +1,18 @@
-import type { CanvasItem, ProjectSnapshot } from "../contracts/generated.ts";
+import type {
+ BatchPayloadInput,
+ CanvasItem,
+ ProjectSnapshot,
+} from "../contracts/generated.ts";
import type { CanvasDocument, CanvasNodeData } from "../canvas/model.ts";
import { applyCommand } from "../canvas/model.ts";
import { updateStack } from "../canvas/operations.ts";
+import { ApiError } from "./api.ts";
import {
CreationClient,
CreationCommandError,
+ CreationDeliveryUnknownError,
+ CreationEditSupersededError,
+ CreationPriorOperationResolvedError,
objectVersion,
} from "./creationClient.ts";
import { rememberPendingPlacement } from "./pendingMediaPlacement.ts";
@@ -81,9 +89,12 @@ export class CreationEditorSession {
/* Do not invalidate a business operation on preference failure. */
}
}
- async apply(data: Partial) {
+ async apply(
+ data: Partial,
+ afterDraft?: BatchPayloadInput["operations"][number],
+ ) {
if (this.active) throw new Error(tNow("errors.backend.editSaving"));
- const key = JSON.stringify(data);
+ const key = JSON.stringify(afterDraft ? { data, afterDraft } : data);
const resolvingPrevious = !!this.pending && this.pending.key !== key;
this.active = true;
try {
@@ -114,6 +125,7 @@ export class CreationEditorSession {
)
plan.versions.push(version);
}
+ if (afterDraft) plan.operations.push(afterDraft);
if (!plan.operations.length) {
plan.operations.push({
type: "canvas.update",
@@ -163,9 +175,7 @@ export class CreationEditorSession {
if (superseded) {
this.pending = undefined;
this.storePending();
- throw new Error(
- tNow("errors.backend.editChangedAfterSave"),
- );
+ throw new CreationEditSupersededError();
}
this.projection.baseline = document;
this.projection.basis = this.projection.client.snapshot;
@@ -173,16 +183,24 @@ export class CreationEditorSession {
this.storePending();
this.unplaced = undefined;
if (resolvingPrevious)
- throw new Error(
- tNow("errors.backend.priorEditSaved"),
- );
+ throw new CreationPriorOperationResolvedError(receipt);
+ return receipt;
} catch (error) {
// Only a definitive rejection releases the operation. Its version basis
// remains unchanged: retrying must not silently overwrite a newer edit.
- if (error instanceof CreationCommandError) {
+ // This session treats these transport-level 4xx statuses as definitive,
+ // so a delivery refused at the HTTP boundary (for example one prepared
+ // by an older schema) is not replayed forever from stored state.
+ if (
+ error instanceof CreationCommandError ||
+ (error instanceof ApiError &&
+ [400, 401, 403, 413, 422].includes(error.status ?? 0))
+ ) {
this.pending = undefined;
this.storePending();
}
+ if(this.pending && error instanceof ApiError)
+ throw new CreationDeliveryUnknownError(this.pending.id,error);
throw error;
} finally {
this.active = false;
diff --git a/src/backend/creationProjection.ts b/src/backend/creationProjection.ts
index 8a63d3552..697cb7497 100644
--- a/src/backend/creationProjection.ts
+++ b/src/backend/creationProjection.ts
@@ -28,10 +28,12 @@ import {
type GenerationSettings,
} from "../canvas/model.ts";
import { tNow } from "../i18n/messages.ts";
+import { translateNow } from "../canvas/assistantTranslate.ts";
import {
createLocalStage,
parseLocalStageValue,
} from "../canvas/stageDocument.ts";
+import { assertStageStoryboard } from "../canvas/stageStoryboard.ts";
import { mediaBlobDataUrl } from "../canvas/localMediaRuntime.ts";
import { generationContentPatch } from "../canvas/generationReferenceContent.ts";
import { assemblyResource, staleAssembly } from "../canvas/editorAssembly.ts";
@@ -56,10 +58,39 @@ import {
import { copyMotionWebDoc, type MotionWebDoc } from "../canvas/motion/motionWebDoc.ts";
import { sanitizeMotionChatHistory } from "../canvas/motion/motionPresets.ts";
+/**
+ * Stage object names are free display text; the backend upload name must
+ * stay path-free, control-free and within its 255-character limit. The cut
+ * counts code points, never splitting a surrogate pair.
+ */
+export function stageUploadTitle(name: string, format: string): string {
+ const safe =
+ Array.from(name.replace(/[/\\\u0000-\u001f]+/g, "_").trim())
+ .slice(0, 250)
+ .join("") || tNow("editors.stage.ui.objectGltf");
+ return `${safe}.${format}`;
+}
+
/** Every comparison here is over a document that carries its media inline, so
* it reads the values instead of serializing both sides to compare strings. */
const same = sameJsonValue;
+/**
+ * A Director Stage enters or changes the project only with a continuous Storyboard.
+ *
+ * This is the frontend write boundary for editor.create and director.apply: a
+ * discontinuous Storyboard is refused with the localized reason before a command exists,
+ * and the backend validates the same rule again when the command is applied.
+ */
+function checkDirectorStoryboard(document: EditorDocumentInput): void {
+ if (document.kind !== "director") return;
+ // The command payload may omit the block list, which then means none.
+ assertStageStoryboard(
+ { ...document.data, shots: document.data.shots ?? [] },
+ translateNow,
+ );
+}
+
/** Retained links are compared field by field: the snapshot keeps the original
* relation, and the server skips a connection whose value did not change. */
function sameConnection(
@@ -156,6 +187,9 @@ export class CreationProjection {
fileBytes?: boolean;
identity?: string;
fresh?: boolean;
+ /** A publication persists this handle before uploading so a reload can
+ * retry the same staged bytes instead of creating a new asset identity. */
+ uploadHandle?: string;
previous?: AssetRef;
/** Archive provenance: the backend records an imported source instead of
* treating the upload as a plain user file. */
@@ -212,7 +246,10 @@ export class CreationProjection {
const name = /\.[\w]+$/.test(resource.title)
? resource.title
: `${resource.title}.${suffix}`;
- const handle = this.importHandles.get(key) ?? crypto.randomUUID();
+ const handle =
+ resource.uploadHandle ??
+ this.importHandles.get(key) ??
+ crypto.randomUUID();
this.importHandles.set(key, handle);
return this.client.importBlob(
blob,
@@ -460,14 +497,43 @@ export class CreationProjection {
},
};
case "director":
- return {
- external: { externalType: "director-stage" },
- localStage: parseLocalStageValue({
- format: "opendirector-local-stage",
- version: 2,
- ...doc.data,
- }),
- };
+ {
+ const objects = doc.data.objects.map((object) => {
+ const source =
+ object.kind === "gltf" && object.asset
+ ? assetSource(this.client.id, object.asset.assetId)
+ : undefined;
+ const thumbnailSource = object.thumbnailAsset
+ ? assetSource(this.client.id, object.thumbnailAsset.assetId)
+ : undefined;
+ return {
+ ...object,
+ ...(source ? { source } : {}),
+ ...(thumbnailSource ? { thumbnailSource } : {}),
+ };
+ });
+ const stills = doc.data.stills.map((asset) => ({
+ // Drawer-local identity; the contract stores the order itself.
+ id: asset.assetId,
+ asset,
+ src: assetSource(this.client.id, asset.assetId),
+ }));
+ return {
+ external: { externalType: "director-stage" },
+ localStage: parseLocalStageValue(
+ {
+ format: "opendirector-local-stage",
+ version: 2,
+ ...doc.data,
+ objects,
+ },
+ translateNow,
+ ),
+ stills,
+ // The newest still is the canvas poster when its preview reference is usable.
+ ...(stills.at(-1)?.src ? { src: stills.at(-1)!.src } : {}),
+ };
+ }
case "layers":
return {
layers: {
@@ -731,6 +797,14 @@ export class CreationProjection {
// Export records this so an imported generation node can be rebuilt
// with real provenance instead of a fabricated one.
const evidence = asset.provenance;
+ // Only director publications mark a stage preview; timeline renders
+ // share the 'rendered' source but are ordinary composition outputs.
+ const stagePreviewDoc =
+ evidence.source === "rendered" && evidence.editorDocumentId
+ ? snapshot.editorDocuments.find(
+ (doc) => doc.id === evidence.editorDocumentId,
+ )
+ : undefined;
node.data.generationProvenance = {
source: evidence.source,
...(evidence.jobId ? { jobId: evidence.jobId } : {}),
@@ -743,6 +817,9 @@ export class CreationProjection {
...(evidence.editorRevision != null
? { editorRevision: evidence.editorRevision }
: {}),
+ ...(stagePreviewDoc?.kind === "director"
+ ? { stagePreview: true }
+ : {}),
};
node.data.media = {
width: asset.metadata.width ?? undefined,
@@ -1437,12 +1514,93 @@ export class CreationProjection {
};
}
case "director": {
+ const stage = parseLocalStageValue(
+ node.data.localStage ?? createLocalStage(),
+ translateNow,
+ );
+ const objects = await Promise.all(
+ stage.objects.map(async (object) => {
+ const {
+ source: _source,
+ asset: _asset,
+ thumbnailAsset: _thumbnailAsset,
+ thumbnailCapture,
+ thumbnailSource: _thumbnailSource,
+ role: _role,
+ format: _format,
+ animationNames: _animationNames,
+ hasAnimation: _hasAnimation,
+ ...base
+ } = object;
+ const thumbnailAsset =
+ _thumbnailAsset ??
+ (thumbnailCapture
+ ? await this.importResource({
+ kind: "image",
+ title: `${node.data.title ?? tNow("errors.backend.directorStageTitle")}-${object.name}-thumbnail`,
+ src: thumbnailCapture,
+ })
+ : undefined);
+ if (object.kind !== "gltf")
+ return {
+ ...base,
+ ...(thumbnailAsset ? { thumbnailAsset } : {}),
+ };
+ const asset =
+ object.asset ??
+ (object.source
+ ? await this.importResource({
+ kind: "file",
+ title: stageUploadTitle(object.name, object.format!),
+ src: object.source,
+ })
+ : undefined);
+ if (!asset)
+ throw new Error(tNow("errors.backend.directorAssetMissing"));
+ return {
+ ...base,
+ asset,
+ ...(thumbnailAsset ? { thumbnailAsset } : {}),
+ role: object.role,
+ format: object.format,
+ animationNames: object.animationNames,
+ hasAnimation: object.hasAnimation,
+ };
+ }),
+ );
+ // Captures import in list order so the drawer keeps its sequence;
+ // items without new bytes keep their pinned asset identity.
+ // Byte-identical captures collapse to their first pin so one asset
+ // never backs two drawer entries.
+ const seenFingerprints = new Set();
+ const stills = (
+ await Promise.all(
+ (node.data.stills ?? []).map((item) =>
+ item.capture
+ ? this.importResource({
+ kind: "image",
+ title: node.data.title ?? "director-stage",
+ src: item.capture,
+ fresh: true,
+ })
+ : item.asset,
+ ),
+ )
+ ).filter((still): still is NonNullable => {
+ if (!still || seenFingerprints.has(still.fingerprint)) return false;
+ seenFingerprints.add(still.fingerprint);
+ return true;
+ });
const {
format: _format,
version: _version,
...data
- } = node.data.localStage ?? createLocalStage();
- return { ...common, kind, data };
+ } = stage;
+ return {
+ ...common,
+ kind,
+ data: { ...data, objects, stills },
+ };
}
case "image_crop": {
const crop = node.data.imageCrop!;
@@ -1759,12 +1917,15 @@ export class CreationProjection {
[...document.nodes, ...(document.hiddenNodes ?? [])],
materializedAssets,
);
- if (!current)
+ // Checked here, where the write is produced: a stored stage that is merely on the
+ // canvas is not written and must not block a save of something else.
+ if (!current) {
+ checkDirectorStoryboard(doc);
operations.push({
type: "editor.create",
payload: { document: doc },
});
- else {
+ } else {
const previous = await this.editorInput(
old ?? node,
kind as EditorDocument["kind"],
@@ -1773,11 +1934,13 @@ export class CreationProjection {
[...this.baseline.nodes, ...(this.baseline.hiddenNodes ?? [])],
);
if (!same(doc, previous)) {
+ checkDirectorStoryboard(doc);
expect("editor_document", current);
- operations.push({
- type: "editor.save",
- payload: { document: doc },
- });
+ operations.push(
+ doc.kind === "director"
+ ? { type: "director.apply", payload: { document: doc } }
+ : { type: "editor.save", payload: { document: doc } },
+ );
}
}
binding = {
diff --git a/src/backend/mediaPublication.ts b/src/backend/mediaPublication.ts
index b1136c20a..e0269f8ce 100644
--- a/src/backend/mediaPublication.ts
+++ b/src/backend/mediaPublication.ts
@@ -1,6 +1,7 @@
import type {
CanvasItem,
CanvasPublishMediaInput,
+ DirectorOutputPlanInput,
EditorDocument,
ProjectSnapshot,
MediaEditData,
@@ -30,9 +31,22 @@ type Delivery = {
key: string;
payload: CanvasPublishMediaInput;
versions: ReturnType[];
+ /** Stable slots are written before the first upload, so a failed later
+ * upload can resume without changing the already-imported outputs. */
+ prepared?: DeliverySlot[];
anchor?: { item: CanvasItem; commandId: string };
};
+type DeliverySlot = {
+ itemId: string;
+ title: string;
+ position: { x: number; y: number };
+ width: number;
+ height: number;
+ uploadHandle: string;
+ asset?: CanvasPublishMediaInput["outputs"][number]["asset"];
+};
+
/** Only command delivery is retained locally; output bytes are owned project assets. */
export class MediaPublication {
private pending?: Delivery;
@@ -83,7 +97,11 @@ export class MediaPublication {
/* The open session still owns its original delivery. */
}
}
- async publish(outputs: readonly LinkedMediaResult[], task?: CanvasToolTask) {
+ async publish(
+ outputs: readonly LinkedMediaResult[],
+ task?: CanvasToolTask,
+ directorPlan?: DirectorOutputPlanInput,
+ ) {
if (this.active) throw Error(tNow("errors.backend.savingResult"));
this.active = true;
try {
@@ -93,6 +111,7 @@ export class MediaPublication {
tool: task?.tool,
parameters: task?.parameters,
selection: task?.selection,
+ directorPlan,
}),
);
const key = [
@@ -102,6 +121,12 @@ export class MediaPublication {
.join("");
if (this.confirmed === key) return this.confirmedIds;
const resolvingPrevious = !!this.pending && this.pending.key !== key;
+ if (
+ resolvingPrevious &&
+ this.pending?.prepared &&
+ this.pending.payload.outputs.length < this.pending.prepared.length
+ )
+ throw Error(tNow("errors.backend.mediaPreparationPending"));
if (!this.pending && this.rejected?.key === key) {
this.pending = { ...this.rejected, id: crypto.randomUUID() };
this.remember();
@@ -134,7 +159,9 @@ export class MediaPublication {
inputConnections: [],
};
sourceEditorId = original.id;
- versions.push(objectVersion("editor_document", original));
+ // Accepted video publication validates its historical source; the
+ // current canvas version still protects binding and locks.
+ if (!directorPlan) versions.push(objectVersion("editor_document", original));
} else if (item.kind === "motion" && item.binding.role === "editor") {
const editorId = item.binding.objectRef.id;
const original = this.basis.editorDocuments.find(
@@ -206,44 +233,85 @@ export class MediaPublication {
x: start.x + item.width + 100,
y: start.y,
});
- const published = [];
- for (const [index, output] of outputs.entries()) {
- const asset = await this.projection.importResource({
- ...output,
- identity: `publication:${document.id}:${index}`,
- fresh: true,
- });
- versions.push(
- objectVersion("asset", {
- id: asset.assetId,
- revision: asset.revision,
- }),
- );
- published.push({
- itemId: crypto.randomUUID(),
- asset,
- title: output.title,
- position: placed[index]!.position,
- width: placed[index]!.width,
- height: placed[index]!.height,
- });
- }
this.pending = {
id: crypto.randomUUID(),
key,
versions,
+ prepared: outputs.map((output, index) => {
+ const placement = placed[index]!;
+ return {
+ itemId: crypto.randomUUID(),
+ title: output.title,
+ position: placement.position,
+ width: placement.width,
+ height: placement.height,
+ uploadHandle: crypto.randomUUID(),
+ };
+ }),
...(this.unplaced && { anchor: { item: this.unplaced, commandId: crypto.randomUUID() } }),
payload: {
itemId: item.id,
source: source ? assetReference(source) : null,
...(sourceEditorId ? { sourceEditorId } : {}),
document,
- outputs: published,
+ ...(directorPlan ? { directorPlan, directorAcceptedAt: this.basis.eventCursor } : {}),
+ outputs: [],
},
};
this.remember();
}
- const delivery = this.pending;
+ let delivery = this.pending;
+ if (!delivery) throw Error(tNow("errors.backend.savingResult"));
+ const prepared = delivery.prepared;
+ if (prepared) {
+ if (outputs.length !== prepared.length)
+ throw Error(tNow("errors.backend.mediaPreparationPending"));
+ for (
+ let index = delivery.payload.outputs.length;
+ index < prepared.length;
+ index++
+ ) {
+ const slot = prepared[index]!;
+ const output = outputs[index]!;
+ const asset = await this.projection.importResource({
+ ...output,
+ identity: `publication:${delivery.payload.document.id}:${index}`,
+ fresh: true,
+ uploadHandle: slot.uploadHandle,
+ });
+ delivery = {
+ ...delivery,
+ versions: [
+ ...delivery.versions,
+ objectVersion("asset", {
+ id: asset.assetId,
+ revision: asset.revision,
+ }),
+ ],
+ payload: {
+ ...delivery.payload,
+ outputs: [
+ ...delivery.payload.outputs,
+ {
+ itemId: slot.itemId,
+ asset,
+ title: slot.title,
+ position: slot.position,
+ width: slot.width,
+ height: slot.height,
+ },
+ ],
+ },
+ };
+ this.pending = delivery;
+ this.remember();
+ }
+ }
+ if (
+ delivery.prepared &&
+ delivery.payload.outputs.length !== delivery.prepared.length
+ )
+ throw Error(tNow("errors.backend.mediaPreparationPending"));
if (delivery.anchor) {
// A/V publication records a durable source item. Create it only once the
// user has produced outputs, and atomically keep it off the canvas.
@@ -255,7 +323,10 @@ export class MediaPublication {
{ type: "canvas.hide", payload: { itemId: item.id } },
] }, [objectVersion("asset", { id: source.assetId, revision: source.revision })], undefined, commandId);
} catch (error) {
- if (error instanceof CreationCommandError) delivery.anchor.commandId = crypto.randomUUID();
+ if (error instanceof CreationCommandError) {
+ delivery.anchor.commandId = crypto.randomUUID();
+ this.remember();
+ }
throw error;
}
// New objects start at revision 1, even across multiple operations in
diff --git a/src/canvas/DirectorStage.tsx b/src/canvas/DirectorStage.tsx
index 98e7a6de9..fa2612e7d 100644
--- a/src/canvas/DirectorStage.tsx
+++ b/src/canvas/DirectorStage.tsx
@@ -1,81 +1,732 @@
+import { removeStageCenterHandle } from "./stageGeometryControls.ts";
+import { CreationEditSupersededError, CreationPriorOperationResolvedError } from "../backend/creationClient.ts";
+import type { CameraMoveRequest, CameraMovePreflight, CameraMoveReview } from "./stageCameraMoves.ts";
+import { StageCameraMoveTrack } from "./StageCameraMoveTrack.tsx";
+import { stageWithCameraMove, cameraMoveDefaultParameters, CAMERA_MOVE_PRESETS, isTranslationMove, isOrbitMove, isAngularMove } from "./stageCameraMoves.ts";
+import { StageCameraMoveEditor } from "./StageCameraMoveEditor.tsx";
+import { type CameraMoveClip } from "./stageCameraMoves.ts";
+import { StagePanelHeading, StagePanelSearch } from "./DirectorStageChrome";
import { useEditorCommit, type EditorApplyResult } from "./useEditorCommit";
-import { useEffect, useRef, useState } from "react";
+import {
+ Fragment,
+ useEffect,
+ useId,
+ useMemo,
+ useReducer,
+ useRef,
+ useState,
+} from "react";
import * as THREE from "three";
import { OrbitControls } from "three/addons/controls/OrbitControls.js";
-import type { CanvasNode } from "./model";
+import {
+ TransformControls,
+} from "three/addons/controls/TransformControls.js";
+import { GLTFLoader } from "three/addons/loaders/GLTFLoader.js";
+import { clone as cloneSkinnedObject } from "three/addons/utils/SkeletonUtils.js";
+import type { CanvasNode, CanvasNodeData, StageStillItem } from "./model";
+import type {
+ Asset,
+ AssetRef,
+ DirectorOutputPlanInput,
+} from "../contracts/generated.ts";
import { ControlSlider } from "./ControlSlider";
+import {
+ InspectorColorProperty,
+ InspectorCompoundProperty,
+ InspectorPropertyList,
+ InspectorPropertyRow,
+ InspectorSection,
+ InspectorToggleProperty,
+} from "./inspector/InspectorPrimitives";
import {
createLocalStage,
parseLocalStageValue,
+ parseImportedStageValue,
+ normalizeLegacyDefaultPersonName,
+ probeStageAsset,
sampleStage,
+ sampleStageCamera,
+ sampleStageCameraEndpoint,
+ sampleStageCameraUp,
+ stageCameraEndpointId,
editStageObjectAt,
+ editStageObjectPlacement,
editStageCameraAt,
- captureStageFrame,
- stageFrameTimes,
- removeStageFrame,
+ editStageCameraEndpointAt,
+ captureStagePreviewFrame,
stageOutputSize,
+ unregisteredStageAssets,
+ sameLocalStage,
defaultStageCamera,
+ storedStagePreviewSource,
+ resolveStagePreviewSource,
+ sampleStagePreview,
+ sampleStageEditingViewport,
+ stagePreviewFrameTime,
+ stagePreviewCameraId,
+ stageStoryboardBlockAt,
STAGE_RATIOS,
+ STAGE_ASSET_MAX_BYTES,
} from "./stageDocument";
import type {
LocalStageDocument,
StageCamera,
+ StageCameraEndpointKind,
StageSample,
StageSampleObject,
StageMotionClip,
- StageShot,
StageObject,
StageTransform,
+ StageAssetRole,
+ StageTransition,
+ StageShot,
+ StagePreviewSource,
Vector3Value,
} from "./stageDocument";
+import {
+ createDirectorStageViewState,
+ directorStageViewReducer,
+ LAYOUT_LIMITS,
+} from "./directorStageViewState";
+import {
+ groundObject,
+ groundedPositionY,
+ STAGE_GROUND_LEVEL,
+} from "./stageGrounding.ts";
+import {
+ formatStageElevation,
+ layoutStageElevation,
+ stageElevationHeight,
+ stageElevationRingPath,
+ stageElevationRingRadius,
+ stageElevationScreenPoint,
+} from "./stageElevation.ts";
+import { stageValueWithUnit } from "./stageUnits.ts";
+import type {
+ DirectorStageLeftTab,
+ DirectorStageInteractionMode,
+ DirectorStageCameraPreset,
+ DirectorStageResizeTarget,
+ DirectorStageViewAction,
+} from "./directorStageViewState";
import {
commitStageHistory,
createStageHistory,
navigateStageHistory,
type StageHistory,
} from "./stageHistory";
-import { EditorModal } from "./EditorModal";
import "./director-stage.css";
-import { STAGE_MOTIONS, sampleJointPose } from "./stageMotion";
+import {
+ STAGE_MOTIONS,
+ sampleJointPose,
+ selectStageAnimation,
+ type StageMotion,
+} from "./stageMotion";
import { encodeMp4 } from "./mp4Export";
+import {
+ projectStageEnvironment,
+ STAGE_GROUND_NAME,
+ STAGE_GRID_NAME,
+ STAGE_LIGHT_NAMES,
+ STAGE_ENVIRONMENT_PRESETS,
+ type StageEnvironmentDescriptor,
+} from "./stageEnvironment.ts";
+import { updateStageGroundFade } from "./stageGroundFade.ts";
+import {
+ createStageInfiniteGrid,
+ updateStageInfiniteGrid,
+ updateStageInfiniteGridObjects,
+ type StageInfiniteGrid,
+} from "./stageInfiniteGrid.ts";
import { downloadFile, downloadFilename } from "./assets";
+import {
+ assetReference,
+ fetchMediaSource,
+ resolveMediaSource,
+} from "../backend/creationClient.ts";
+import { AssetMedia, useAssetMedia } from "./useAssetMedia.tsx";
import { withMediaDuration } from "./editorMedia";
import { mediaBlobDataUrl } from "./localMediaRuntime";
import type { LinkedMediaResult } from "./linkedResults";
import { useI18n } from "../i18n/I18nProvider.tsx";
import type { MessageKey } from "../i18n/types.ts";
+import {
+ groupStageTimelineTracks,
+ projectStageTimeline,
+ stageTimelineIntervals,
+ stageTimelineIntervalTransition,
+ stageTimelineRuler,
+ stageTimeToFrame,
+ snapStageTimelineTime,
+ addStageTimelineKeyframeAt,
+ removeStageTimelineKeyframe,
+ type StageTimelineChannel,
+ type StageTimelineTrack,
+ setStageTimelineIntervalTransition,
+ type StageTimelineIntervalTarget,
+ type StageTimelineKeyframeAddTarget,
+ type StageTimelineKeyframeTarget,
+ type StageTimelineStoryboardInterval,
+} from "./stageTimeline.ts";
+import {
+ stageExportPlan,
+ mergeStageStoryboardBlock,
+ packStageStoryboard,
+ readStageStoryboard,
+ sameStageStoryboard,
+ type StageCutEdit,
+ type StageCutReceipt,
+ stageStoryboardIssueMessageKey,
+} from "./stageStoryboard.ts";
+import { StageStoryboardChooser } from "./StageStoryboardChooser.tsx";
+import {
+ StageStoryboardTrack,
+ type StageStoryboardThumbnailShot,
+} from "./StageStoryboardTrack.tsx";
+import { StagePreviewSourceSelect } from "./StagePreviewSourceSelect.tsx";
+import {
+ captureStageStoryboardThumbnail,
+ copyStageViewportPixels,
+ poseStagePreviewCamera,
+ setStageCameraUp,
+} from "./stageStoryboardThumbnailRender.ts";
+import { stageStoryboardThumbnailSize } from "./stageStoryboardThumbnail.ts";
export interface DirectorStageProps {
+ onPreviewCameraMove?: (input: CameraMoveRequest) => Promise;
+ onApplyCameraMove?: (input: CameraMoveRequest) => Promise<{stage:LocalStageDocument;before:LocalStageDocument;commandId?:string}>;
node: CanvasNode;
onApply: (
stage: LocalStageDocument,
- screenshot?: string,
+ stills?: StageStillItem[],
) => EditorApplyResult;
onClose: () => void;
onRender: (result: LinkedMediaResult) => boolean | Promise;
onPrepareRender?: (
stage: LocalStageDocument,
+ stills?: StageStillItem[],
+ directorPlan?: DirectorOutputPlanInput,
) => Promise<(result: LinkedMediaResult) => Promise>;
+ /** Appends an existing camera to the open stage's Storyboard through the shared
+ * `director.storyboard.append` command and returns the block as the server stored it. */
+ onAppendStoryboard?: (input: {
+ cameraId: string;
+ blockId: string;
+ /** An unsaved draft was just committed through `onApply` before this call. */
+ savedDraft?: boolean;
+ }) => Promise;
+ onEditStoryboard?: (input: StageCutEdit & {
+ before: readonly StageShot[];
+ draft?: Pick;
+ }) => Promise;
+ /** Whether a pinned asset is registered in the currently open project;
+ * stage JSON imports reject objects pinning assets it reports as absent. */
+ isRegisteredAsset?: (asset: AssetRef) => boolean;
+ backgroundAssets?: readonly Asset[];
+ resolveAssetUrl?: (asset: AssetRef) => Promise;
+ onImportBackground?: (file: File) => Promise;
+}
+
+const STAGE_TIMELINE_RULER_HEIGHT = 27;
+const STAGE_TIMELINE_GROUP_ROW_HEIGHT = 22;
+const STAGE_TIMELINE_TRACK_ROW_HEIGHT = 20;
+/** The Storyboard row is taller than an ordinary one, so a block can hold a thumbnail.
+ * The track surface receives it as a custom property: the rows the CSS lays out and
+ * the height this file computes for the surface are the same number. */
+const STAGE_TIMELINE_STORYBOARD_ROW_HEIGHT = 40;
+const STAGE_TIMELINE_SURFACE_PADDING = 0;
+/** What the split view's Storyboard tab samples: the Storyboard, whatever the preview
+ * source is. */
+const STORYBOARD_PREVIEW: StagePreviewSource = { kind: "storyboard" };
+const DEFAULT_BEZIER_CONTROL_POINTS: [number, number, number, number] = [
+ 0.333, 0.333, 0.667, 0.667,
+];
+
+function StageTransitionGraph({ transition }: { transition: StageTransition }) {
+ const [x1, y1, x2, y2] = transition.kind === "bezier"
+ ? transition.controlPoints
+ : DEFAULT_BEZIER_CONTROL_POINTS;
+ const size = 248;
+ const inset = 8;
+ const span = size - inset * 2;
+ const point = (x: number, y: number) =>
+ `${inset + x * span},${inset + (1 - y) * span}`;
+ return (
+
+ );
+}
+
+interface LoadedStageAsset {
+ scene: THREE.Object3D;
+ animations: THREE.AnimationClip[];
+}
+interface RestPose {
+ object: THREE.Object3D;
+ position: THREE.Vector3;
+ quaternion: THREE.Quaternion;
+ scale: THREE.Vector3;
+}
+interface ImportedRuntime {
+ root: THREE.Group;
+ clips: THREE.AnimationClip[];
+ mixer?: THREE.AnimationMixer;
+ activeClip?: THREE.AnimationClip;
+ restPose: RestPose[];
+}
+interface CameraHelperRuntime {
+ root: THREE.Group;
+ camera: THREE.Group;
+ viewpoint: THREE.Group;
+ cameraHitTarget: THREE.Mesh;
+ viewpointHitTarget: THREE.Mesh;
+ sightLine: THREE.LineSegments;
+ frustum: THREE.LineSegments;
}
interface StageRuntime {
renderer: THREE.WebGLRenderer;
scene: THREE.Scene;
camera: THREE.PerspectiveCamera;
controls: OrbitControls;
+ translate: TransformControls;
+ rotate: TransformControls;
+ scale: TransformControls;
root: THREE.Group;
- grid: THREE.GridHelper;
+ grid: StageInfiniteGrid;
+ /** Viewport-local helper group (motion paths, height guides). */
+ helpers: THREE.Group;
+ /** Director-only camera and viewpoint handles. */
+ cameraHelpers: THREE.Group;
+ cameraRigs: Map;
+ imported: Map;
+ /** In-flight or resolved loads keyed by pinned asset id or source URL, so
+ * concurrent effect runs share one load and one set of GPU resources. */
+ assetCache: Map>;
+}
+
+const STAGE_UNDERGROUND_GROUND_OPACITY = 0.45;
+
+function hasBelowGroundObject(root: THREE.Group, bounds: THREE.Box3): boolean {
+ for (const child of root.children) {
+ if (!child.visible) continue;
+ bounds.setFromObject(child);
+ if (!bounds.isEmpty() && bounds.min.y < STAGE_GROUND_LEVEL - 0.001)
+ return true;
+ }
+ return false;
+}
+
+/**
+ * The ground is opaque during normal output, but the director viewport needs
+ * to reveal a subject that intersects it. A translucent ground veil keeps the
+ * below-ground part visible without changing the saved transform or camera
+ * render.
+ */
+function setStageGroundReveal(ground: THREE.Mesh, reveal: boolean) {
+ if (!(ground.material instanceof THREE.MeshStandardMaterial)) return;
+ const material = ground.material;
+ const opacity = reveal ? STAGE_UNDERGROUND_GROUND_OPACITY : 1;
+ const transparent = reveal;
+ const depthWrite = !reveal;
+ if (
+ material.transparent === transparent &&
+ material.opacity === opacity &&
+ material.depthWrite === depthWrite
+ )
+ return;
+ material.transparent = transparent;
+ material.opacity = opacity;
+ material.depthWrite = depthWrite;
+ material.needsUpdate = true;
+}
+
+/** The orbit camera is a viewport concern, never the persisted stage camera. */
+const DEFAULT_DIRECTOR_VIEW: StageCamera = {
+ position: { x: 8, y: 6, z: 10 },
+ target: { x: 0, y: 1, z: 0 },
+ fov: 45,
+};
+const CAMERA_HELPER_DISPLAY_SCALE = 0.25;
+const VIEWPOINT_HELPER_DISPLAY_SCALE = 0.4;
+const CAMERA_ENDPOINT_HIT_RADIUS = 0.24;
+const VIEWPOINT_ENDPOINT_HIT_RADIUS = 0.2;
+function applyStageEnvironment(
+ scene: THREE.Scene,
+ descriptor: StageEnvironmentDescriptor,
+ groundVisible = descriptor.ground.visible,
+ renderer?: THREE.WebGLRenderer,
+) {
+ scene.background = new THREE.Color(descriptor.backgroundColor);
+ if (renderer) {
+ renderer.toneMapping = THREE.LinearToneMapping;
+ renderer.toneMappingExposure = descriptor.exposure;
+ }
+ const ground = scene.getObjectByName(STAGE_GROUND_NAME);
+ if (ground instanceof THREE.Mesh && ground.material instanceof THREE.MeshStandardMaterial) {
+ ground.material.color.set(descriptor.ground.color);
+ updateStageGroundFade(
+ ground.material,
+ descriptor.backgroundColor,
+ descriptor.backgroundAsset === null,
+ );
+ ground.visible = groundVisible;
+ }
+ for (const light of Object.values(descriptor.lights)) {
+ const object = scene.getObjectByName(STAGE_LIGHT_NAMES[light.id]);
+ if (!(object instanceof THREE.Light)) continue;
+ object.color.set(light.color);
+ object.intensity = light.intensity;
+ object.position.set(light.position.x, light.position.y, light.position.z);
+ object.castShadow = light.castShadow;
+ }
}
-const vector = (value: THREE.Vector3): Vector3Value => ({
+async function applyStageBackground(
+ scene: THREE.Scene,
+ descriptor: StageEnvironmentDescriptor,
+ resolveAssetUrl?: (asset: AssetRef) => Promise,
+ isCurrent: () => boolean = () => true,
+) {
+ scene.background = new THREE.Color(descriptor.backgroundColor);
+ if (!descriptor.backgroundAsset || !resolveAssetUrl) return false;
+ try {
+ const url = await resolveAssetUrl(descriptor.backgroundAsset);
+ const texture = await new THREE.TextureLoader().loadAsync(url);
+ if (!isCurrent()) {
+ texture.dispose();
+ return false;
+ }
+ texture.colorSpace = THREE.SRGBColorSpace;
+ texture.userData.stageBackgroundAssetId = descriptor.backgroundAsset.assetId;
+ scene.background = texture;
+ return true;
+ } catch {
+ return false;
+ }
+}
+const vector = (value: THREE.Vector3 | THREE.Euler): Vector3Value => ({
x: value.x,
y: value.y,
z: value.z,
});
+const THUMBNAIL_RENDER_SIZE = { width: 256, height: 192 } as const;
+const THUMBNAIL_CROP_SIZE = { width: 192, height: 112 } as const;
+const THUMBNAIL_ZERO_TRANSFORM: StageTransform = {
+ position: { x: 0, y: 0, z: 0 },
+ rotation: { x: 0, y: 0, z: 0 },
+ scale: { x: 1, y: 1, z: 1 },
+};
+
+function cropStageThumbnail(renderer: THREE.WebGLRenderer): string {
+ const source = renderer.domElement;
+ const canvas = document.createElement("canvas");
+ canvas.width = THUMBNAIL_CROP_SIZE.width;
+ canvas.height = THUMBNAIL_CROP_SIZE.height;
+ const context = canvas.getContext("2d");
+ if (!context) throw new Error("Stage thumbnail canvas is unavailable");
+ const cropX = Math.max(
+ 0,
+ Math.floor((source.width - THUMBNAIL_CROP_SIZE.width) / 2),
+ );
+ const cropY = Math.max(
+ 0,
+ Math.floor((source.height - THUMBNAIL_CROP_SIZE.height) / 2),
+ );
+ context.drawImage(
+ source,
+ cropX,
+ cropY,
+ THUMBNAIL_CROP_SIZE.width,
+ THUMBNAIL_CROP_SIZE.height,
+ 0,
+ 0,
+ THUMBNAIL_CROP_SIZE.width,
+ THUMBNAIL_CROP_SIZE.height,
+ );
+ return canvas.toDataURL("image/png");
+}
+
+function renderStageObjectModelThumbnail(
+ model: THREE.Group,
+ modelSharesAssetResources: boolean,
+ frontPortrait = false,
+): string | null {
+ let renderer: THREE.WebGLRenderer | null = null;
+ let ground: THREE.Mesh | null = null;
+ try {
+ renderer = new THREE.WebGLRenderer({
+ antialias: true,
+ alpha: false,
+ preserveDrawingBuffer: true,
+ });
+ renderer.setPixelRatio(1);
+ const frameSize = frontPortrait ? THUMBNAIL_CROP_SIZE : THUMBNAIL_RENDER_SIZE;
+ renderer.setSize(frameSize.width, frameSize.height, false);
+ renderer.shadowMap.enabled = true;
+ renderer.shadowMap.type = THREE.PCFShadowMap;
+ renderer.outputColorSpace = THREE.SRGBColorSpace;
+
+ const scene = new THREE.Scene();
+ scene.background = new THREE.Color("#171717");
+ scene.add(new THREE.HemisphereLight("#d9e5ff", "#222222", 1.6));
+ const keyLight = new THREE.DirectionalLight("#ffffff", 3.2);
+ keyLight.position.set(3, 5, 4);
+ keyLight.castShadow = true;
+ scene.add(keyLight);
+ const fillLight = new THREE.DirectionalLight("#7190c8", 1.1);
+ fillLight.position.set(-3, 2, -2);
+ scene.add(fillLight);
+
+ ground = new THREE.Mesh(
+ new THREE.PlaneGeometry(8, 8),
+ new THREE.MeshStandardMaterial({ color: "#242424", roughness: 0.92 }),
+ );
+ ground.rotation.x = -Math.PI / 2;
+ ground.receiveShadow = true;
+ scene.add(ground);
+
+ scene.add(model);
+ scene.updateMatrixWorld(true);
+
+ const bounds = new THREE.Box3().setFromObject(model);
+ if (frontPortrait) {
+ // Keep the person centered over the origin with its lowest point on y=0.
+ model.position.y -= bounds.min.y;
+ bounds.translate(new THREE.Vector3(0, -bounds.min.y, 0));
+ }
+ const center = bounds.getCenter(new THREE.Vector3());
+ const size = bounds.getSize(new THREE.Vector3());
+ const extent = Math.max(size.x, size.y, size.z, 0.5);
+ const camera = new THREE.PerspectiveCamera(
+ 32,
+ frameSize.width / frameSize.height,
+ 0.01,
+ 100,
+ );
+ const verticalHalfAngle = Math.tan(THREE.MathUtils.degToRad(camera.fov / 2));
+ if (frontPortrait) {
+ // Fit the full bounds on the final image, with room around head and feet.
+ const fit = Math.max(size.y, size.x / camera.aspect);
+ const distance = size.z / 2 + (fit * 1.2) / (2 * verticalHalfAngle);
+ camera.position.set(center.x, center.y, center.z + distance);
+ } else {
+ const distance = extent / (2 * verticalHalfAngle);
+ camera.position.set(
+ center.x + distance * 0.85,
+ center.y + extent * 0.25,
+ center.z + distance * 1.15,
+ );
+ }
+ camera.lookAt(center);
+ camera.updateProjectionMatrix();
+ renderer.render(scene, camera);
+ return frontPortrait
+ ? renderer.domElement.toDataURL("image/png")
+ : cropStageThumbnail(renderer);
+ } catch {
+ return null;
+ } finally {
+ if (ground) {
+ ground.geometry.dispose();
+ if (ground.material instanceof THREE.Material) ground.material.dispose();
+ }
+ if (!modelSharesAssetResources) disposeObject(model);
+ renderer?.forceContextLoss();
+ renderer?.dispose();
+ }
+}
+
+function renderStageObjectThumbnailNow(
+ value: StageObject,
+ loaded?: LoadedStageAsset,
+): string | null {
+ const normalized: StageObject = {
+ ...value,
+ ...THUMBNAIL_ZERO_TRANSFORM,
+ };
+ if (loaded) {
+ normalized.source = value.source;
+ return renderStageObjectModelThumbnail(
+ cloneImportedAsset(normalized, loaded),
+ true,
+ );
+ }
+ return renderStageObjectModelThumbnail(
+ buildObject(normalized),
+ false,
+ value.kind === "person",
+ );
+}
+
+function StageObjectPreview({
+ object,
+ portrait,
+}: {
+ portrait?: string;
+ object: Pick<
+ StageObject,
+ "kind" | "color" | "thumbnailCapture" | "thumbnailSource"
+ >;
+}) {
+ const thumbnail = portrait ?? object.thumbnailCapture ?? object.thumbnailSource;
+ const media = useAssetMedia(thumbnail);
+ const ready = Boolean(thumbnail && media.state === "ready" && media.src);
+ return (
+
+ {ready ? (
+
+ ) : (
+
+ )}
+
+ );
+}
+
+function materializeStageThumbnails(
+ stage: LocalStageDocument,
+): LocalStageDocument {
+ let changed = false;
+ const objects = stage.objects.map((object) => {
+ if (
+ object.thumbnailCapture ||
+ object.thumbnailSource ||
+ object.kind === "gltf"
+ )
+ return object;
+ const thumbnailCapture = renderStageObjectThumbnailNow(object);
+ if (!thumbnailCapture) return object;
+ changed = true;
+ return { ...object, thumbnailCapture };
+ });
+ return changed ? { ...stage, objects } : stage;
+}
+
+type CameraPresetId = DirectorStageCameraPreset;
+const CAMERA_PRESETS: Record = {
+ frontMedium: { offset: { x: 0, y: 0.6, z: 6 }, fov: 45 },
+ frontClose: { offset: { x: 0, y: 0.5, z: 2.6 }, fov: 40 },
+ frontWide: { offset: { x: 0, y: 2.2, z: 11 }, fov: 50 },
+ sideTrack: { offset: { x: 6, y: 0.6, z: 0.6 }, fov: 45 },
+ sideClose: { offset: { x: 2.6, y: 0.4, z: 0.4 }, fov: 40 },
+ backMedium: { offset: { x: 0, y: 0.9, z: -6 }, fov: 45 },
+ overheadWide: { offset: { x: 0, y: 10, z: 3.5 }, fov: 50 },
+ highAngle: { offset: { x: 3.5, y: 3.5, z: 3.5 }, fov: 45 },
+ lowAngle: { offset: { x: 0, y: -0.5, z: 4 }, fov: 40 },
+ lowWide: { offset: { x: 0, y: -0.6, z: 7 }, fov: 75 },
+ overShoulder: { offset: { x: 1.1, y: 0.35, z: 2.1 }, fov: 42 },
+ bird: { offset: { x: 0, y: 13, z: 0.01 }, fov: 45 },
+ dutch: { offset: { x: 0, y: 0.8, z: 5.5 }, fov: 45, roll: 0.32 },
+};
+function cameraPresetPoseForObject(
+ preset: CameraPresetId,
+ subject: Pick,
+): StageCamera {
+ const spec = CAMERA_PRESETS[preset];
+ const center = {
+ x: subject.position.x,
+ y: subject.position.y + (subject.kind === "person" ? 1.3 : 0.5),
+ z: subject.position.z,
+ };
+ // Preset offsets describe a camera in the object's local X/Z plane. Rotate
+ // that offset by the sampled subject yaw so "front" follows the subject.
+ const cos = Math.cos(subject.rotation.y);
+ const sin = Math.sin(subject.rotation.y);
+ const offset = {
+ x: spec.offset.x * cos + spec.offset.z * sin,
+ y: spec.offset.y,
+ z: -spec.offset.x * sin + spec.offset.z * cos,
+ };
+ return {
+ position: {
+ x: center.x + offset.x,
+ y: center.y + offset.y,
+ z: center.z + offset.z,
+ },
+ target: center,
+ fov: spec.fov,
+ roll: spec.roll ?? 0,
+ };
+}
const axes = ["x", "y", "z"] as const;
const titles: Record = {
person: "editors.stage.ui.objectPerson",
box: "editors.stage.ui.objectBox",
sphere: "editors.stage.ui.objectSphere",
+ cylinder: "editors.stage.ui.objectCylinder",
+ cone: "editors.stage.ui.objectCone",
+ pyramid: "editors.stage.ui.objectPyramid",
+ torus: "editors.stage.ui.objectTorus",
+ plane: "editors.stage.ui.objectPlane",
+ capsule: "editors.stage.ui.objectCapsule",
+ disk: "editors.stage.ui.objectDisk",
+ arc: "editors.stage.ui.objectArc",
+ halfCylinder: "editors.stage.ui.objectHalfCylinder",
+ gltf: "editors.stage.ui.objectGltf",
};
+const BUILTIN_CHARACTER_KINDS = ["person"] as const;
+const BUILTIN_OBJECT_KINDS = [
+ "box",
+ "sphere",
+ "cylinder",
+ "cone",
+ "pyramid",
+ "torus",
+ "plane",
+ "capsule",
+ "disk",
+ "arc",
+ "halfCylinder",
+] as const;
+
+function defaultStageObjectColor(kind: StageObject["kind"]): string {
+ if (kind === "person") return "#d0d0d0";
+ if (kind === "gltf") return "#b8c5ff";
+ return kind === "box" ? "#c4c4c4" : "#b8b8b8";
+}
+
+function createStageObjectTemplate(
+ kind: StageObject["kind"],
+ name: string,
+ id: string,
+): StageObject {
+ return {
+ id,
+ kind,
+ name,
+ color: defaultStageObjectColor(kind),
+ position: { x: 0, y: 0, z: 0 },
+ rotation: { x: 0, y: 0, z: 0 },
+ scale: { x: 1, y: 1, z: 1 },
+ visible: true,
+ locked: false,
+ opacity: 1,
+ keyframes: [],
+ motionClips: [],
+ };
+}
function applyTransform(object: THREE.Object3D, value: StageTransform) {
object.position.set(value.position.x, value.position.y, value.position.z);
object.rotation.set(value.rotation.x, value.rotation.y, value.rotation.z);
@@ -84,6 +735,13 @@ function applyTransform(object: THREE.Object3D, value: StageTransform) {
function buildObject(value: StageObject): THREE.Group {
const group = new THREE.Group();
group.userData.objectId = value.id;
+ group.userData.objectKind = value.kind;
+ if (value.kind === "gltf") {
+ group.userData.assetSource = value.source;
+ // The translucent box owns exclusive GPU resources, unlike loaded
+ // clones that share them with the cached scene.
+ group.userData.placeholder = true;
+ }
const material = new THREE.MeshStandardMaterial({
color: value.color,
roughness: 0.58,
@@ -104,7 +762,38 @@ function buildObject(value: StageObject): THREE.Group {
if (value.kind === "box") add(new THREE.BoxGeometry(1, 1, 1), 0, 0.5, 0);
else if (value.kind === "sphere")
add(new THREE.SphereGeometry(0.6, 32, 24), 0, 0.6, 0);
- else {
+ else if (value.kind === "cylinder")
+ add(new THREE.CylinderGeometry(0.5, 0.5, 1.4, 32), 0, 0.7, 0);
+ else if (value.kind === "cone")
+ add(new THREE.ConeGeometry(0.6, 1.4, 32), 0, 0.7, 0);
+ else if (value.kind === "pyramid")
+ add(new THREE.ConeGeometry(0.7, 1.2, 4), 0, 0.6, 0);
+ else if (value.kind === "torus")
+ add(new THREE.TorusGeometry(0.55, 0.2, 20, 40), 0, 0.75, 0);
+ else if (value.kind === "plane") {
+ const mesh = new THREE.Mesh(new THREE.PlaneGeometry(2, 2), material);
+ mesh.rotation.x = -Math.PI / 2;
+ mesh.position.y = 0.02;
+ mesh.receiveShadow = true;
+ group.add(mesh);
+ } else if (value.kind === "capsule")
+ add(new THREE.CapsuleGeometry(0.35, 0.9, 8, 16), 0, 0.8, 0);
+ else if (value.kind === "disk")
+ add(new THREE.CylinderGeometry(0.8, 0.8, 0.12, 40), 0, 0.06, 0);
+ else if (value.kind === "arc")
+ add(new THREE.TorusGeometry(0.7, 0.16, 16, 40, Math.PI), 0, 0.16, 0);
+ else if (value.kind === "halfCylinder")
+ add(
+ new THREE.CylinderGeometry(0.6, 0.6, 1.2, 32, 1, false, 0, Math.PI),
+ 0,
+ 0.6,
+ 0,
+ );
+ else if (value.kind === "gltf") {
+ material.transparent = true;
+ material.opacity = 0.35;
+ add(new THREE.BoxGeometry(1, 1, 1), 0, 0.5, 0);
+ } else {
const bone = (
parent: THREE.Object3D,
name: string,
@@ -149,6 +838,106 @@ function buildObject(value: StageObject): THREE.Group {
applyTransform(group, value);
return group;
}
+
+/** Measure a placement preview and return the root Y that puts its lowest
+ * rendered point on the business ground plane. Built-ins use the same geometry
+ * as the viewport; imported scenes use their authored bounds. */
+function groundedPlacementY(
+ value: StageObject,
+ desiredY: number,
+ sourceGroup?: THREE.Object3D,
+): number {
+ if (value.kind === "gltf" && !sourceGroup) return desiredY;
+ const probe = sourceGroup
+ ? sourceGroup.clone(true)
+ : buildObject({
+ ...value,
+ position: { ...value.position, y: desiredY },
+ rotation: { x: 0, y: 0, z: 0 },
+ scale: { x: 1, y: 1, z: 1 },
+ });
+ if (sourceGroup) {
+ probe.position.set(0, 0, 0);
+ probe.rotation.set(0, 0, 0);
+ probe.scale.set(1, 1, 1);
+ }
+ const nextY = groundedPositionY(probe, desiredY, STAGE_GROUND_LEVEL);
+ if (!sourceGroup) disposeObject(probe);
+ return nextY;
+}
+
+function cloneImportedAsset(
+ value: StageObject,
+ loaded: LoadedStageAsset,
+): THREE.Group {
+ const group = new THREE.Group();
+ group.userData.objectId = value.id;
+ group.userData.objectKind = value.kind;
+ group.userData.assetSource = value.source;
+ group.add(cloneSkinnedObject(loaded.scene));
+ applyTransform(group, value);
+ group.traverse((child) => {
+ if (child instanceof THREE.Mesh) {
+ child.castShadow = true;
+ child.receiveShadow = true;
+ }
+ });
+ return group;
+}
+async function loadStageAsset(source: string): Promise {
+ const resolved = await resolveMediaSource(source);
+ if (!resolved) throw new Error("Stage asset source is missing.");
+ const loaded = await new GLTFLoader().loadAsync(resolved);
+ return { scene: loaded.scene, animations: loaded.animations };
+}
+function createImportedRuntime(
+ group: THREE.Group,
+ clips: THREE.AnimationClip[],
+): ImportedRuntime {
+ const restPose: RestPose[] = [];
+ for (const child of group.children)
+ child.traverse((object) => {
+ restPose.push({
+ object,
+ position: object.position.clone(),
+ quaternion: object.quaternion.clone(),
+ scale: object.scale.clone(),
+ });
+ });
+ return {
+ root: group,
+ clips,
+ mixer: clips.length ? new THREE.AnimationMixer(group) : undefined,
+ restPose,
+ };
+}
+function applyImportedAnimation(
+ imported: Map,
+ value: StageSampleObject,
+) {
+ if (value.kind !== "gltf") return;
+ const binding = imported.get(value.id);
+ if (!binding?.mixer) return;
+ const clip = value.motion
+ ? selectStageAnimation(binding.clips, value.motion.preset)
+ : undefined;
+ if (binding.activeClip !== clip) {
+ binding.mixer.stopAllAction();
+ if (clip) binding.mixer.clipAction(clip).reset().play();
+ // Leaving a clip must return the skeleton to its authored rest pose;
+ // stopAllAction alone leaves bones at the last sampled pose.
+ else
+ for (const part of binding.restPose) {
+ part.object.position.copy(part.position);
+ part.object.quaternion.copy(part.quaternion);
+ part.object.scale.copy(part.scale);
+ }
+ binding.activeClip = clip;
+ }
+ binding.mixer.setTime(
+ clip && value.motion ? value.motionTime * value.motion.speed : 0,
+ );
+}
function poseJoints(group: THREE.Object3D, value: StageSampleObject) {
if (value.kind !== "person") return;
const pose = sampleJointPose(value.motion, value.motionTime);
@@ -170,6 +959,101 @@ function poseJoints(group: THREE.Object3D, value: StageSampleObject) {
if (elbow) elbow.rotation.x = pose[`${side}Elbow`];
}
}
+function updateLineSegments(
+ line: THREE.LineSegments,
+ points: THREE.Vector3[],
+) {
+ line.geometry.dispose();
+ line.geometry = new THREE.BufferGeometry().setFromPoints(points);
+}
+function buildCameraRigHelper(cameraId: string): CameraHelperRuntime {
+ const root = new THREE.Group();
+ root.userData.cameraRigId = cameraId;
+
+ const camera = new THREE.Group();
+ camera.userData.cameraEndpoint = {
+ id: stageCameraEndpointId(cameraId, "camera"),
+ cameraId,
+ kind: "camera" as const,
+ };
+ const body = new THREE.Mesh(
+ new THREE.BoxGeometry(0.36, 0.24, 0.44),
+ new THREE.MeshBasicMaterial({ color: 0x8ea6ff }),
+ );
+ body.position.z = -0.08;
+ camera.add(body);
+ camera.scale.setScalar(CAMERA_HELPER_DISPLAY_SCALE);
+
+ // Keep the visual marker small without making it frustratingly precise to
+ // select. These transparent meshes are director-only hit targets; their
+ // endpoint metadata is the same stable identity used by the visible group.
+ const cameraHitTarget = new THREE.Mesh(
+ new THREE.SphereGeometry(CAMERA_ENDPOINT_HIT_RADIUS, 8, 6),
+ new THREE.MeshBasicMaterial({
+ transparent: true,
+ opacity: 0,
+ depthWrite: false,
+ }),
+ );
+ cameraHitTarget.userData.cameraEndpoint = camera.userData.cameraEndpoint;
+
+ const viewpoint = new THREE.Group();
+ viewpoint.userData.cameraEndpoint = {
+ id: stageCameraEndpointId(cameraId, "viewpoint"),
+ cameraId,
+ kind: "viewpoint" as const,
+ };
+ viewpoint.add(
+ new THREE.Mesh(
+ new THREE.SphereGeometry(0.12, 16, 12),
+ new THREE.MeshBasicMaterial({ color: 0xffc861 }),
+ ),
+ );
+ viewpoint.scale.setScalar(VIEWPOINT_HELPER_DISPLAY_SCALE);
+ const viewpointHitTarget = new THREE.Mesh(
+ new THREE.SphereGeometry(VIEWPOINT_ENDPOINT_HIT_RADIUS, 8, 6),
+ new THREE.MeshBasicMaterial({
+ transparent: true,
+ opacity: 0,
+ depthWrite: false,
+ }),
+ );
+ viewpointHitTarget.userData.cameraEndpoint = viewpoint.userData.cameraEndpoint;
+
+ const sightLine = new THREE.LineSegments(
+ new THREE.BufferGeometry(),
+ new THREE.LineBasicMaterial({ color: 0xffc861 }),
+ );
+ const frustum = new THREE.LineSegments(
+ new THREE.BufferGeometry(),
+ new THREE.LineBasicMaterial({ color: 0x8ea6ff }),
+ );
+ root.add(camera, viewpoint, cameraHitTarget, viewpointHitTarget, sightLine, frustum);
+ return {
+ root,
+ camera,
+ viewpoint,
+ cameraHitTarget,
+ viewpointHitTarget,
+ sightLine,
+ frustum,
+ };
+}
+function cameraEndpointOf(
+ object: THREE.Object3D,
+): { id: string; cameraId: string; kind: StageCameraEndpointKind } | undefined {
+ const value: unknown = object.userData.cameraEndpoint;
+ if (typeof value !== "object" || value === null) return undefined;
+ if (!("id" in value) || typeof value.id !== "string") return undefined;
+ if (!("cameraId" in value) || typeof value.cameraId !== "string")
+ return undefined;
+ if (
+ !("kind" in value) ||
+ (value.kind !== "camera" && value.kind !== "viewpoint")
+ )
+ return undefined;
+ return { id: value.id, cameraId: value.cameraId, kind: value.kind };
+}
function disposeObject(object: THREE.Object3D) {
const materials = new Set();
object.traverse((child) => {
@@ -183,7 +1067,33 @@ function disposeObject(object: THREE.Object3D) {
});
materials.forEach((material) => material.dispose());
}
-function setCamera(runtime: StageRuntime, value: StageCamera) {
+/**
+ * A still is a clean frame. What only the director works with goes out of it for
+ * that one render and comes back afterwards: the camera rigs, the motion paths and
+ * guides, the grid and the gizmos. The preview surfaces and the Storyboard pictures
+ * leave the rigs and the gizmos out where they draw, and the export drops the rigs'
+ * group.
+ */
+function hideDirectorOnlyLayers(runtime: StageRuntime): () => void {
+ const layers = [
+ runtime.cameraHelpers,
+ runtime.helpers,
+ runtime.grid,
+ runtime.translate.getHelper(),
+ runtime.rotate.getHelper(),
+ runtime.scale.getHelper(),
+ ];
+ const visibility = layers.map((layer) => [layer, layer.visible] as const);
+ layers.forEach((layer) => {
+ layer.visible = false;
+ });
+ return () => {
+ visibility.forEach(([layer, visible]) => {
+ layer.visible = visible;
+ });
+ };
+}
+function setDirectorView(runtime: StageRuntime, value: StageCamera) {
runtime.camera.position.set(
value.position.x,
value.position.y,
@@ -193,122 +1103,1417 @@ function setCamera(runtime: StageRuntime, value: StageCamera) {
runtime.camera.updateProjectionMatrix();
runtime.controls.target.set(value.target.x, value.target.y, value.target.z);
runtime.controls.update();
+ applyRoll(runtime.camera, value);
}
-function displayPose(runtime: StageRuntime, pose: StageSample) {
- setCamera(runtime, pose.camera);
+/** Pose cameras carry roll; apply it after lookAt by rotating on the view axis. */
+function applyRoll(camera: THREE.PerspectiveCamera, value: StageCamera) {
+ camera.lookAt(value.target.x, value.target.y, value.target.z);
+ camera.rotateZ(value.roll ?? 0);
+}
+/** Pose the scene's objects as a sample has them at its time. The camera is not this
+ * function's: a thumbnail poses the objects for its own frame and then for the
+ * viewport's, and the viewport's camera is never moved. The viewport camera is the
+ * director's own view; stage cameras are drawn by poseCameraFor() in separate passes. */
+function displayObjects(runtime: StageRuntime, pose: StageSample) {
+ // The gizmo owns object transforms while a drag is in flight; an async
+ // GLTF-load or undo re-pose must not stomp it.
+ if (runtime.translate.dragging || runtime.rotate.dragging || runtime.scale.dragging) return;
for (const child of runtime.root.children) {
const data = pose.objects.find(
(item) => item.id === child.userData.objectId,
);
if (data) {
applyTransform(child, data);
+ child.visible = data.visible;
+ child.traverse((descendant) => {
+ if (descendant instanceof THREE.Mesh) {
+ const material = descendant.material as THREE.MeshStandardMaterial;
+ material.transparent = data.opacity < 1 || material.transparent;
+ material.opacity = data.opacity;
+ }
+ });
poseJoints(child, data);
+ applyImportedAnimation(runtime.imported, data);
}
}
}
+/** The one selected object glows faintly and nothing else does. It is a mark of the
+ * viewport, not of the scene: a thumbnail pictures the scene without it and puts it
+ * back by calling this again. */
+function tintStageSelection(root: THREE.Group, selectedId: string | null) {
+ root.traverse((child) => {
+ if (!(child instanceof THREE.Mesh)) return;
+ const material = child.material as THREE.MeshStandardMaterial;
+ let owner: THREE.Object3D | null = child;
+ while (owner && !owner.userData.objectId) owner = owner.parent;
+ material.emissive.set(
+ owner?.userData.objectId === selectedId ? "#1e1536" : "#000000",
+ );
+ });
+}
const focalLength = (fov: number) =>
35 / (16 / 9) / (2 * Math.tan(THREE.MathUtils.degToRad(fov) / 2));
const fovFromFocal = (focal: number) =>
THREE.MathUtils.radToDeg(2 * Math.atan(35 / (16 / 9) / (2 * focal)));
+const stageNumberStep = 0.01;
+const stagePositionMin = -20;
+const stagePositionMax = 20;
+const stageRotationMin = -180;
+const stageRotationMax = 180;
+const stageScaleMin = 0.01;
+const stageScaleMax = 4;
+const stageFovMin = 10;
+const stageFovMax = 120;
+const stageFocalMin = focalLength(stageFovMax);
+const stageFocalMax = focalLength(stageFovMin);
+const stageMotionSpeedMin = 0.1;
+const stageMotionSpeedMax = 4;
+const formatStageNumber = (value: number) => {
+ const rounded = Number(value.toFixed(2));
+ return Object.is(rounded, -0) ? "0" : String(rounded);
+};
+/** The aspect of an output size, as its width divided by its height. */
+const aspectOf = (size: { width: number; height: number }) =>
+ size.width / size.height;
+/** The shape of what a preview source shows. A camera that has an aspect of its own is
+ * previewed in that shape; a camera without one, and the Storyboard, take the stage's.
+ * The Storyboard is cut from its cameras but delivered as one video, so its frame does
+ * not change shape from block to block. The camera-preview frame is laid out with this
+ * value and its picture is posed with the same one. */
+function previewAspectOf(
+ stage: Pick,
+ source: StagePreviewSource,
+): number {
+ const rig =
+ source.kind === "camera"
+ ? stage.cameras.find((camera) => camera.id === source.cameraId)
+ : undefined;
+ return aspectOf(stageOutputSize(rig?.aspectRatio ?? stage.aspectRatio));
+}
+
+function StageAssetTabIcon({ tab }: { tab: DirectorStageLeftTab }) {
+ return (
+
+ );
+}
+
+type StageBackgroundFilter = "all" | "panoramic" | "flat";
+
+function StageBackgroundImageIcon() {
+ return (
+
+ );
+}
+
+function StageBackgroundPreview({
+ asset,
+ resolveAssetUrl,
+}: {
+ asset: Asset;
+ resolveAssetUrl?: (asset: AssetRef) => Promise;
+}) {
+ const [source, setSource] = useState("");
+ const { id, revision, fingerprint, kind } = asset;
+ useEffect(() => {
+ let active = true;
+ setSource("");
+ if (resolveAssetUrl)
+ void resolveAssetUrl({ assetId: id, revision, fingerprint, kind })
+ .then((url) => {
+ if (active) setSource(url);
+ })
+ .catch(() => {
+ if (active) setSource("");
+ });
+ return () => {
+ active = false;
+ };
+ }, [id, revision, fingerprint, kind, resolveAssetUrl]);
+ return (
+
+ {source ? (
+
+ ) : (
+
+
+
+ )}
+
+ );
+}
+
+type StageEdit = (operation: (current: LocalStageDocument) => LocalStageDocument) => void;
+type StageEnvironmentSelectValue = (typeof STAGE_ENVIRONMENT_PRESETS)[number]["preset"] | "custom";
+
+function currentEnvironmentPreset(stage: LocalStageDocument): StageEnvironmentSelectValue {
+ const preset = STAGE_ENVIRONMENT_PRESETS.find((candidate) =>
+ stage.background === candidate.background &&
+ stage.environment.groundColor === candidate.groundColor &&
+ stage.environment.groundVisible === candidate.groundVisible &&
+ stage.environment.exposure === candidate.exposure &&
+ stage.lights.every((light) => {
+ const expected = candidate.lights[light.id];
+ return light.color === expected.color &&
+ light.intensity === expected.intensity &&
+ light.castShadow === expected.castShadow &&
+ light.position.x === expected.position.x &&
+ light.position.y === expected.position.y &&
+ light.position.z === expected.position.z;
+ }),
+ );
+ return preset?.preset ?? "custom";
+}
+
+function StageEnvironmentControls({
+ stage,
+ backgroundAssets,
+ includeBackgroundAsset = false,
+ onApplyPreset,
+ onEdit,
+ onPreview,
+ onValueDragStart,
+ onValueDragCancel,
+}: {
+ stage: LocalStageDocument;
+ backgroundAssets?: readonly Asset[];
+ includeBackgroundAsset?: boolean;
+ onApplyPreset: (preset: (typeof STAGE_ENVIRONMENT_PRESETS)[number]["preset"]) => void;
+ onEdit: StageEdit;
+ onPreview?: StageEdit;
+ onValueDragStart?: () => void;
+ onValueDragCancel?: () => void;
+}) {
+ const { t } = useI18n();
+ const activePreset = currentEnvironmentPreset(stage);
+ const editEnvironment = (patch: Partial) =>
+ onEdit((current) => ({
+ ...current,
+ environment: { ...current.environment, ...patch },
+ }));
+ const previewEnvironment = (patch: Partial) =>
+ (onPreview ?? onEdit)((current) => ({
+ ...current,
+ environment: { ...current.environment, ...patch },
+ }));
+ return (
+ <>
+
+
+
+
+ onEdit((current) => ({ ...current, background }))} />
+ {includeBackgroundAsset && (
+
+
+
+ )}
+ editEnvironment({ groundColor })} />
+ editEnvironment({ groundVisible })} />
+ previewEnvironment({ exposure })}
+ onCommit={(exposure) => editEnvironment({ exposure })}
+ />
+
+ {stage.lights.map((light) => {
+ const roleLabel = t(`editors.stage.ui.light.${light.id}` as never);
+ const updateLight = (patch: Partial, preview = false) =>
+ (preview ? onPreview ?? onEdit : onEdit)((current) => ({
+ ...current,
+ lights: current.lights.map((candidate) =>
+ candidate.id === light.id ? { ...candidate, ...patch } : candidate,
+ ),
+ }));
+ const updateLightPosition = (
+ axis: keyof Vector3Value,
+ value: number,
+ preview = false,
+ ) => updateLight({ position: { ...light.position, [axis]: value } }, preview);
+ return (
+
+
+ updateLight({ color })} />
+ updateLight({ intensity }, true)}
+ onCommit={(intensity) => updateLight({ intensity })}
+ />
+
+
+
+ {treeGroups.cameras &&
+ stage.cameras
+ .filter((rig) => matchesTreeQuery(rig.name))
+ .map((rig) => (
+ // Clicking a camera or its viewpoint only selects it: neither writes
+ // the stored active camera nor moves the preview source.
+
+ )}
+ {/* The camera-preview frame: a handle to move it, the preview-source selector
+ while it is open, and a toggle to collapse it. The selector is the same
+ element the inspector shows, so the preview has one choice to make. The
+ stylesheet lays the frame out at --stage-pip-aspect, which follows what the
+ preview shows; the stage's own --stage-aspect stays one value. */}
+