Scene kit command

object.addLight

Light

Adds a light (point, sun, spot or area) with color and power at `location` (with rotation, scale and `name`) and answers its name and object id; name it to address it in the same run.

Kit
Scene 0.1.0 (.kscene)
Changes the document
yes

Parameters

Parameters of object.addLight
NameTypeRequiredDescription
colornumber[] | stringnoColour
kind"point" | "sun" | "spot" | "area"noThe kind of light
locationnumber[]noWhere to put it, in metres (the origin when left out) [x, y, z]
namestringnoThe object's name
powernumbernoWatts (W/m² for a sun)
rotationnumber[]noRotation in degrees, XYZ Euler [x, y, z]
scalenumber[]noScale [x, y, z]

Call through scene_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: color, kind, location, name, power, rotation, scale. 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": {
    "color": {
      "description": "Colour",
      "oneOf": [
        {
          "description": "[r, g, b] or [r, g, b, a], linear, 0 to 1",
          "items": {
            "type": "number"
          },
          "type": "array"
        },
        {
          "description": "#rrggbb (sRGB)",
          "type": "string"
        }
      ]
    },
    "kind": {
      "description": "The kind of light",
      "enum": [
        "point",
        "sun",
        "spot",
        "area"
      ],
      "type": "string"
    },
    "location": {
      "description": "Where to put it, in metres (the origin when left out) [x, y, z]",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "name": {
      "description": "The object's name",
      "type": "string"
    },
    "power": {
      "description": "Watts (W/m² for a sun)",
      "type": "number"
    },
    "rotation": {
      "description": "Rotation in degrees, XYZ Euler [x, y, z]",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "scale": {
      "description": "Scale [x, y, z]",
      "items": {
        "type": "number"
      },
      "type": "array"
    }
  },
  "type": "object"
}

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.