Motion kit command

layer.shake

Shake

Adds a deterministic decaying shake from `frame` (comp seconds) to a layer's position and rotation, or a camera's position, point of interest and Z rotation: `amplitude` px and `rotation` degrees falling off by exp(-decay t) at `frequency` Hz with phases from `seed`; zero before `frame`; written as an expression on top of the existing keys or expression. 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.shake
NameTypeRequiredDescription
amplitudenumbernopixels; default 14
camerainteger | string | booleannoa camera layer, or true for the comp's top camera
compinteger | stringno
decaynumbernoper second: falls off as exp(-decay t), default 6
framenumbernoseconds; comp time of the hit; zero before it; default the current time
frequencyanynoHz (default 12); default 12
layerinteger | stringnothe layer (or camera layer) to shake
qualitystringnoread by the command beside its listed parameters
rotationnumbernodegrees; default 1.5
seedintegernodefault 1
trackerinteger | stringnoread by the command beside its listed parameters

Call through motion_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: amplitude, camera, comp, decay, frame, frequency, layer, quality, rotation, seed, tracker. 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": {
    "amplitude": {
      "description": "pixels; default 14",
      "type": "number"
    },
    "camera": {
      "description": "a camera layer, or true for the comp's top camera",
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "string"
        },
        {
          "type": "boolean"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Layer"
      ]
    },
    "comp": {
      "oneOf": [
        {
          "description": "item id",
          "type": "integer"
        },
        {
          "description": "comp name",
          "type": "string"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Item"
      ]
    },
    "decay": {
      "description": "per second: falls off as exp(-decay t), default 6",
      "type": "number"
    },
    "frame": {
      "description": "seconds; comp time of the hit; zero before it; default the current time",
      "type": "number"
    },
    "frequency": {
      "description": "Hz (default 12); default 12"
    },
    "layer": {
      "description": "the layer (or camera layer) to shake",
      "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"
      ]
    },
    "quality": {
      "description": "read by the command beside its listed parameters",
      "type": "string"
    },
    "rotation": {
      "description": "degrees; default 1.5",
      "type": "number"
    },
    "seed": {
      "description": "default 1",
      "type": "integer"
    },
    "tracker": {
      "description": "read by the command beside its listed parameters",
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "string"
        }
      ]
    }
  },
  "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.