Skip to content

MCP: edit operations

item.set_transition

Sets or removes the transition on one edge of a visual item.

Last updated:

Sets a fade, a slide, a zoom, a whip, a dip, a wipe, a spin, a shrink or a grow on the in or out edge, 0.5 seconds long unless duration is given; kind null removes the transition. color (#RRGGBB, default black) is for dip; direction (left, right, up or down, default left) is for whip and wipe. The two transitions together cannot be longer than the item. A transition needs something visible beneath it: to crossfade, let the previous clip run under it, on another track below, so that it is still playing during the duration of the in edge (or already playing during the out edge); otherwise lint reports L_TRANSITION_EMPTY. For example, clip A on the lower track ends at 4.5s and clip B on the upper track starts at 4s, so B gets {"item_id": B, "edge": "in", "kind": "fade", "duration": "0.5s"}.

Arguments#

ArgumentTypeRequiredNotes
colorstringnoDip only: #RRGGBB, default #000000.; pattern ^#[0-9A-Fa-f]{6}$
directionleft, right, up, downnoWhip and wipe only: left (default), right, up or down.
durationstringnoLength of the transition, at least 1 frame; default 0.5s.
edgein, outyesThe edge: in or out.
item_idstringyesA clip, text, caption or shape item.; pattern ^itm_[0123456789abcdefghjkmnpqrstvwxyz]{10}$
kindstring, one of 13 valuesyesFade, slide_left, slide_right, slide_up, slide_down, zoom, whip, dip, wipe, spin, shrink, grow, or null to remove.

Errors#

Scope#

Scope edit. The scope is the one an API key needs in network mode. Run stuarty command:help item.set_transition for the same description from the binary, or call the command_help tool.

Next steps#

As an MCP call

tools/call
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "edit",
    "arguments": {
      "project_id": "prj_7k2m9x4q1b",
      "base_revision": 12,
      "operations": [
        {
          "op": "item.set_transition",
          "args": {
            "edge": "in",
            "item_id": "itm_m1n2p3q4r5",
            "kind": "fade"
          }
        }
      ]
    }
  }
}

As a batch file for the CLI

batch.json
[
  {
    "op": "item.set_transition",
    "args": {
      "edge": "in",
      "item_id": "itm_m1n2p3q4r5",
      "kind": "fade"
    }
  }
]
Terminal
stuarty edit --project prj_7k2m9x4q1b --ops batch.json --json

Over HTTP

curl
curl -X POST "http://127.0.0.1:7878/api/v1/projects/prj_7k2m9x4q1b/edit" \
  -H "Authorization: Bearer $STUARTY_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "base_revision": 12,
  "operations": [
    {
      "op": "item.set_transition",
      "args": {
        "edge": "in",
        "item_id": "itm_m1n2p3q4r5",
        "kind": "fade"
      }
    }
  ]
}'

The ids in the example are illustrative: read the real ones with project_get.