Skip to content

2.24.0: edit a pin's corners by hand, Hold when a track is lost, perspective for four corners, FormVFX live comps as clips - #48

Merged
nodemode-ai merged 5 commits into
mainfrom
feat/pin-edits-hold-vfx-link
Dec 3, 2026
Merged

nodemode-ai merged 5 commits into
mainfrom
feat/pin-edits-hold-vfx-link

Conversation

@gbarnai

@gbarnai gbarnai commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

FormCut 2.24.0 adds four changes, in one PR.

  1. Hand edits of an applied corner pin.
    • The inspector's Track section gets Edit corners. It shows the selected clip's pin as four grips on the preview, on the current frame.
    • Dragging a grip moves that corner on that frame only. The move is written into the pin's sample for that frame, or into a new sample there, so the frames either side keep their tracked corners.
    • It is one undo step. A corner moved by hand is filled with the accent colour, and a double-click puts it back.
    • A move that would fold or cross the four corners is refused, with a toast.
    • Through project.edit, and so the MCP server's formcut_edit, the same edit is clip.pin-corner {clipId, t, corner, x, y} or {clipId, t, corner, reset: true}. It is listed in capabilities.
    • The engine (backend/app/pin_edit.py) and the window (frontend/src/engine/pin-edit.ts) are twins, and a test runs both.
    • AdjustTrack is unchanged.
  2. When the track is lost: Stop (default) / Hold last position. This is a new select in the Track workspace's track settings.
    • Stop is unchanged and stays the default.
    • Hold keeps the last confident position for the lost frames (the twelve faint frames and every one after them, until the plane is found again) and marks them held. Held frames show in grey in the confidence strip.
    • The setting is not part of the track's signature, so switching between Stop and Hold keeps the frames already tracked.
  3. Perspective by default for four-cornered layers, plus a perspective refit.
    • A layer drawn as one four-cornered polygon (a screen, a sign, a pin target) now tracks in perspective unless the person sets Perspective themselves. This applies in the workspace and in the engine, so API and MCP callers get the same default.
    • Any frame where a lower model holds under 0.6 of the points is refitted in perspective from the same point pairs. The refit is kept when it holds at least 0.2 more of them, and the frame is marked promoted. In the strip this shows as a line in the accent colour along the top.
  4. Open a FormVFX live comp as a clip.
    • A .fvxlink (FormVFX's formvfx.link/1, matched to nodemode-dev/formVFX backend/app/engine/link.py and routers/link.py) imports into the bin through the Import chip.
    • Its frames come from FormVFX's GET /api/link/frame.png while FormVFX runs, so preview and export stay one renderer. Its sound in the mix comes from /api/link/audio.
    • Render and replace on the bin card writes it to a normal movie, ProRes 4444 with PCM sound, using FormCut's own ffmpeg as a separate program. It then points the project's clips at that movie, so the project no longer depends on FormVFX.
    • FormVFX is reached on loopback only (FORMVFX_URL, then FormVFX's engine.json, then 127.0.0.1:8250), with no proxy from the environment, no redirects, and capped replies.
    • FormVFX's link reads need no token (x-formvfx-local: 1 only). Its own POST render needs FormVFX's window key, which is why the render is done on FormCut's side.

Version 2.24.0 is set at all eight version sites in one chore(release) commit, as 2.23.0 was. The reasoning is in backend/HASHOUT_LOG.md and frontend/HASHOUT_LOG.md.

Tests

The new tests were written first and fail on origin/main. Run against an unchanged checkout:

  • test_pin_edit.py does not import (app.pin_edit is missing).
  • The other new engine tests fail: 29 of them.
  • The 12 project-path and comp tests added after the security review fail on the first push of this branch.
  • The tilting-plane default test measured 21.5 px mean error on the old code (the limit is 1 px).

New tests:

  • tests/test_pin_edit.py: 14
  • tests/test_planar_hold.py: 5
  • tests/test_planar_perspective_default.py: 4
  • tests/test_vfx_link.py: 36
  • tests/test_pin_link_strings.py: 2
  • frontend/tests/window/test_pin_link_controls.py: 3, in Chromium, including zero layout shift when Edit corners is turned on and off

Commands run locally (macOS, Python 3.12, Node 25.8), as .github/workflows/checks.yml runs them, with a scratch HOME and PYTHON_KEYRING_BACKEND=keyring.backends.fail.Keyring:

  • Engine:
    • python -m compileall -q backend/app mcp: passes.
    • ruff check backend/app mcp setup tests: all checks passed.
    • ruff format --check backend/app mcp setup tests: 334 files formatted.
    • python -m pytest tests -q: 1781 passed, 180 skipped. Node 25.8 was supplied through FORMCUT_NODE so that the TypeScript twin test runs. It skips where Node is older than 22.6.
    • python setup/notices.py --check: passes.
    • python setup/output_checks.py: "exports and RPC replies are as expected".
    • The routes mount once: 308 routes, none repeated.
    • python setup/skill_maps.py --check: passes, with the maps regenerated.
    • ./formcut agents sync --check: "in step". No MCP tool changed.
  • python setup/golden_frames.py: on this Mac, preview and export agree (worst mean difference 1.474). The pixel hashes of the text frames differ from the golden ones. origin/main gives byte-identical output on the same Mac, so the difference is the font stack: the hashes are pinned to Linux, which CI runs.
  • Interface:
    • npm audit --audit-level=low: 0 vulnerabilities.
    • npx tsc --noEmit: clean.
    • npm run build: built.
    • Locale key counts are en 1572, es 1572, de 1572.
    • The language pack has 1625 rows, none with the wrong column count.
  • Window: python -m pytest frontend/tests/window -q: 9 passed. These are the F7 smoke, the review controls and the 3 new tests.
  • Desktop shell, with a stub sidecar as CI uses:
    • cargo fmt --check: clean.
    • cargo check: finished.

A screen benchmark (six synthetic 1280x720 clips with exact corner truth, FormCut's runner pointed at this tree) gave the following mean and max corner error in px. The old default was Perspective off.

clip old default new default (perspective)
pan, turn and tilt 27.46 / 109.2 0.031 / 0.27
3.5x zoom 10.38 / 72.9 0.19 / 1.16
hand over the screen 26.95 / 103.9 0.039 / 0.41
glossy screen, changing light 26.17 / 120.4 0.30 / 2.27
corners leave the frame 60.27, lost at frame 43 0.084 / 0.84, nothing lost
blur and noise 34.16 / 124.8 0.11 / 0.51

For the owner

  • The tracker's default changed. A layer drawn as four corners now tracks in perspective when Perspective is not set. The old default (a similarity) anchored screens 25 to 35 px off on a tilting screen, and lost the track on corners leaving the frame. Layers with any other shape keep the old default, and an explicit choice is always kept.
    • Existing layers saved by an older workspace carry perspective: false explicitly, so they keep their old behaviour until the box is ticked.
    • An existing track that was made under the old default and has no setting stored carries on in perspective from where it stopped, without being redone. The signature is unchanged on purpose, so no track is wiped.
  • The per-frame refit applies to any layer below perspective. It only acts on frames where the chosen model holds under 0.6 of the points, so a clean track in a lower model is not changed.
  • Commit identity. These commits are authored as gbarnai <[email protected]>, as asked for this task. CLAUDE.md says every commit is nodemode-ai <[email protected]>. Rewrite them on merge if that rule should hold.
  • Not run against a real FormVFX. The link was tested against a stand-in that answers FormVFX's routes as its source does.

Left for the owner (not changed here)

  • An existing gap in the inspector. The inspector is built once at boot. The pin's other Track buttons (Remove corner pin, motion blur, light, grain and blur matching), the matte and module removals, and Lens redistort are written from the selection at boot. They do not appear for a clip chosen later. This PR makes only its own Edit corners button follow the selection.
  • A live clip on the timeline draws no filmstrip or waveform until it is rendered: those routes refuse it by name (409). Its sound plays at speed 1 even when the clip is retimed or reversed. No MCP tool imports a .fvxlink yet; an agent can call POST /api/vfx-link/import.
  • What a link is trusted with. A .fvxlink is often a downloaded file, and FormVFX opens the project it names.
    • FormCut forwards that project only as an absolute path on this computer to an existing FormVFX project file (.fvxproj, .ecproj, .ecprojx), with symlinks resolved and the target checked the same way. A UNC or // share, a URL scheme (smb:, file:), a relative path, a .. segment, control characters or any other kind of file is refused at import with a plain sentence.
    • If the file later moves, only the project id is sent, and FormVFX matches it against its open and recent projects.
    • The comp id and project id must be FormVFX-style tokens.
    • What the link still trusts: the project file itself. Any FormVFX project file on this computer that a link names is opened by FormVFX for the thumbnail at import and for every frame. A downloaded link sitting next to a downloaded project would open that project in FormVFX's own loader.
    • FormVFX could narrow this on its side by limiting the link routes to the open project and Open Recent.
  • A lost media index is rebuilt from files that have a known extension, so a live comp's .fvxlink item comes back only from its own record in media-records/.

How to ship

  1. Review and merge this PR into main. The checks must pass.
  2. Release per RELEASING.md:
    • Run python setup/preflight.py.
    • Push main:refs/heads/compile_v2.24.0 for nodemode-dev/formcompiler.
    • Review the draft release and publish it.

…tive for four corners, FormVFX live comps as clips

Hand edits of an applied corner pin: Edit corners in the inspector's Track
section shows the selected clip's pin as four grips on the preview; one
dragged is written into the pin's sample on that frame (or a new sample
there), so the frames either side keep their tracked corners. The pin keeps
the value each moved corner replaced, so a double-click puts it back. A move
that would fold or cross the corners is refused. One undo step in the window
(clip.pinCorner); through project.edit, and so formcut_edit, clip.pin-corner.
backend/app/pin_edit.py and frontend/src/engine/pin-edit.ts are twins, and
the test runs both.

When the track is lost: Stop (the default, unchanged) or Hold last position.
Hold keeps the last confident homography for the twelve faint frames and
every faint one after, marks them held (the store's held, the read, the
confidence strip), and holds the tracker's prediction there. The setting is
left out of the track's signature, so changing it keeps the frames tracked.

Perspective by default for a layer drawn as one four-cornered polygon, in
the engine and the workspace, keeping any explicit choice; and a per-frame
refit in perspective (planar.promote) when a lower model holds under 0.6 of
the points and perspective holds at least 0.2 more, marked promoted. On six
synthetic screen clips with exact corners the old default was 10 to 60 px
mean corner error (one lost at frame 43); the new default 0.03 to 0.30 px,
nothing lost.

A FormVFX live comp as a clip: a .fvxlink (formvfx.link/1) imports into the
bin as a video item whose frames the renderer asks of FormVFX's Live Link
(loopback only, x-formvfx-local, no proxy, no redirects, capped and bounded
replies) and whose sound the mix asks for; Render and replace writes it to
ProRes 4444 with PCM sound through formcut's own ffmpeg and points the
project's clips at it (media.replace, one undo step). Routes that read a
media file refuse a live comp by name rather than hand ffmpeg its JSON.

Measured: 1769 passed and 180 skipped in the engine suite, 9 window tests in
Chromium, tsc and the build clean; the new tests fail on origin/main.
…and the perspective refit mark frames, and how a FormVFX live comp is read and rendered
…rack is lost, perspective for four corners, and FormVFX live comps as clips
@gbarnai
gbarnai requested a review from nodemode-ai as a code owner December 3, 2026 21:07
… the project id

A .fvxlink is often a downloaded file and FormVFX opens the project it names.
Its project must now be an absolute local path to a FormVFX project file:
a UNC or // share, a URL scheme, a relative path, a .. segment, control
characters or another kind of file is refused at import in words, and the
file must be there with its links followed and checked. On each request the
project is sent only as it then resolves; once moved, only the project id
goes, which FormVFX matches against its open and recent projects. Project
and comp ids must be FormVFX tokens.

12 new tests fail on the previous commit; tests/test_vfx_link.py 36 passed,
the engine suite 1781 passed and 180 skipped, the window tests 9 passed.
@nodemode-ai
nodemode-ai merged commit 48ac59d into main Dec 3, 2026
8 checks passed
@nodemode-ai
nodemode-ai deleted the feat/pin-edits-hold-vfx-link branch December 3, 2026 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants