---
title: "file.export: Export — Scene kit command — Kition"
description: "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."
canonical: "https://developer.kition.ai/docs/kits/scene/commands/file.export"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/scene/commands/file.export](https://developer.kition.ai/docs/kits/scene/commands/file.export)

# 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); reference: [Scene kit commands](https://developer.kition.ai/docs/kits/scene.md)
- Changes the document: no

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `format` | `"glb" \| "gltf" \| "obj" \| "stl" \| "fbx" \| "usda" \| "usdc" \| "usdz" \| "png"` | yes | The file format |
| `frame` | `number` | no | png: the frame to render (the current frame when left out) |
| `samples` | `integer` | no | png: samples per pixel side, 1 to 4 (2) |
| `selectedOnly` | `boolean` | no | Only 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

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `base64` | `string` | no |  |
| `extension` | `string` | no |  |
| `format` | `string` | no |  |
| `mime` | `string` | no |  |

```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/scene-darwin-arm64@0.1.0 and the kit itself (scene_commands through @kition/cli@0.1.1, built from KitionAI/kition-scene@4d06faf).
