Object Matte by sight
ae_object_matte_uiCreates an Object Matte on an After Effects layer through the macOS UI using lasso outlines or point clicks, then renders a preview to verify kept and excluded subjects.
Instructions
Object Matte (AE 26) on a layer through After Effects' UI — macOS only; no script can create a selection. Give lassos and points in the pixels of a frame you looked at (comp pixels of an ae_render_frame by default, or layer source pixels with space:"layer"). A LASSO takes the subjects inside the outline — AE snaps it to their silhouettes — so one lasso can take a whole group of people at once: outline them generously, heads and feet with a margin. A POINT takes the subject under it as AE segments it — often only a garment or a torso in a crowd, so use points only for a lone, clearly separated subject. mode:"subtract" removes (Option). The tool opens the layer in the Layer panel at time (the base frame), makes the Object Matte tool active (checked through the active-tool code — Option+W is the Roto Brush group's shortcut and cycles its members), acts with real mouse events, reads back the strokes the effect recorded (error_px = where each landed vs where it was meant to), optionally propagates by stepping the comp time (propagate_to), and then RENDERS A PREVIEW and returns it as images: top — the matte over black, bottom — the frame with the excluded parts in red, with markers: cyan boxes on gaps between kept pieces (where a hidden, lying or partly visible person is usually left out) and green/yellow rings on the people points you listed. A part of a person, someone behind another or lying on the ground is a subject too: add it with a lasso that overlaps the neighbouring kept matte so the pieces merge. The result is never verified by the tool: look at the images and check every person. With only preview_times (no points, lassos or propagate_to) it renders the preview without touching the UI — use it to check any frames. The Layer panel must be visible and large enough for the whole picture.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"comp": "<comp>",
"layer": "<layer>",
"time": "<time>"
},
"name": "ae_object_matte_ui"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| comp | Yes | Composition name or item id. | |
| mode | No | add (default): Shift-click / lasso adds to the matte; subtract: Option-click / Option-lasso removes. | |
| time | Yes | Composition time (s) of the base frame the points were picked on. | |
| zoom | No | Layer panel zoom to set before acting (1 = 100 %). Default: the current zoom, lowered until the picture fits 45 % of the window width. | |
| layer | Yes | 1-based layer index or layer name (the layer that gets the matte — the plate). | |
| space | No | Coordinate space of points and lassos: comp (default — pixels of an ae_render_frame of this comp) or layer (source pixels). | |
| lassos | No | Closed outlines (≥ 3 points each, ~12–40 points following the group's contour with a margin): each takes the subjects inside it, snapped to their silhouettes. | |
| people | No | Your checklist of the people who belong in the matte, picked on the frame `people_time` in COMP pixels: a point on each one's head, body and feet (any you can see). The preview marks each point green (inside the matte) or yellow (outside) and reports whole / partial / missing per person. Pass it on every call. | |
| points | No | Clicks: each takes the subject under it as AE segments it (in a crowd often only a part — prefer lassos). | |
| dry_run | No | Find the picture and report the mapping without clicking. | |
| preview | No | Render the preview after the actions (default true). | |
| settle_ms | No | Pause per propagated frame (default 250 ms; raise on 4K). | |
| shot_path | No | Absolute path to save the capture with the picture rectangle (PNG, ≤ 1600 px wide) for the user. | |
| tool_code | No | Project.toolType code of the Object Matte tool (default "161", AE 26.5). The tool reads the active tool and presses Option+W only until this code is active — Option+W is the Roto Brush group's shortcut and cycles its members. | |
| gap_radius | No | Comp pixels: gaps narrower than ~2× this between kept pieces are reported (default 100; raise to 150–200 to catch wider holes). | |
| people_time | No | Frame (s) the people points were picked on (default `time`); people are checked only on that preview frame. | |
| preview_dir | No | Absolute folder for the preview PNGs (default: the system temp folder, files overwritten each call). Use the chat's working folder. | |
| propagate_to | No | After the actions, step the comp time from `time` to this time frame by frame so AE propagates the matte (both directions allowed). | |
| preview_times | No | Times (s) to preview. Default: the base frame, plus propagate_to when given. Alone (no points/lassos/propagate_to) = preview only, no UI. | |
| preview_width | No | Width of each preview panel in pixels (default 1000). | |
| preview_region | No | Comp-pixel rectangle to preview at higher detail (e.g. a group of people) instead of the whole frame. | |
| preview_overlay | No | Add the bottom panel with excluded parts in red (default true; renders the frame once more with the effect switched off, then restores it). |