Scene kit command

file.export

Export

Exports the scene (or `selectedOnly`) as glTF/GLB, OBJ, STL, FBX, USD (usda, usdc, usdz) or a PNG render and answers the file as base64. Does not change the scene.

Kit
Scene 0.1.0 (.kscene)
Changes the document
no

Parameters

Parameters of file.export
NameTypeRequiredDescription
format"glb" | "gltf" | "obj" | "stl" | "fbx" | "usda" | "usdc" | "usdz" | "png"yesThe file format
framenumbernopng: the frame to render (the current frame when left out)
samplesintegernopng: samples per pixel side, 1 to 4 (2)
selectedOnlybooleannoOnly the selected objects

Call through scene_run

text
scene_run {
  "path": "<file>.kscene",
  "steps": [{ "command": "file.export", "params": { "format": <"glb" | "gltf" | "obj" | "stl" | "fbx" | "usda" | "usdc" | "usdz" | "png"> } }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: frame, samples, selectedOnly. scene_run answers the step’s result in completed[i].result.

Result

Result of file.export
NameTypeRequiredDescription
base64stringno
extensionstringno
formatstringno
mimestringno
Result JSON Schema
json
{
  "additionalProperties": true,
  "properties": {
    "base64": {
      "type": "string"
    },
    "extension": {
      "type": "string"
    },
    "format": {
      "type": "string"
    },
    "mime": {
      "type": "string"
    }
  },
  "type": "object"
}

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "format": {
      "description": "The file format",
      "enum": [
        "glb",
        "gltf",
        "obj",
        "stl",
        "fbx",
        "usda",
        "usdc",
        "usdz",
        "png"
      ],
      "type": "string"
    },
    "frame": {
      "description": "png: the frame to render (the current frame when left out)",
      "type": "number"
    },
    "samples": {
      "description": "png: samples per pixel side, 1 to 4 (2)",
      "type": "integer"
    },
    "selectedOnly": {
      "description": "Only the selected objects",
      "type": "boolean"
    }
  },
  "required": [
    "format"
  ],
  "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.