Motion kit command

transition.morphRect

Morph Rect Transition

Container-transform carry: the `from` layer's on-screen rectangle (with its corner radius) morphs into the `to` layer's rectangle over `frames` (18, smooth): both layers get a rounded-rectangle mask that follows the container and a cover scale and position keyed every frame, so the outgoing content scales and crops into the incoming one, which fades in inside the container over the last third. One undo step.

Kit
Motion 0.1.0 (.kmotion)
Changes the document
yes

Parameters

Parameters of transition.morphRect
NameTypeRequiredDescription
compinteger | stringno
easestring | number[]noa curve name (snappy, out, smooth, swift, settle, pop, reseat, fly, linear) or [x1, y1, x2, y2]
framesnumbernodefault 18
frominteger | stringnothe outgoing layer (its on-screen rectangle at start)
motionBlurbooleannodefault true
radiusnumber | number[]nocorner radius px: a number or [from, to]
startnumbernoseconds; comp time; default the current time
tointeger | stringnothe incoming layer (its rectangle at the end)

Call through motion_run

text
motion_run {
  "path": "<file>.kmotion",
  "steps": [{ "command": "transition.morphRect" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: comp, ease, frames, from, motionBlur, radius, start, to. motion_run answers the step’s result in completed[i].result.

Result

The kit gives no result schema for this command.

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "comp": {
      "oneOf": [
        {
          "description": "item id",
          "type": "integer"
        },
        {
          "description": "comp name",
          "type": "string"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Item"
      ]
    },
    "ease": {
      "description": "a curve name (snappy, out, smooth, swift, settle, pop, reseat, fly, linear) or [x1, y1, x2, y2]",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "items": {
            "type": "number"
          },
          "type": "array"
        }
      ]
    },
    "frames": {
      "description": "default 18",
      "type": "number"
    },
    "from": {
      "description": "the outgoing layer (its on-screen rectangle at start)",
      "oneOf": [
        {
          "description": "layer id or 1-based index",
          "type": "integer"
        },
        {
          "description": "layer name or #n",
          "type": "string"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Layer"
      ]
    },
    "motionBlur": {
      "description": "default true",
      "type": "boolean"
    },
    "radius": {
      "description": "corner radius px: a number or [from, to]",
      "oneOf": [
        {
          "type": "number"
        },
        {
          "items": {
            "type": "number"
          },
          "type": "array"
        }
      ]
    },
    "start": {
      "description": "seconds; comp time; default the current time",
      "type": "number"
    },
    "to": {
      "description": "the incoming layer (its rectangle at the end)",
      "oneOf": [
        {
          "description": "layer id or 1-based index",
          "type": "integer"
        },
        {
          "description": "layer name or #n",
          "type": "string"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Layer"
      ]
    }
  },
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (motion_commands through @kition/[email protected], built from KitionAI/kition-motion@4719aa7). As data: commands.jsonl.