---
title: "material.setTexture: Set Material Image — Scene kit command — Kition"
description: "Sets an image (workspace `path` or base64) as a texture slot (base color, normal, roughness, …) of `material`, or clears it."
canonical: "https://developer.kition.ai/docs/kits/scene/commands/material.setTexture"
---

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

# material.setTexture

**Set Material Image.** Sets an image (workspace `path` or base64) as a texture slot (base color, normal, roughness, …) of `material`, or clears it.

- Kit: Scene 0.1.0 (.kscene); reference: [Scene kit commands](https://developer.kition.ai/docs/kits/scene.md)
- Changes the document: yes

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `base64` | `string` | no | The image's bytes, instead of a path |
| `clear` | `boolean` | no | Take the image out of the slot |
| `material` | `integer \| string` | yes | The material's id or name |
| `name` | `string` | no | The image's name, with base64 bytes |
| `path` | `string` | no | A .png or .jpg file, relative to this scene's folder |
| `slot` | `"baseColor" \| "metallicRoughness" \| "normal"` | no | The image slot (baseColor) |

## Call through scene_run

```text
scene_run {
  "path": "<file>.kscene",
  "steps": [{ "command": "material.setTexture", "params": { "material": <integer | string> } }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `base64`, `clear`, `name`, `path`, `slot`. 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": {
    "base64": {
      "description": "The image's bytes, instead of a path",
      "type": "string"
    },
    "clear": {
      "description": "Take the image out of the slot",
      "type": "boolean"
    },
    "material": {
      "description": "The material's id or name",
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "string"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Material"
      ]
    },
    "name": {
      "description": "The image's name, with base64 bytes",
      "type": "string"
    },
    "path": {
      "description": "A .png or .jpg file, relative to this scene's folder",
      "type": "string",
      "x-khp-file": {
        "accept": [
          "png",
          "jpg",
          "jpeg"
        ],
        "access": "read"
      }
    },
    "slot": {
      "description": "The image slot (baseColor)",
      "enum": [
        "baseColor",
        "metallicRoughness",
        "normal"
      ],
      "type": "string"
    }
  },
  "required": [
    "material"
  ],
  "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).
