Motion kit command

layer.new3dPrimitive

3D Primitive

Adds a 3D primitive layer: `kind` cube, sphere, plane, torus, cone or cylinder with size options, `position` [x, y, z] and material (`baseColor`, `metallic` and `roughness` as percents 0 to 100, `emissive`, shadows). Switches the comp to Advanced 3D.

Kit
Motion 0.1.0 (.kmotion)
Changes the document
yes

Parameters

Parameters of layer.new3dPrimitive
NameTypeRequiredDescription
acceptsLightsbooleanno
acceptsShadowsnumberno
baseColorstring | number[]no
castsShadowsbooleanno
compinteger | stringnoread by the command beside its listed parameters
depthintegerno
emissivestring | number[]no
heightnumberno
kind"cube" | "sphere" | "plane" | "torus" | "cone" | "cylinder"no
metallicnumberno
namestringno
positionany[]no[x,y,z]
radiusnumberno
ringsanyno
roughnessnumberno
segmentsnumberno
tubeRadiusanyno
typestringnoread by the command beside its listed parameters
widthnumberno

Call through motion_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: acceptsLights, acceptsShadows, baseColor, castsShadows, comp, depth, emissive, height, kind, metallic, name, position, radius, rings, roughness, segments, tubeRadius, type, width. 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": {
      "type": "number"
    },
    "baseColor": {
      "oneOf": [
        {
          "description": "#rrggbb",
          "type": "string"
        },
        {
          "description": "[r, g, b(, a)] 0 to 1",
          "items": {
            "type": "number"
          },
          "type": "array"
        }
      ]
    },
    "castsShadows": {
      "type": "boolean"
    },
    "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"
      ]
    },
    "depth": {
      "type": "integer"
    },
    "emissive": {
      "oneOf": [
        {
          "description": "#rrggbb",
          "type": "string"
        },
        {
          "description": "[r, g, b(, a)] 0 to 1",
          "items": {
            "type": "number"
          },
          "type": "array"
        }
      ]
    },
    "height": {
      "type": "number"
    },
    "kind": {
      "enum": [
        "cube",
        "sphere",
        "plane",
        "torus",
        "cone",
        "cylinder"
      ],
      "type": "string"
    },
    "metallic": {
      "type": "number"
    },
    "name": {
      "type": "string"
    },
    "position": {
      "description": "[x,y,z]",
      "type": "array"
    },
    "radius": {
      "type": "number"
    },
    "rings": {},
    "roughness": {
      "type": "number"
    },
    "segments": {
      "type": "number"
    },
    "tubeRadius": {},
    "type": {
      "description": "read by the command beside its listed parameters",
      "type": "string"
    },
    "width": {
      "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.