# item.set_transition

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

Source: https://stuarty.com/docs/mcp/tools/edit/item.set_transition/

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

| Argument | Type | Required | Notes |
| --- | --- | --- | --- |
| `color` | `string` | no | Dip only: #RRGGBB, default #000000.; pattern `^#[0-9A-Fa-f]{6}$` |
| `direction` | `left`, `right`, `up`, `down` | no | Whip and wipe only: left (default), right, up or down. |
| `duration` | `string` | no | Length of the transition, at least 1 frame; default 0.5s. |
| `edge` | `in`, `out` | yes | The edge: in or out. |
| `item_id` | `string` | yes | A clip, text, caption or shape item.; pattern `^itm_[0123456789abcdefghjkmnpqrstvwxyz]{10}$` |
| `kind` | `string`, one of 13 values | yes | Fade, slide_left, slide_right, slide_up, slide_down, zoom, whip, dip, wipe, spin, shrink, grow, or null to remove. |

## Errors

- [`E_VALIDATION`](/docs/reference/error-codes#e_validation)
- [`E_INVALID_TIME`](/docs/reference/error-codes#e_invalid_time)
- [`E_NOT_FOUND`](/docs/reference/error-codes#e_not_found)
- [`E_TYPE_MISMATCH`](/docs/reference/error-codes#e_type_mismatch)
- [`E_INVALID_STATE`](/docs/reference/error-codes#e_invalid_state)

## 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`](/docs/mcp/tools/command_help) tool.

## Next steps

- [The edit tool](/docs/mcp/tools/edit)
- [Batches, revisions and idempotency](/docs/agents/batches)

**As an MCP call**

```json
{
  "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**

```json
[
  {
    "op": "item.set_transition",
    "args": {
      "edge": "in",
      "item_id": "itm_m1n2p3q4r5",
      "kind": "fade"
    }
  }
]
```

```bash
stuarty edit --project prj_7k2m9x4q1b --ops batch.json --json
```

**Over HTTP**

```bash
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`.
