---
title: "paint.stroke: Paint Stroke — Motion kit command — Kition"
description: "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."
canonical: "https://developer.kition.ai/docs/kits/motion/commands/paint.stroke"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/motion/commands/paint.stroke](https://developer.kition.ai/docs/kits/motion/commands/paint.stroke)

# 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); reference: [Motion kit commands](https://developer.kition.ai/docs/kits/motion.md)
- Changes the document: yes
- Acts on: `layer` (one id), which a run step’s `on` fills

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `angle` | `number` | no |  |
| `channels` | `"RGBA" \| "RGB" \| "Alpha"` | no |  |
| `clonePosition` | `number[]` | no |  |
| `cloneSource` | `integer \| string` | no | layer id |
| `cloneTime` | `number` | no | s |
| `cloneTimeShift` | `number` | no | (s) |
| `color` | `number[]` | no | [r, g, b, a] |
| `customFrames` | `integer` | no |  |
| `diameter` | `number` | no |  |
| `duration` | `number` | no | s, drawing time for Write On |
| `durationMode` | `"constant" \| "writeOn" \| "singleFrame" \| "custom"` | no |  |
| `eraseMode` | `"layerSourceAndPaint" \| "paintOnly" \| "lastStrokeOnly"` | no |  |
| `flow` | `number` | no |  |
| `flowPressure` | `boolean` | no |  |
| `frame` | `integer` | no | one of several alternative parameters |
| `hardness` | `number` | no |  |
| `kind` | `"brush" \| "clone" \| "eraser"` | no |  |
| `layer` | `integer \| string` | no |  |
| `lockSourceTime` | `boolean` | no |  |
| `minSize` | `number` | no |  |
| `mode` | `string` | no |  |
| `opacity` | `number` | no |  |
| `opacityPressure` | `boolean` | no |  |
| `points` | `any[]` | no | [[x,y,pressure?],…] (effect space); effect space |
| `roundness` | `number` | no |  |
| `sizePressure` | `boolean` | no |  |
| `spacing` | `number` | no |  |
| `time` | `number` | no | (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/motion-darwin-arm64@0.1.0 and the kit itself (motion_commands through @kition/cli@0.1.1, built from KitionAI/kition-motion@4719aa7).
