Scene kit command

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)
Changes the document
yes

Parameters

Parameters of material.setTexture
NameTypeRequiredDescription
base64stringnoThe image's bytes, instead of a path
clearbooleannoTake the image out of the slot
materialinteger | stringyesThe material's id or name
namestringnoThe image's name, with base64 bytes
pathstringnoA .png or .jpg file, relative to this scene's folder
slot"baseColor" | "metallicRoughness" | "normal"noThe 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/[email protected] and the kit itself (scene_commands through @kition/[email protected], built from KitionAI/kition-scene@4d06faf). As data: commands.jsonl.