Scene kit command

view.set

Set View

Sets the viewport's target, distance, turn, tilt and projection at once; looking through a camera, `cameraZoom` and `cameraOffset` alone zoom and move its frame and keep the camera view.

Kit
Scene 0.1.0 (.kscene)
Changes the document
no

Parameters

Parameters of view.set
NameTypeRequiredDescription
cameraOffsetnumber[]noLooking through a camera: its frame's centre, in half viewports right and up of the centre [x, y]
cameraZoomnumbernoLooking through a camera: how large its frame shows, 0.1 to 16 (1 fits the viewport)
distancenumbernoMetres from the target
perspectivebooleannoPerspective or orthographic
targetnumber[]noThe point the view turns around [x, y, z]
tiltnumbernoDegrees: 0 looks down, 90 level
turnnumbernoDegrees about the up axis

Call through scene_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: cameraOffset, cameraZoom, distance, perspective, target, tilt, turn. scene_run answers the step’s result in completed[i].result.

Result

Result of view.set
NameTypeRequiredDescription
changedbooleanno
Result JSON Schema
json
{
  "additionalProperties": true,
  "properties": {
    "changed": {
      "type": "boolean"
    }
  },
  "type": "object"
}

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "cameraOffset": {
      "description": "Looking through a camera: its frame's centre, in half viewports right and up of the centre [x, y]",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "cameraZoom": {
      "description": "Looking through a camera: how large its frame shows, 0.1 to 16 (1 fits the viewport)",
      "type": "number"
    },
    "distance": {
      "description": "Metres from the target",
      "type": "number"
    },
    "perspective": {
      "description": "Perspective or orthographic",
      "type": "boolean"
    },
    "target": {
      "description": "The point the view turns around [x, y, z]",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "tilt": {
      "description": "Degrees: 0 looks down, 90 level",
      "type": "number"
    },
    "turn": {
      "description": "Degrees about the up axis",
      "type": "number"
    }
  },
  "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.