Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/skills/formvfx-harness/references/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/formvfx-harness/references/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</p>

<p align="center">
<img alt="version 0.61.0" src="https://img.shields.io/badge/version-0.61.0-eef0f4?style=flat-square">
<img alt="version 0.61.1" src="https://img.shields.io/badge/version-0.61.1-eef0f4?style=flat-square">
<img alt="Rust" src="https://img.shields.io/badge/Rust-engine-b7410e?style=flat-square&logo=rust&logoColor=white">
<img alt="TypeScript" src="https://img.shields.io/badge/TypeScript-Vite-3178c6?style=flat-square&logo=typescript&logoColor=white">
<img alt="macOS, Windows, Linux" src="https://img.shields.io/badge/macOS%20%C2%B7%20Windows%20%C2%B7%20Linux-native-2f7bf5?style=flat-square">
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions backend/HASHOUT_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion backend/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.61.0"
__version__ = "0.61.1"
2 changes: 1 addition & 1 deletion backend/app/agent/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]),
Expand Down
90 changes: 90 additions & 0 deletions backend/tests/test_planar_track.py
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion demo/assets/demo.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demos/keying/assets/keying.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demos/motion/assets/motion.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/EXTENSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

FormVFX loads extensions that follow the Form Extension Contract, API 1, beside its own effect plug-ins (`docs/PLUGINS.md`), scripts and ScriptUI panels, and HTML panels installed under Window > Extensions. This page is what an extension author needs for FormVFX: the document snapshot, the commands, the events and where things appear. The protocol itself (`host.hello`, `ui.notify`, `storage.*`, `ext.activate` and the rest) is the contract's.

- Product id: `formvfx`. `host.hello` answers `app: "FormVFX"`, `appVersion` (this release, 0.61.0), `api: "1"`.
- Product id: `formvfx`. `host.hello` answers `app: "FormVFX"`, `appVersion` (this release, 0.61.1), `api: "1"`.
- Set `"minimum_app": "0.54.0"` in your manifest. A source checkout reports its last release (0.53.3) until the 0.54.0 release commit, so leave `minimum_app` out of a test copy run against an unreleased build.
- Consent: the first time a version is opened or run, FormVFX lists its permissions and the person chooses Allow (stored for that id, version and permission set) or Not Now (not stored; nothing opens and a command fails with -32001). The frame is created only after Allow, so your first `host.hello` already carries the granted permissions.

Expand Down
Loading
Loading