Motion kit command

material.set

Material Options

Sets material options on 3D `layers` at `time`: `castsShadows` and `acceptsShadows` (off, on, only), `acceptsLights`, reflections, `baseColor`, `metallic` and `roughness` (percents 0 to 100, a primitive's), `emissive`, and a card's specular and light transmission. Fails when no given layer has an option named.

Kit
Motion 0.1.0 (.kmotion)
Changes the document
yes
Acts on
layers (a list of ids), which a run step’s on fills

Parameters

Parameters of material.set
NameTypeRequiredDescription
acceptsLightsbooleanno
acceptsShadows"off" | "on" | "only"no
ambientnumberno
appearsInReflectionsbooleanno
baseColorstring | number[]no
castsShadows"off" | "on" | "only"no
compinteger | stringnoread by the command beside its listed parameters
diffusenumberno
emissivestring | number[]no
layerinteger | stringnoread by the command beside its listed parameters
layers(integer | string)[]no
lightTransmissionnumberno
metalnumberno
metallicnumberno
roughnessnumberno
specularIntensitynumberno
specularShininessnumberno
timenumberno

Call through motion_run

text
motion_run {
  "path": "<file>.kmotion",
  "steps": [{ "command": "material.set" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: acceptsLights, acceptsShadows, ambient, appearsInReflections, baseColor, castsShadows, comp, diffuse, emissive, layer, layers, lightTransmission, metal, metallic, roughness, specularIntensity, specularShininess, time. motion_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": {
    "acceptsLights": {
      "type": "boolean"
    },
    "acceptsShadows": {
      "enum": [
        "off",
        "on",
        "only"
      ],
      "type": "string"
    },
    "ambient": {
      "type": "number"
    },
    "appearsInReflections": {
      "type": "boolean"
    },
    "baseColor": {
      "oneOf": [
        {
          "description": "#rrggbb",
          "type": "string"
        },
        {
          "description": "[r, g, b(, a)] 0 to 1",
          "items": {
            "type": "number"
          },
          "type": "array"
        }
      ]
    },
    "castsShadows": {
      "enum": [
        "off",
        "on",
        "only"
      ],
      "type": "string"
    },
    "comp": {
      "description": "read by the command beside its listed parameters",
      "oneOf": [
        {
          "description": "comp's item id as motion_inspect lists it",
          "type": "integer"
        },
        {
          "description": "the item id as receipts print it (\"1\"), or the comp's name",
          "type": "string"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Item"
      ]
    },
    "diffuse": {
      "type": "number"
    },
    "emissive": {
      "oneOf": [
        {
          "description": "#rrggbb",
          "type": "string"
        },
        {
          "description": "[r, g, b(, a)] 0 to 1",
          "items": {
            "type": "number"
          },
          "type": "array"
        }
      ]
    },
    "layer": {
      "description": "read by the command beside its listed parameters",
      "oneOf": [
        {
          "description": "layer id as motion_inspect lists it (when no layer has that id, its 1-based stack position)",
          "type": "integer"
        },
        {
          "description": "layer id as receipts print it (\"51\"), a layer name, or #n for the n-th from the top",
          "type": "string"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Layer"
      ]
    },
    "layers": {
      "items": {
        "oneOf": [
          {
            "description": "layer id as motion_inspect lists it (when no layer has that id, its 1-based stack position)",
            "type": "integer"
          },
          {
            "description": "layer id as receipts print it (\"51\"), a layer name, or #n for the n-th from the top",
            "type": "string"
          }
        ]
      },
      "type": "array",
      "x-khp-index": "#",
      "x-khp-index-numbers": true,
      "x-khp-name": "name",
      "x-khp-types": [
        "Layer"
      ]
    },
    "lightTransmission": {
      "type": "number"
    },
    "metal": {
      "type": "number"
    },
    "metallic": {
      "type": "number"
    },
    "roughness": {
      "type": "number"
    },
    "specularIntensity": {
      "type": "number"
    },
    "specularShininess": {
      "type": "number"
    },
    "time": {
      "type": "number"
    }
  },
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (motion_commands through @kition/[email protected], built from KitionAI/kition-motion@4719aa7). As data: commands.jsonl.