Compute Mask Fit Motion
compute_mask_fit_motionCompute the Motion Scale (%) and Position needed to place a still image's subject inside an existing Rounded Crop or similar mask, using a caller-supplied subject box.
Instructions
Inspect only. Compute the Motion Scale (%) and Position that place a still image's subject inside an existing Rounded Crop, Crop, or similar mask effect. Reads the sequence frame size, the source frame size, current Motion values, and the mask effect's parameters, then solves the geometry deterministically from a caller-supplied subject box (fractions of the source image, for example head-top to chin). No image analysis and no changes to Premiere. Apply the result with set_clip_scale and set_clip_position (or set_effect_property), then verify with capture_frame. Assumes Rotation 0 and uniform scale; mask geometry is treated as fixed in the sequence frame (mask_space 'sequence').
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| node_id | Yes | Node ID of the video clip that holds the still image and its Motion effect. | |
| subject | Yes | Subject box in the SOURCE image as fractions of the source frame (0..1), for example top = head-top and bottom = chin or collar. | |
| fit_axis | No | Fit the subject's height to placement top/bottom (default) or its width to placement left/right. | |
| placement | No | Where the subject should sit inside the mask, as fractions of the mask's bounding box. Defaults: top 0.15, bottom 0.85, center_x 0.5 (height fit); left 0.15, right 0.85, center_y 0.5 (width fit). | |
| mask_space | No | Where the mask geometry lives. 'sequence' (default): the mask stays fixed in the sequence frame while Motion moves the image (mask on an adjustment layer or nest, or an effect that renders after Motion). 'clip': the mask moves with the clip's Motion, so Motion cannot reframe the subject inside it and the tool returns an error explaining that. | |
| mask_effect | No | Display name or match name of the mask effect (case-insensitive). Defaults to 'Rounded Crop'. Built-in 'Crop' Left/Top/Right/Bottom percentages are supported too. | |
| mask_node_id | No | Node ID of the clip that carries the mask effect when it is not the image clip, for example an adjustment layer or nest above it. Defaults to node_id. | |
| source_width | No | Source image width in pixels. Overrides the value read from project metadata; required with source_height when Premiere does not report it. | |
| mask_override | No | Mask bounding box as fractions of the SEQUENCE frame. Skips reading mask parameters; use it when the effect's parameters cannot be interpreted. | |
| source_height | No | Source image height in pixels. Overrides the value read from project metadata. | |
| source_prescale | No | Extra scale Premiere applies before Motion, for example when Scale to Frame Size is on (sequence height / source height for a letterboxed fit). Defaults to 1. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Whether the tool completed successfully. | |
| data | No | Tool-specific result data when ok is true; on failure, diagnostic detail when the tool provides it. | |
| tool | Yes | The registered MCP tool name. | |
| error | No | Failure detail when ok is false. |