From 52e26228c8bcd75611fc8afd5b8476ef84625aab Mon Sep 17 00:00:00 2001
From: gbarnai
Date: Thu, 3 Dec 2026 15:31:36 -0500
Subject: [PATCH 1/2] fix(track): Planar Track honours forward, backward and
already tracked, and reports held frames
track.planar read no `track` value and always tracked both ways into a new tracker. Forward now tracks from the reference time to the end, backward from the start to the reference time, both does both, and another value is refused. With `track` left out (the Tracker panel's Already tracked, and what the agent tool described), the layer's Perspective tracker is pinned onto the target without tracking again, or a clear error says there is none.
Frames that do not track still hold the last tracked surface (unchanged); they are now listed in the result's `held`, keyed with confidence 0 on the Planar Tracker, and counted in the Tracker panel's status line.
Tests: eight Rust unit tests on a textured plane moved by a known homography per frame (surface_track, each direction, a bad value, reuse, nothing to reuse, a held frame) and four backend tests through /api/rpc. CI runs the engine's Rust unit tests.
---
.../formvfx-harness/references/tools.md | 2 +-
.../formvfx-harness/references/tools.md | 2 +-
.github/workflows/ci.yml | 3 +
backend/HASHOUT_LOG.md | 6 +
backend/app/agent/tools.py | 2 +-
backend/tests/test_planar_track.py | 90 ++++++
frontend/HASHOUT_LOG.md | 6 +
frontend/src/panels/tracker.ts | 6 +-
native/fvx-core/HASHOUT_LOG.md | 8 +
native/fvx-core/src/engine/cmd/track.rs | 227 ++++++++++------
.../src/engine/cmd/track_planar_tests.rs | 257 ++++++++++++++++++
11 files changed, 523 insertions(+), 86 deletions(-)
create mode 100644 backend/tests/test_planar_track.py
create mode 100644 native/fvx-core/src/engine/cmd/track_planar_tests.rs
diff --git a/.agents/skills/formvfx-harness/references/tools.md b/.agents/skills/formvfx-harness/references/tools.md
index d21ca6e..5a7241a 100644
--- a/.agents/skills/formvfx-harness/references/tools.md
+++ b/.agents/skills/formvfx-harness/references/tools.md
@@ -145,7 +145,7 @@ Turns SVG markup into a shape layer (paths, fills, strokes, gradients, groups an
## planar_track
-Planar tracking: follows a flat surface (a screen, a sign, a wall, a tabletop) through footage and corner-pins another layer onto it. Draw a mask around the surface on the footage layer first (mask.new or layer.addMask, in layer pixels at the reference time). track forward, backward or both analyses the mask with the Perspective method from the reference time (a homography from features inside the mask, every frame); without track the mask must already be tracked. surface is the plane's four corners at the reference time (upper left, upper right, lower left, lower right, layer pixels; default the mask's four vertices or its bounding box). With target, a Corner Pin is keyed on that layer so its corners ride the surface; the result is also kept as a Perspective tracker on the footage for re-applying to other layers. One undo step for the corner pin (tracking is its own step).
+Planar tracking: follows a flat surface (a screen, a sign, a wall, a tabletop) through footage and corner-pins another layer onto it. Draw a mask around the surface on the footage layer first (mask.new or layer.addMask, in layer pixels at the reference time). track forward (reference to the end), backward (start to the reference) or both analyses the mask with the Perspective method from the reference time (a homography from features inside the mask, every frame); without track nothing is analysed: the layer's existing Perspective tracker (an earlier planar_track, or an analysed perspective track.new) is pinned onto target, which is then required, and surface is not read. held in the result lists the times of frames that did not track and hold the last tracked surface (confidence 0 on the tracker). surface is the plane's four corners at the reference time (upper left, upper right, lower left, lower right, layer pixels; default the mask's four vertices or its bounding box). With target, a Corner Pin is keyed on that layer so its corners ride the surface; the result is also kept as a Perspective tracker on the footage for re-applying to other layers. One undo step for the corner pin (tracking is its own step).
- `layer`: id or name; required; Layer id, `#n` (1 = top) or name.
- `mask`: id or name; Mask uid, 1-based index or name (default the first mask).
diff --git a/.claude/skills/formvfx-harness/references/tools.md b/.claude/skills/formvfx-harness/references/tools.md
index d21ca6e..5a7241a 100644
--- a/.claude/skills/formvfx-harness/references/tools.md
+++ b/.claude/skills/formvfx-harness/references/tools.md
@@ -145,7 +145,7 @@ Turns SVG markup into a shape layer (paths, fills, strokes, gradients, groups an
## planar_track
-Planar tracking: follows a flat surface (a screen, a sign, a wall, a tabletop) through footage and corner-pins another layer onto it. Draw a mask around the surface on the footage layer first (mask.new or layer.addMask, in layer pixels at the reference time). track forward, backward or both analyses the mask with the Perspective method from the reference time (a homography from features inside the mask, every frame); without track the mask must already be tracked. surface is the plane's four corners at the reference time (upper left, upper right, lower left, lower right, layer pixels; default the mask's four vertices or its bounding box). With target, a Corner Pin is keyed on that layer so its corners ride the surface; the result is also kept as a Perspective tracker on the footage for re-applying to other layers. One undo step for the corner pin (tracking is its own step).
+Planar tracking: follows a flat surface (a screen, a sign, a wall, a tabletop) through footage and corner-pins another layer onto it. Draw a mask around the surface on the footage layer first (mask.new or layer.addMask, in layer pixels at the reference time). track forward (reference to the end), backward (start to the reference) or both analyses the mask with the Perspective method from the reference time (a homography from features inside the mask, every frame); without track nothing is analysed: the layer's existing Perspective tracker (an earlier planar_track, or an analysed perspective track.new) is pinned onto target, which is then required, and surface is not read. held in the result lists the times of frames that did not track and hold the last tracked surface (confidence 0 on the tracker). surface is the plane's four corners at the reference time (upper left, upper right, lower left, lower right, layer pixels; default the mask's four vertices or its bounding box). With target, a Corner Pin is keyed on that layer so its corners ride the surface; the result is also kept as a Perspective tracker on the footage for re-applying to other layers. One undo step for the corner pin (tracking is its own step).
- `layer`: id or name; required; Layer id, `#n` (1 = top) or name.
- `mask`: id or name; Mask uid, 1-based index or name (default the first mask).
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index e0bfb5f..08d5d5a 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -111,6 +111,9 @@ jobs:
run: |
(cd backend && ./oc_install)
./formvfx install-native --dev
+ - name: Compositing engine unit tests
+ working-directory: native/fvx-core
+ run: cargo test --locked --no-default-features --lib
- name: Engine and compositing tests
working-directory: backend
run: |
diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md
index 48248c2..16620f7 100644
--- a/backend/HASHOUT_LOG.md
+++ b/backend/HASHOUT_LOG.md
@@ -435,3 +435,9 @@ Living context for the engine service. Code carries almost no comments; the reas
- Sources by slot kind (fix after the first commit): keyframe slots go up as stills on multiples of 8 from the first frame of the range; a mask slot needs its own layer and is rendered from it, never from the source; each input matches its slot's kind and the server's limits; uploads stream from disk; a footage layer's own file is sent only when trims or stretch leave it untouched; server-supplied names never leave the result folder; results land at the first frame sent; the websocket follower stops when no job is open and keeps its place across a reconnect.
- Agents: no tool takes an address or a path, so an agent cannot point the engine at another server or send a file; `comfy_run` asks like any change and `comfy_job` only knows jobs started in this session.
- Verified: against the live pack, settings get and put, the handshake, the workflow list with readiness, the selftest on a solid layer over frames 0 to 8 (a 9-frame plate, then done and a footage layer above the source as one undo step) and retry with a new seed; 403 without the window key; `test_f1_guard.py` and `test_window_key.py` 67 passed; `python3 setup/lint_text.py .` 0 findings. Not run: a matte landing, a movie output, cancel, a server restart mid-job, websocket progress. No test was added by the owner's decision.
+
+## Planar Track directions and reuse (0.61.1)
+
+- Kind: fix. Logged: v0.61.1 · 2026-12-03. Refers to `app/agent/tools.py` and the new `tests/test_planar_track.py`.
+- The engine now reads `track` (see `native/fvx-core/HASHOUT_LOG.md`, 0.61.1). The `planar_track` description says what forward and backward cover, that leaving `track` out pins the layer's existing Perspective tracker onto a required `target` without analysing, and that `held` lists the frames that hold the last tracked surface. `rpc.py` already passed `track` through and is unchanged.
+- Checked: `tests/test_planar_track.py` (4 tests) builds a textured precomp that moves, a mask and a solid through `command.execute`, then calls `track.planar` over `/api/rpc` with the window key: forward and backward key only their side of the reference, leaving `track` out pins the solid from the first tracker without a second one, and with nothing tracked it is refused. All four fail on the 0.61.0 engine.
diff --git a/backend/app/agent/tools.py b/backend/app/agent/tools.py
index df238c6..4485dc2 100644
--- a/backend/app/agent/tools.py
+++ b/backend/app/agent/tools.py
@@ -104,7 +104,7 @@ def _tool(name: str, description: str, props: dict, required: list[str] | None =
{"action": {"type": "string", "enum": ["list", "apply"]}, "preset": {"type": "string"}, "query": {"type": "string"}, "category": {"type": "string"}, "layer": _LAYER, "layers": {"type": "array", "items": _LAYER}, "time": _TIME, "comp": _COMP}, ["action"]),
_tool("shapes_from_svg", "Turns SVG markup into a shape layer (paths, fills, strokes, gradients, groups and clips become editable shape contents), centred in the composition, one undo step. Use it for logos, icons and vector art you write as SVG.",
{"svg": {"type": "string"}, "name": {"type": "string"}, "comp": _COMP}, ["svg"]),
- _tool("planar_track", "Planar tracking: follows a flat surface (a screen, a sign, a wall, a tabletop) through footage and corner-pins another layer onto it. Draw a mask around the surface on the footage layer first (mask.new or layer.addMask, in layer pixels at the reference time). track forward, backward or both analyses the mask with the Perspective method from the reference time (a homography from features inside the mask, every frame); without track the mask must already be tracked. surface is the plane's four corners at the reference time (upper left, upper right, lower left, lower right, layer pixels; default the mask's four vertices or its bounding box). With target, a Corner Pin is keyed on that layer so its corners ride the surface; the result is also kept as a Perspective tracker on the footage for re-applying to other layers. One undo step for the corner pin (tracking is its own step).",
+ _tool("planar_track", "Planar tracking: follows a flat surface (a screen, a sign, a wall, a tabletop) through footage and corner-pins another layer onto it. Draw a mask around the surface on the footage layer first (mask.new or layer.addMask, in layer pixels at the reference time). track forward (reference to the end), backward (start to the reference) or both analyses the mask with the Perspective method from the reference time (a homography from features inside the mask, every frame); without track nothing is analysed: the layer's existing Perspective tracker (an earlier planar_track, or an analysed perspective track.new) is pinned onto target, which is then required, and surface is not read. held in the result lists the times of frames that did not track and hold the last tracked surface (confidence 0 on the tracker). surface is the plane's four corners at the reference time (upper left, upper right, lower left, lower right, layer pixels; default the mask's four vertices or its bounding box). With target, a Corner Pin is keyed on that layer so its corners ride the surface; the result is also kept as a Perspective tracker on the footage for re-applying to other layers. One undo step for the corner pin (tracking is its own step).",
{"layer": _LAYER, "mask": {"description": "Mask uid, 1-based index or name (default the first mask).", "anyOf": [{"type": "integer"}, {"type": "string"}]}, "target": _LAYER, "surface": {"type": "array", "items": {"type": "array", "items": {"type": "number"}, "minItems": 2, "maxItems": 2}, "minItems": 4, "maxItems": 4}, "reference": _TIME, "track": {"type": "string", "enum": ["forward", "backward", "both"]}, "start": {"type": "number"}, "end": {"type": "number"}, "comp": _COMP}, ["layer"]),
_tool("object_matte", "Object Matte: isolates one object (a person, a car, a product) in footage from one point on it. action preview segments the object at time and returns its bounding box, coverage and the model's confidence without changing anything; action select puts a Roto Paint on the layer seeded at that point (one undo step), spans the whole layer and propagates it (direction both by default; wait true blocks until done, otherwise call wait). The layer's alpha becomes the object's matte. Needs the MobileSAM model (roto.model.download {id: mobilesam}).",
{"action": {"type": "string", "enum": ["preview", "select"]}, "layer": _LAYER, "point": {"type": "array", "items": {"type": "number"}, "minItems": 2, "maxItems": 2, "description": "[x, y] in the layer's pixels"}, "time": _TIME, "direction": {"type": "string", "enum": ["both", "forward", "backward"]}, "wait": {"type": "boolean", "default": False}, "comp": _COMP}, ["action", "layer", "point"]),
diff --git a/backend/tests/test_planar_track.py b/backend/tests/test_planar_track.py
new file mode 100644
index 0000000..918b5f6
--- /dev/null
+++ b/backend/tests/test_planar_track.py
@@ -0,0 +1,90 @@
+import random
+import struct
+import zlib
+
+import pytest
+
+from conftest import LOCAL_HEADER
+
+W, H, FPS, FRAMES = 160, 120, 10, 8
+REFERENCE = 0.3
+REGION = [[50, 40], [110, 40], [110, 80], [50, 80]]
+
+
+def write_texture(path):
+ rnd = random.Random(7)
+ cells = [[rnd.randrange(256) for _ in range(W // 4 + 2)] for _ in range(H // 4 + 2)]
+ rows = b"".join(b"\x00" + bytes(cells[y // 4][x // 4] for x in range(W) for _ in range(3)) for y in range(H))
+
+ def chunk(kind, data):
+ return struct.pack(">I", len(data)) + kind + data + struct.pack(">I", zlib.crc32(kind + data) & 0xFFFFFFFF)
+
+ path.write_bytes(b"\x89PNG\r\n\x1a\n" + chunk(b"IHDR", struct.pack(">IIBBBBB", W, H, 8, 2, 0, 0, 0)) + chunk(b"IDAT", zlib.compress(rows)) + chunk(b"IEND", b""))
+
+
+@pytest.fixture
+def keyed():
+ from app.core import window_key
+
+ return {**LOCAL_HEADER, window_key.HEADER: window_key.KEY}
+
+
+@pytest.fixture
+def rpc(client, keyed):
+ def call(method, **params):
+ body = client.post("/api/rpc", json={"jsonrpc": "2.0", "id": 1, "method": method, "params": params}, headers=keyed).json()
+ return body
+
+ return call
+
+
+@pytest.fixture
+def shot(rpc, tmp_path):
+ def run(command, **params):
+ body = rpc("command.execute", command=command, params=params)
+ assert "result" in body, body
+ return body["result"]
+
+ png = tmp_path / "plane.png"
+ write_texture(png)
+ duration = FRAMES / FPS
+ plate = run("comp.new", name="Plane", width=W, height=H, frameRate=FPS, duration=duration)["comp"]
+ item = run("file.import", paths=[str(png)])["items"][0]
+ image = run("layer.addItem", item=item, comp=plate)["layer"]
+ for n in range(FRAMES):
+ run("prop.addKey", layer=image, comp=plate, path="transform/position", time=n / FPS, value=[W / 2 + 1.5 * n, H / 2 + 0.8 * n])
+ comp = run("comp.new", name="Shot", width=W, height=H, frameRate=FPS, duration=duration)["comp"]
+ insert = run("layer.newSolid", name="Insert", color="#ff0000", comp=comp)["layer"]
+ layer = run("layer.addItem", item=plate, comp=comp)["layer"]
+ run("mask.new", layer=layer, comp=comp, vertices=REGION, closed=True)
+ return {"comp": comp, "layer": layer, "insert": insert, "run": run}
+
+
+def trackers(shot):
+ status = shot["run"]("track.status", layer=shot["layer"], comp=shot["comp"])
+ return status.get("trackers") or []
+
+
+def test_the_rpc_tracks_forward_only_when_asked(rpc, shot):
+ body = rpc("track.planar", layer=shot["layer"], comp=shot["comp"], reference=REFERENCE, track="forward")
+ assert body["result"]["frames"] == FRAMES - round(REFERENCE * FPS), body
+ assert body["result"]["held"] == []
+
+
+def test_the_rpc_tracks_backward_only_when_asked(rpc, shot):
+ body = rpc("track.planar", layer=shot["layer"], comp=shot["comp"], reference=REFERENCE, track="backward")
+ assert body["result"]["frames"] == round(REFERENCE * FPS) + 1, body
+
+
+def test_the_rpc_pins_from_the_existing_tracker_when_track_is_left_out(rpc, shot):
+ first = rpc("track.planar", layer=shot["layer"], comp=shot["comp"], reference=REFERENCE, track="both")["result"]
+ again = rpc("track.planar", layer=shot["layer"], comp=shot["comp"], reference=REFERENCE, target=shot["insert"])
+ assert again["result"]["tracker"] == first["tracker"], again
+ assert again["result"]["applied"] == FRAMES
+ assert again["result"]["targetName"] == "Insert"
+ assert len(trackers(shot)) == 1
+
+
+def test_the_rpc_refuses_already_tracked_when_nothing_was_tracked(rpc, shot):
+ body = rpc("track.planar", layer=shot["layer"], comp=shot["comp"], reference=REFERENCE, target=shot["insert"])
+ assert "no Perspective tracker" in body["error"]["message"], body
diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md
index b199fe6..71c98a3 100644
--- a/frontend/HASHOUT_LOG.md
+++ b/frontend/HASHOUT_LOG.md
@@ -469,3 +469,9 @@ Living context for the interface. Code carries almost no comments; the reasoning
- The rows moved into `.cv-menu-list` so the fade is a mask on the list and the glass card stays whole; `max-height` stays on the panel. Nothing outside `popup.ts` reads the panel's children or `scrollTop` (`keys.ts` only checks `.cv-menu:not([hidden])`). The panel no longer scrolls, so End and Home, which the browser used to give the focused panel, are now handled in `key` (focus the last or first row and scroll the list). No scroll listener closes an open submenu: the old panel did not either.
- Not changed: classes, colours, glass, spacing, z values, `native-menu.ts`. The browser demo imports `ui/popup.ts` and needs rebuilding (`node demo/build.mjs`) to carry this.
- Verified: `npx tsc --noEmit` clean; `npm run build` passes; no vitest suite exists here. Headless Chrome against the engine built from source (scratch venv, `maturin develop --release`) serving `dist`, a comp with one solid: every bar menu and the first submenu at 1871x1080, 1280x720, 1000x480, 800x320 under 4x CPU, every frame sampled: 0 failures (tops 38 under a bar bottom of 33.5, heights 810, 540, 360, 240 at most, End reaches the last row). Viewer right-click (20 rows, the longest) before and after: 1280x800 top 4 h 653 to top 38 h 600 with the hint; 1871x1080 top 4 to top 38, 653 tall, no hint; 1000x480 top 4 h 472 to top 38 h 360 with the hint. Hint at 1871x1080 unthrottled: full opacity in the first four frames, 0.29 at 80 ms and 0 by 374 ms at the last row, 0.62 at 241 ms and 1 by 744 ms after 120 px up, End hides and Home restores, Help (fits) has none, 30 arrow presses never left the focused row in the fade, a cut-off Layer submenu at 1000x420 has it. Window > Generate with Comfy still opens its panel. The window smoke (`tests/window`) could not start: Playwright's bundled browser is not installed here. Changed files carry no U+2014 and no emoji.
+
+## Planar Track held frames (0.61.1)
+
+- Kind: fix. Logged: v0.61.1 · 2026-12-03. Refers to `src/panels/tracker.ts`.
+- The Track select already sent `track` (and nothing for Already tracked); the engine now honours it. The status line and toast add how many frames did not track and hold the last tracked surface, from the result's `held`, when there are any.
+- Checked: `npm run build`.
diff --git a/frontend/src/panels/tracker.ts b/frontend/src/panels/tracker.ts
index 04295eb..cdb4693 100644
--- a/frontend/src/panels/tracker.ts
+++ b/frontend/src/panels/tracker.ts
@@ -73,8 +73,10 @@ export class TrackerPanel extends CommandPanel {
if (this.target.value) params.target = Number(this.target.value);
if (this.track.value) params.track = this.track.value;
try {
- const r = await this.c.client.call<{ frames: number; applied: number; targetName: string | null }>('track.planar', params);
- const msg = r.targetName ? `Pinned ${r.targetName} to the surface on ${r.frames} frames.` : `Planar track on ${r.frames} frames kept as a tracker.`;
+ const r = await this.c.client.call<{ frames: number; applied: number; targetName: string | null; held?: number[] }>('track.planar', params);
+ const done = r.targetName ? `Pinned ${r.targetName} to the surface on ${r.frames} frames.` : `Planar track on ${r.frames} frames kept as a tracker.`;
+ const held = r.held?.length ?? 0;
+ const msg = held ? `${done} ${held} ${held === 1 ? 'frame' : 'frames'} did not track and hold the last tracked surface.` : done;
this.note = msg;
setText(this.status, msg);
toast(msg, 'info');
diff --git a/native/fvx-core/HASHOUT_LOG.md b/native/fvx-core/HASHOUT_LOG.md
index 8d4c53f..2b87bc9 100644
--- a/native/fvx-core/HASHOUT_LOG.md
+++ b/native/fvx-core/HASHOUT_LOG.md
@@ -383,3 +383,11 @@ Masks, time remapping and shape path vertices from `.aep` projects (each named i
- **Edit Original.** On Windows the footage opens in its default app with its path kept as one file name. Edit Original opens media only and declines program and script files.
- **Auto-save and recent projects.** Auto-save copies in a shared folder carry a tag from the project id, so projects with the same name, and untitled ones, no longer number or prune each other's copies. The recent list is re-read before each change and written in one step.
- Checked: `backend/tests/test_render.py` and `backend/tests/test_f6_project.py` cover the render output, encoder and auto-save changes.
+
+## Planar Track directions, reuse and held frames (0.61.1)
+
+- Kind: fix. Logged: v0.61.1 · 2026-12-03. Refers to `src/engine/cmd/track.rs` (`planar` and its new helpers `planar_direction`, `planar_surface`, `planar_track`, `planar_tracker`, `pin_planar`, `reusable_tracker`, `planar_reuse`) and the new `src/engine/cmd/track_planar_tests.rs`.
+- **`track` was never read.** The engine service passes `track` and the Tracker panel offers Forward and Backward, Forward, Backward and Already tracked, but `planar` always tracked both ways and always made a new tracker. Now `forward` tracks from the reference time to the end (or `end`), `backward` from the start (or `start`) to the reference time, `both` does both, and any other value is refused. With `track` missing, null or empty nothing is analysed: the layer's Perspective tracker with keys on all four points (the current tracker when it is one, else the last) is pinned onto `target` in one undo step, with no new tracker. That path needs `target`, does not read the mask or `surface`, and fails with "this layer has no Perspective tracker with tracked keys to reuse" when there is none. This is what the agent tool already described; callers that left `track` out and expected a fresh track now get the reuse or that error.
+- **Backward only kept the reference frame.** The backward pass skipped its first frame (the reference) because the forward pass also keys it; it now skips it only when the forward pass ran. The skip also moved after the held homography is recorded, so a backward frame that fails right after the reference holds the reference instead of being dropped.
+- **Held frames are reported.** A frame where the surface does not track still holds the last tracked homography with no limit (owner decision, unchanged). Those frames are now listed as comp times in the result's `held`, and the Planar Tracker keys confidence 0 on them instead of 100. The reuse path reports a frame as held when any of the four points keys confidence 0 there.
+- Checked: `cargo test --no-default-features --lib planar_tests`, 8 tests on a textured plane moved by a known homography per frame through a Corner Pin in a precomp (worst corner error 0.131 px against a 0.35 px bound): `surface_track` directly, each direction, a bad `track`, reuse, reuse with nothing tracked, and a held frame. On the 0.61.0 code six of the eight fail (the two that check accuracy with both directions pass). `backend/tests/test_planar_track.py` runs the same parameters through `/api/rpc`.
diff --git a/native/fvx-core/src/engine/cmd/track.rs b/native/fvx-core/src/engine/cmd/track.rs
index 01c6c88..3d6b46b 100644
--- a/native/fvx-core/src/engine/cmd/track.rs
+++ b/native/fvx-core/src/engine/cmd/track.rs
@@ -1082,44 +1082,71 @@ pub fn face_model_select(e: &mut Engine, p: &Json) -> Res {
}
}
+const PLANAR_TRACK: [&str; 3] = ["forward", "backward", "both"];
+const NO_PLANAR_TRACKER: &str = "this layer has no Perspective tracker with tracked keys to reuse; pass track forward, backward or both to track the mask";
+
+type PinRows = Vec<(f64, [[f64; 2]; 4])>;
+
+fn planar_direction(p: &Json) -> Result
-
+
@@ -102,7 +102,7 @@ FormVFX loads Form extensions (API 1): FormPortal installs them, form.ext makes
## Under the hood
-Version 0.61.0 · Apache-2.0 · compositing engine: FormVFX's own, in Rust (`native/fvx-core`)
+Version 0.61.1 · Apache-2.0 · compositing engine: FormVFX's own, in Rust (`native/fvx-core`)
- **Engine:** `native/fvx-core` is the compositing engine, Rust with PyO3, loaded by the engine service as the `fvx_core` extension.
- **Service:** a FastAPI engine service in `backend`, with the MCP server and the embedded terminal.
diff --git a/backend/app/__init__.py b/backend/app/__init__.py
index a076e5d..daa1407 100644
--- a/backend/app/__init__.py
+++ b/backend/app/__init__.py
@@ -1 +1 @@
-__version__ = "0.61.0"
+__version__ = "0.61.1"
diff --git a/demo/assets/demo.js b/demo/assets/demo.js
index 8c0bae1..3b4bcea 100644
--- a/demo/assets/demo.js
+++ b/demo/assets/demo.js
@@ -1,4 +1,4 @@
-(function(){var e=`0.61.0`;function t(e,t,n){let r=new Map;for(let t of Array.from(e.children)){let e=t.dataset.key;e!==void 0&&r.set(e,t)}let i=e.firstElementChild,a=new Set;for(let o of t){let t=n.key(o);a.add(t);let s=r.get(t);s||(s=n.create(o),s.dataset.key=t),n.update(s,o),s===i?i=i.nextElementSibling:e.insertBefore(s,i)}for(let[e,t]of r)a.has(e)||t.remove()}function n(e,t){e&&e.textContent!==t&&(e.textContent=t)}function r(e,t,n){e&&e.classList.contains(t)!==n&&e.classList.toggle(t,n)}function i(){document.body.classList.contains(`app-ready`)||requestAnimationFrame(()=>requestAnimationFrame(()=>{document.body.classList.add(`app-ready`),`__TAURI_INTERNALS__`in window&&requestAnimationFrame(()=>{try{Promise.resolve(window.__TAURI_INTERNALS__?.invoke?.(`app_ready`)).catch(()=>void 0)}catch{return}})}))}function a(e){let t=document.createElement(`template`);return t.innerHTML=e.trim(),t.content.firstElementChild}function o(e,t){let n=e.querySelector(t);if(!n)throw Error(`missing element: ${t}`);return n}function s(e,t){e.disabled!==t&&(e.disabled=t)}/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent);var c={cursor:``,moveSel:``,marquee:``,ellipseSelect:``,lasso:``,lassoSelect:``,wandSelect:``,magicWand:``,brush:``,eraser:``,eyeDropper:``,hand:``,pan:``,zoomIn:``,zoomOut:``,fitView:``,tMove:``,tMarquee:``,tEllipse:``,tLasso:``,tPolyLasso:``,tObjectSelect:``,tQuickSelect:``,tWand:``,tCrop:``,tEyedropper:``,tSpotHeal:``,tHealBrush:``,tPatch:``,tRemove:``,tBrush:``,tEraser:``,tStamp:``,tSmudge:``,tBlur:``,tSharpen:``,tDodge:``,tBurn:``,tSponge:``,tGradient:``,tBucket:``,tPen:``,tFreeformPen:``,tCurvaturePen:``,tType:``,tPathSelect:``,tDirectSelect:``,tRect:``,tEllipseShape:``,tHand:``,tZoom:``,alignLeftEdge:``,alignHcenterEdge:``,alignRightEdge:``,alignTopEdge:``,alignVcenterEdge:``,alignBottomEdge:``,distributeH:``,distributeV:``,viewGrid:``,viewList:``,pilcrow:``,charA:``,panelProps:``,collapseRight:``,collapseLeft:``,more3:``,panelNav:``,swatchGrid:``,film:``,tLiquify:``,tPolygon:``,tStar:``,tLine:``,tArrow:``,tHeart:``,tCustomShape:``,quickMask:``,screenMode:``,tHistoryBrush:``,tFrame:``,tFrameEllipse:``,grip:``,tConvertPoint:``,tMagLasso:``,tRowMarquee:``,tColMarquee:``,tSelBrush:``,tPencil:``,tMagicEraser:``,tPatternStamp:``,tBgEraser:``,tColorSampler:``,tRuler:``,tNote:``,tCount:``,tTypeV:``,tTypeMask:``,tTypeMaskV:``,alignJustify:``,tTriangle:``,tCAMove:``,tRedEye:``,tRotateView:``,minus:``,halfCircle:``,sliders:``,search:``,sun:``,moon:``,alignLeft:``,alignCenter:``,alignRight:``,plus:``,crop:``,gradient:``,directSelectTool:``,smartObject:``,tween:``,camera:``,history:``,play:``,penTool:``,healBrushTool:``,patchTool:``,typeTool:``,rectTool:``,circleTool:``,smudge:``,objectSelect:``,quickSelect:``,bucket:``,dodge:``,burn:``,sponge:``,blurTool:``,dodgeBurn:``,transform:``,rotate:``,flipH:``,flipV:``,eye:``,eyeOff:``,link:``,unlink:``,mask:``,clipMask:``,folder:``,drive:``,folderOpen:``,add:``,remove:``,delete:``,duplicate:``,layers:``,chevronDown:``,chevronRight:``,chevronLeft:``,chevronUp:``,invertLayer:``,invert:``,levels:``,histogram:``,image:``,merge:``,paintbrush:``,close:``,check:``,save:``,load:``,newFile:``,download:``,upload:``,settings:``,theme:``,dots:``,menu:``,undo:``,redo:``,info:``,warning:``,error:``,success:``,loading:``,refresh:``,fileImage:``,fill:``,lock:``,unlock:``,canvasGrid:``,dragHandle:``,maximize:``,send:``,pfGeneral:``,pfInterface:``,pfType:``,pfFile:``,pfHistory:``,pfPerformance:``,pfGuides:``,pfPlugins:``,pfComposition:``,pfCube:``,pfAudio:``,pfRoto:``,pfFace:``,pfLabel:``,pfFold:``};function l(e,t=16){return`${c[e]??c.info}`}var u=0,d=class{scrim;body;foot;titleEl;lastFocus=null;onClose=null;constructor(e,t=440){this.scrim=a(`
`),o(this.scrim,`.cv-dialog`).style.setProperty(`--cv-dialog-w`,`${t}px`),this.titleEl=o(this.scrim,`.cv-dialog-title`),this.body=o(this.scrim,`.cv-dialog-body`),this.foot=o(this.scrim,`.cv-dialog-foot`),n(this.titleEl,e),o(this.scrim,`[data-close]`).addEventListener(`click`,()=>this.close()),this.scrim.addEventListener(`pointerdown`,e=>{e.target===this.scrim&&this.close()}),this.scrim.addEventListener(`keydown`,e=>{e.stopPropagation(),e.key===`Escape`&&(e.preventDefault(),this.close())}),document.getElementById(`overlay-root`)?.appendChild(this.scrim)}get isOpen(){return!this.scrim.hidden}setTitle(e){n(this.titleEl,e)}open(e){this.isOpen||(this.lastFocus=document.activeElement,document.getElementById(`overlay-root`)?.appendChild(this.scrim),this.scrim.hidden=!1,u+=1,(e??this.scrim.querySelector(`input, select, .cv-btn-primary:not(:disabled)`))?.focus(),this.scrim.contains(document.activeElement)||o(this.scrim,`.cv-dialog`).focus())}close(){this.isOpen&&(this.scrim.hidden=!0,--u,this.onClose?.(),this.scrim.contains(document.activeElement)&&document.activeElement.blur(),this.lastFocus?.focus?.())}button(e,t,n){let r=a(``);return r.textContent=e,r.addEventListener(`click`,n),this.foot.appendChild(r),r}field(e,t){let r=a(``);return n(o(r,`span`),e),r.appendChild(t),this.body.appendChild(r),r}},f=(e,t=1.6)=>``,p=e=>``,m={vSelect:p(``),vHand:f(``),vZoom:f(``),vRotate:f(``),vOrbit:f(``),vPanCam:f(``),vDolly:f(``),vPanBehind:f(``),vRect:f(``),vRounded:f(``),vEllipse:f(``),vPolygon:f(``),vStar:f(``),vPen:f(``),vPenAdd:f(``),vPenDelete:f(``),vPenConvert:f(``),vFeather:f(``),vType:f(``),vTypeV:f(``),vBrush:f(``),vClone:f(``),vEraser:f(``),vRoto:f(``),vRefine:f(``),vObjectMatte:f(``),vPuppet:f(``),vStarch:f(``),vBend:f(``),vAdvanced:f(``),vOverlap:f(``),sEye:f(``),sSpeaker:f(``),sSolo:p(``),sLock:f(``),sShy:f(``),sCollapse:f(``),sBest:f(``),sDraft:f(``),sWire:f(``,1.2),sFx:p(``),sFrameBlend:f(``),sMotionBlur:f(``),sAdjust:f(``),s3d:f(``),stopwatch:f(``),key:p(``),keyHollow:f(``),keyPrev:p(``),keyNext:p(``),graph:f(``),leading:f(``),twirl:p(``),twirlOpen:p(``),play:p(``),pause:p(``),toStart:p(``),toEnd:p(``),stepBack:p(``),stepFwd:p(``),loop:f(``),ram:f(``),iComp:f(``),iFootage:f(``),iImage:f(``),iAudio:f(``),iSolid:p(``),iText:f(``),iShape:f(``),iNull:f(``),iCamera:f(``),iLight:f(``),iFolder:f(``),iModel:f(``),iAdjust:f(``),terminal:f(``,1.75),agent:f(``,1.75),agentChat:f(``,1.75),aiChip:f(``,1.75),star:f(``,1.75),starFill:p(``),pickwhip:f(``),snapshot:f(``),grid:f(``,1.2),guides:f(``),safe:f(``),checker:p(``),roi:f(``),view3d:f(``),channel:f(``,1.3),exposure:f(``),marker:p(``),workArea:f(``),solo:p(``),palette:f(``),parent:f(``),plusSmall:f(``),rulers:f(``,1.4),showSnap:f(``),cfGenerate:f(``)};for(let[e,t]of Object.entries(m))c[e]=t;Object.keys(m);var h=e=>e?/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent)?e.replace(/Cmd\+/g,`⌘`).replace(/Ctrl\+/g,`⌃`).replace(/Alt\+/g,`⌥`).replace(/Opt\+/g,`⌥`).replace(/Shift\+/g,`⇧`):e.replace(/Cmd/g,`Ctrl`).replace(/Opt/g,`Alt`):``,g=.75,_=4,v=e=>Math.max(0,Math.min(Math.floor(window.innerHeight*g),Math.floor(window.innerHeight-e-_))),y=()=>{let e=document.querySelector(`.cv-menubar`)?.getBoundingClientRect();return e&&e.height>0?e.bottom+_:_},b=[];function x(){for(let e of b.slice())e.close()}var S=class e{parent;panel;list;floor=null;openSub=null;subRow=null;focusIndex=-1;rows=[];onClose=null;constructor(e=null){this.parent=e,this.panel=a(`