Preview a component
preview_componentLook at a contact sheet of one custom component on its own, without placing it in the film: the component alone at the film's size and its own place, on a plain background, from startSeconds to endSeconds of its own time. Use after replace_component, patch_component or scaffold_component to watch it enter, move and leave; pass params to try other input values. The answer is laid out as preview_range's: its previewId, each tile's time (the component's own seconds) and the image; read the pixels. region, grid, annotate, overlays and loupes work as in preview_range. Changes nothing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| grid | Yes | Draw a labelled grid and edge rulers to read coordinates off the picture: in source pixels (of the front video or image clip), film pixels (centre origin) or film_norm. null or none draws none. | |
| name | Yes | The custom component's class name, as replace_component names it, or its Asset ID. | |
| detail | Yes | How much the answer says: brief is one line per result with its ids; normal (null) adds the transform; full adds every matrix of the chain. | |
| loupes | Yes | A magnified inset around a point with a crosshair, for checking a corner to the pixel. The point may be in any space (type point). | |
| params | Yes | The component's inputs for this preview, each as name and value. Inputs left out keep their defaults. null (or leaving it out) draws every input at its default. | |
| region | Yes | The part of the frame to draw, as [x0, y0, x1, y1]: its top left and bottom right corners as fractions of the frame from the frame's top left (0 to 1, at least 0.02 apart). Example: [0.5, 0, 1, 0.5] is the top right quarter. The scene draws only this region, at the image's full size and a higher resolution, so small text, logos, thin lines and edges show real detail instead of an enlarged frame. The image has the region's shape. With space, the corners are in that space instead (preview pixels with previewId, film pixels, a clip's source pixels with clipId) and the region is the box around them on the frame. null (or leaving it out) draws the whole frame. | |
| annotate | Yes | Your own points, boxes, quads, lines or polygons drawn on the frame in any space, to check them before you commit: e.g. the four corners you think a sign has, in source pixels. null draws none. | |
| gridStep | Yes | Grid spacing in the grid's own units. null picks a step that keeps the labels legible (see gridDensity). | |
| overlays | Yes | What to outline on every frame: tracks (each object track on screen, a plane's corners numbered 0 to 3), pins (each <pin>'s corners), follows (each <follow>'s anchor), regions (each region's box), safeAreas (TikTok, Reels and Shorts safe areas), clipBounds (each clip's picture after fit, with its id), crop (what a cover fit cuts off), occluders (the box of what passes in front of each tracked surface, from track_occluders). null outlines nothing. | |
| projectId | Yes | The project this call runs on without changing the open project. null (or leaving it out) uses the open project. wait_for_jobs takes the projectId of the calls that started the jobs. | |
| background | Yes | CSS colour behind the component, such as #00ff00 or white. null (or leaving it out) uses the film's background. | |
| endSeconds | Yes | The last second of the component's own time to draw, after startSeconds. The component is drawn as a clip of this length: atTime's duration is endSeconds. | |
| gridDensity | Yes | How close the grid lines are when gridStep is null: sparse, normal (null) or dense. | |
| startSeconds | Yes | The first second of the component's own time to draw: atTime's time, 0 where its clip starts. |