Motion kit command

paint.stroke

Paint Stroke

Paints one stroke on a layer (adds a Paint effect if needed): `kind` brush, clone or eraser, `points` [[x, y, pressure]] in effect space, at `time`, with colour, size and opacity options; `durationMode` writeOn animates it.

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 paint.stroke
NameTypeRequiredDescription
anglenumberno
channels"RGBA" | "RGB" | "Alpha"no
clonePositionnumber[]no
cloneSourceinteger | stringnolayer id
cloneTimenumbernos
cloneTimeShiftnumberno(s)
colornumber[]no[r, g, b, a]
customFramesintegerno
diameternumberno
durationnumbernos, drawing time for Write On
durationMode"constant" | "writeOn" | "singleFrame" | "custom"no
eraseMode"layerSourceAndPaint" | "paintOnly" | "lastStrokeOnly"no
flownumberno
flowPressurebooleanno
frameintegernoone of several alternative parameters
hardnessnumberno
kind"brush" | "clone" | "eraser"no
layerinteger | stringno
lockSourceTimebooleanno
minSizenumberno
modestringno
opacitynumberno
opacityPressurebooleanno
pointsany[]no[[x,y,pressure?],…] (effect space); effect space
roundnessnumberno
sizePressurebooleanno
spacingnumberno
timenumberno(s) | frame?

Call through motion_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: angle, channels, clonePosition, cloneSource, cloneTime, cloneTimeShift, color, customFrames, diameter, duration, durationMode, eraseMode, flow, flowPressure, frame, hardness, kind, layer, lockSourceTime, minSize, mode, opacity, opacityPressure, points, roundness, sizePressure, spacing, time. 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": {
    "angle": {
      "type": "number"
    },
    "channels": {
      "enum": [
        "RGBA",
        "RGB",
        "Alpha"
      ],
      "type": "string"
    },
    "clonePosition": {
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "cloneSource": {
      "description": "layer id",
      "oneOf": [
        {
          "description": "layer id or 1-based index",
          "type": "integer"
        },
        {
          "description": "layer name or #n",
          "type": "string"
        }
      ],
      "x-khp-types": [
        "Layer"
      ]
    },
    "cloneTime": {
      "description": "s",
      "type": "number"
    },
    "cloneTimeShift": {
      "description": "(s)",
      "type": "number"
    },
    "color": {
      "description": "[r, g, b, a]",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "customFrames": {
      "type": "integer"
    },
    "diameter": {
      "type": "number"
    },
    "duration": {
      "description": "s, drawing time for Write On",
      "type": "number"
    },
    "durationMode": {
      "enum": [
        "constant",
        "writeOn",
        "singleFrame",
        "custom"
      ],
      "type": "string"
    },
    "eraseMode": {
      "enum": [
        "layerSourceAndPaint",
        "paintOnly",
        "lastStrokeOnly"
      ],
      "type": "string"
    },
    "flow": {
      "type": "number"
    },
    "flowPressure": {
      "type": "boolean"
    },
    "frame": {
      "description": "one of several alternative parameters",
      "type": "integer"
    },
    "hardness": {
      "type": "number"
    },
    "kind": {
      "enum": [
        "brush",
        "clone",
        "eraser"
      ],
      "type": "string"
    },
    "layer": {
      "oneOf": [
        {
          "description": "layer id as motion_inspect lists it (when no layer has that id, its 1-based stack position)",
          "type": "integer"
        },
        {
          "description": "layer id as receipts print it (\"51\"), a layer name, or #n for the n-th from the top",
          "type": "string"
        }
      ],
      "x-khp-index": "#",
      "x-khp-index-numbers": true,
      "x-khp-name": "name",
      "x-khp-types": [
        "Layer"
      ]
    },
    "lockSourceTime": {
      "type": "boolean"
    },
    "minSize": {
      "type": "number"
    },
    "mode": {
      "type": "string"
    },
    "opacity": {
      "type": "number"
    },
    "opacityPressure": {
      "type": "boolean"
    },
    "points": {
      "description": "[[x,y,pressure?],…] (effect space); effect space",
      "type": "array"
    },
    "roundness": {
      "type": "number"
    },
    "sizePressure": {
      "type": "boolean"
    },
    "spacing": {
      "type": "number"
    },
    "time": {
      "description": "(s) | frame?",
      "type": "number"
    }
  },
  "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.