Motion kit command

layer.hop

Hop

Hops a layer along a 2D ballistic arc from where it is at `start` to `to`, `height` px above the start, over `frames`; stretches along the flight, lands with a squash of `squash` (the bottom stays on the ground) and rings out damped over `ringFrames`. Position and Scale keyed every frame. One undo step.

Kit
Motion 0.1.0 (.kmotion)
Changes the document
yes
Acts on
layer (one id), which a run step’s on fills

Parameters

Parameters of layer.hop
NameTypeRequiredDescription
compinteger | stringno
framesnumbernothe flight, default 18
heightnumbernopixels; apex above the straight line, default 160
layerinteger | stringnothe layer that hops
motionBlurbooleannodefault true
ringFramesnumbernodamped ring-out after landing, default 16
squashnumbernolanding squash, 0.25 = 125 % wide / 75 % tall
startnumbernoseconds; comp time; default the current time
stretchnumbernostretch along the flight, default 0.4 × squash
tonumber[]no[x, y] landing position (comp px)

Call through motion_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: comp, frames, height, layer, motionBlur, ringFrames, squash, start, stretch, 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"
      ]
    },
    "frames": {
      "description": "the flight, default 18",
      "type": "number"
    },
    "height": {
      "description": "pixels; apex above the straight line, default 160",
      "type": "number"
    },
    "layer": {
      "description": "the layer that hops",
      "oneOf": [
        {
          "description": "layer id or 1-based index",
          "type": "integer"
        },
        {
          "description": "layer name or #n",
          "type": "string"
        }
      ],
      "x-khp-index": "#",
      "x-khp-index-numbers": true,
      "x-khp-name": "name",
      "x-khp-types": [
        "Layer"
      ]
    },
    "motionBlur": {
      "description": "default true",
      "type": "boolean"
    },
    "ringFrames": {
      "description": "damped ring-out after landing, default 16",
      "type": "number"
    },
    "squash": {
      "description": "landing squash, 0.25 = 125 % wide / 75 % tall",
      "type": "number"
    },
    "start": {
      "description": "seconds; comp time; default the current time",
      "type": "number"
    },
    "stretch": {
      "description": "stretch along the flight, default 0.4 × squash",
      "type": "number"
    },
    "to": {
      "description": "[x, y] landing position (comp px)",
      "items": {
        "type": "number"
      },
      "type": "array"
    }
  },
  "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.