Film kit command

graphics.newShape

Shape

Adds a shape layer (`shape` rectangle|ellipse|polygon|path with `points`) to graphic `clip`, or a new graphic clip `seconds` long at the playhead. `position` and the path's `points` are frame pixels; a path without `position` sits at the centre of its points.

Kit
Film 0.1.0 (.kfilm)
Changes the document
yes
Acts on
clip (one id), which a run step’s on fills

Parameters

Parameters of graphics.newShape
NameTypeRequiredDescription
clipintegerno
frameintegerno
pointsnumber[][]no
positionnumber[]no
secondsnumberno
shape"rectangle" | "ellipse" | "polygon" | "path"no
sizenumber[]nodefault [400,200]
timeintegernoticks (254016000000 per second)
timecodestringno
trackintegernoa position counted from 0 (the first is 0)

Call through film_run

text
film_run {
  "path": "<file>.kfilm",
  "steps": [{ "command": "graphics.newShape" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: clip, frame, points, position, seconds, shape, size, time, timecode, track. film_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": {
    "clip": {
      "type": "integer",
      "x-khp-types": [
        "Clip"
      ]
    },
    "frame": {
      "type": "integer"
    },
    "points": {
      "items": {
        "items": {
          "type": "number"
        },
        "type": "array"
      },
      "type": "array"
    },
    "position": {
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "seconds": {
      "default": 5,
      "type": "number"
    },
    "shape": {
      "enum": [
        "rectangle",
        "ellipse",
        "polygon",
        "path"
      ],
      "type": "string"
    },
    "size": {
      "description": "default [400,200]",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "time": {
      "description": "ticks (254016000000 per second)",
      "type": "integer"
    },
    "timecode": {
      "type": "string"
    },
    "track": {
      "description": "a position counted from 0 (the first is 0)",
      "type": "integer"
    }
  },
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (film_commands through @kition/[email protected], built from KitionAI/kition-film@375db59). As data: commands.jsonl.