Film kit command

file.render

Render Preview

Renders what the Program monitor shows of a sequence at a time, as a PNG, without moving the playhead or opening the sequence: `target.time` (seconds from the sequence's start) for one frame, or `target.range` [from, to] with `target.frames` (2 to 12) for a contact sheet of frames laid out in a grid, each labelled with its time. `target.sequence` names the sequence by its item id; without it, the project's main sequence (the only one no other sequence holds). Without a target it answers a contact sheet of the whole sequence. Changes nothing.

Kit
Film 0.1.0 (.kfilm)
Changes the document
no

Parameters

Parameters of file.render
NameTypeRequiredDescription
maxSizeintegernoThe most pixels on the picture's longer side, 16 to 4096 (default 1024).
scalenumbernoPicture pixels per sequence pixel, above 0 and at most 2 (default 1). A contact sheet's frames are each drawn at this scale. Reduced so the picture fits `maxSize`.
targetobjectnoWhat to show. `time` alone shows one frame; `range` with `frames` a contact sheet; neither, the whole sequence as a contact sheet.

Call through film_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: maxSize, scale, target. film_run answers the step’s result in completed[i].result.

Result

Result of file.render
NameTypeRequiredDescription
columnsintegeryes
framesany[]yesEach frame drawn, in reading order: {time (seconds at the frame's start), frame (counted from 0), label}.
heightintegeryes
mimeTypestringyes
pngstringyesThe picture as base64 PNG.
rowsintegeryes
scalenumberyesThe scale each frame was drawn at, after `maxSize`.
sequenceintegeryesThe sequence drawn.
widthintegeryes
Result JSON Schema
json
{
  "additionalProperties": false,
  "properties": {
    "columns": {
      "type": "integer"
    },
    "frames": {
      "description": "Each frame drawn, in reading order: {time (seconds at the frame's start), frame (counted from 0), label}.",
      "items": {},
      "type": "array"
    },
    "height": {
      "type": "integer"
    },
    "mimeType": {
      "type": "string"
    },
    "png": {
      "description": "The picture as base64 PNG.",
      "type": "string"
    },
    "rows": {
      "type": "integer"
    },
    "scale": {
      "description": "The scale each frame was drawn at, after `maxSize`.",
      "type": "number"
    },
    "sequence": {
      "description": "The sequence drawn.",
      "type": "integer"
    },
    "width": {
      "type": "integer"
    }
  },
  "required": [
    "columns",
    "frames",
    "height",
    "mimeType",
    "png",
    "rows",
    "scale",
    "sequence",
    "width"
  ],
  "type": "object"
}

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "maxSize": {
      "description": "The most pixels on the picture's longer side, 16 to 4096 (default 1024).",
      "type": "integer"
    },
    "scale": {
      "description": "Picture pixels per sequence pixel, above 0 and at most 2 (default 1). A contact sheet's frames are each drawn at this scale. Reduced so the picture fits `maxSize`.",
      "type": "number"
    },
    "target": {
      "additionalProperties": false,
      "description": "What to show. `time` alone shows one frame; `range` with `frames` a contact sheet; neither, the whole sequence as a contact sheet.",
      "properties": {
        "frames": {
          "description": "How many frames the contact sheet of `range` shows, 2 to 12 (default 6).",
          "type": "integer"
        },
        "path": {
          "description": "A diagnostic's target: `sequence:<id>` names the sequence, `sequence:<id>/clip:<id>` shows the middle of that clip unless `time` or `range` is given.",
          "type": "string"
        },
        "range": {
          "description": "[from, to]: seconds from the start of the sequence, from < to, within it. The frames are spread evenly from `from` to `to`, both included; `to` at the sequence's end shows its last frame.",
          "items": {
            "type": "number"
          },
          "type": "array"
        },
        "sequence": {
          "description": "The sequence's item id (`item` in the project's items). Needed when the project has several sequences that no other sequence holds.",
          "type": "integer"
        },
        "time": {
          "description": "Seconds from the start of the sequence, from 0 to before its end. The frame showing at that time is drawn.",
          "type": "number"
        }
      },
      "type": "object"
    }
  },
  "returns": "{png (base64), mimeType, width, height, scale, sequence, frames: [{time, frame, label}], columns, rows}",
  "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.