Scene kit command

camera.set

Camera Settings

Changes camera `object`: lens, clipping, sensor width (`sensor`), `sensorHeight` (1–200 mm), `sensorFit` (auto, horizontal, vertical), depth of field and aperture blades. Auto fits sensor width to the longer render dimension; Horizontal holds width; Vertical holds sensor height. Orthographic scale follows the same fitted dimension. Square render pixels only.

Kit
Scene 0.1.0 (.kscene)
Changes the document
yes
Acts on
object (one id), which a run step’s on fills

Parameters

Parameters of camera.set
NameTypeRequiredDescription
bladeRotationnumbernoThe blades' turn in degrees (0)
bladesintegernoThe opening's blades: 0 for round (the default), 3 to 64 for a polygon
clipEndnumbernoFarthest distance drawn, metres
clipStartnumbernoNearest distance drawn, metres
depthOfFieldbooleannoBlur what is out of focus in path-traced renders
fStopnumbernoAperture as an f-number (2.8); smaller blurs more
focusDistancenumbernoMetres in front of the camera that are sharp (10)
focusObjectinteger | string | nullnoAn object to keep in focus (an id or a name), or null for the distance
lensnumbernoFocal length in millimetres
objectinteger | stringnoThe camera; the active object when left out
orthoScalenumbernoSpan along the fitted frame dimension, metres
orthographicbooleannoOrthographic instead of perspective
picknumber[]noInstead of `object`/`objects`: a world point [x, y, z] in metres; the command acts on the object there now (the smallest whose mesh's bounds hold the point, else the nearest light, camera, empty, curve, text, lattice or armature whose origin is within 0.25 m). A place: with `basis`, a write by it is refused when what is at the point is no longer what was there (moved away, another moved in, its parent moved)
rationumbernoThe opening's height over its width for anamorphic bokeh (1); above 1 narrows it
sensornumbernoSensor width in millimetres, used by Auto and Horizontal
sensorFit"auto" | "horizontal" | "vertical"noFrame dimension held by the sensor or orthographic scale; Auto holds the longer dimension
sensorHeightnumbernoSensor height in millimetres, 1 to 200; used by Vertical

Call through scene_run

text
scene_run {
  "path": "<file>.kscene",
  "steps": [{ "command": "camera.set" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: bladeRotation, blades, clipEnd, clipStart, depthOfField, fStop, focusDistance, focusObject, lens, object, orthoScale, orthographic, pick, ratio, sensor, sensorFit, sensorHeight. scene_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": {
    "bladeRotation": {
      "description": "The blades' turn in degrees (0)",
      "type": "number"
    },
    "blades": {
      "description": "The opening's blades: 0 for round (the default), 3 to 64 for a polygon",
      "type": "integer"
    },
    "clipEnd": {
      "description": "Farthest distance drawn, metres",
      "type": "number"
    },
    "clipStart": {
      "description": "Nearest distance drawn, metres",
      "type": "number"
    },
    "depthOfField": {
      "description": "Blur what is out of focus in path-traced renders",
      "type": "boolean"
    },
    "fStop": {
      "description": "Aperture as an f-number (2.8); smaller blurs more",
      "type": "number"
    },
    "focusDistance": {
      "description": "Metres in front of the camera that are sharp (10)",
      "type": "number"
    },
    "focusObject": {
      "description": "An object to keep in focus (an id or a name), or null for the distance",
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Object"
      ]
    },
    "lens": {
      "description": "Focal length in millimetres",
      "type": "number"
    },
    "object": {
      "description": "The camera; the active object when left out",
      "oneOf": [
        {
          "description": "the object's id",
          "type": "integer"
        },
        {
          "description": "the object's name",
          "type": "string"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Object"
      ]
    },
    "orthoScale": {
      "description": "Span along the fitted frame dimension, metres",
      "type": "number"
    },
    "orthographic": {
      "description": "Orthographic instead of perspective",
      "type": "boolean"
    },
    "pick": {
      "description": "Instead of `object`/`objects`: a world point [x, y, z] in metres; the command acts on the object there now (the smallest whose mesh's bounds hold the point, else the nearest light, camera, empty, curve, text, lattice or armature whose origin is within 0.25 m). A place: with `basis`, a write by it is refused when what is at the point is no longer what was there (moved away, another moved in, its parent moved)",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "ratio": {
      "description": "The opening's height over its width for anamorphic bokeh (1); above 1 narrows it",
      "type": "number"
    },
    "sensor": {
      "description": "Sensor width in millimetres, used by Auto and Horizontal",
      "type": "number"
    },
    "sensorFit": {
      "description": "Frame dimension held by the sensor or orthographic scale; Auto holds the longer dimension",
      "enum": [
        "auto",
        "horizontal",
        "vertical"
      ],
      "type": "string"
    },
    "sensorHeight": {
      "description": "Sensor height in millimetres, 1 to 200; used by Vertical",
      "type": "number"
    }
  },
  "type": "object",
  "x-khp-position": "independent"
}

Generated from the command list of @kition/[email protected] and the kit itself (scene_commands through @kition/[email protected], built from KitionAI/kition-scene@4d06faf). As data: commands.jsonl.