Vector kit command

object.setProps

Object Properties

Sets object properties on ids or the selection: name, visibility, lock, opacity, blend mode, isolation, knockout and custom data attributes.

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

Parameters

Parameters of object.setProps
NameTypeRequiredDescription
blendstringno
dataobjectno{key: "value" | null (removes it)} (the object's own data, SVG data-* attributes: {pivot: "100,180"} is data-pivot; file.node → attrs.data); removes it; the object's own data, SVG data-* attributes: {pivot: "100,180"} is data-pivot; file.node → attrs.data
dataBase64stringnoread by the command beside its listed parameters
idintegernoobject ID
idsinteger[]noobject IDs
isolatebooleanno
itemstringnoread by the command beside its listed parameters
knockout"on" | "off" | "neutral" | booleanno
knockoutShapebooleanno
lockedbooleanno
namestringno
opacityintegerno0 to 100
targetstringno"object" (default) or "contents": the objects themselves, or what their groups and layers hold
visiblebooleanno

Call through vector_run

text
vector_run {
  "path": "<file>.kvector",
  "steps": [{ "command": "object.setProps" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: blend, data, dataBase64, id, ids, isolate, item, knockout, knockoutShape, locked, name, opacity, target, visible. vector_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": {
    "blend": {
      "type": "string"
    },
    "data": {
      "additionalProperties": true,
      "description": "{key: \"value\" | null (removes it)} (the object's own data, SVG data-* attributes: {pivot: \"100,180\"} is data-pivot; file.node → attrs.data); removes it; the object's own data, SVG data-* attributes: {pivot: \"100,180\"} is data-pivot; file.node → attrs.data",
      "properties": {
        "key": {
          "description": "\"value\" | null"
        }
      },
      "type": "object"
    },
    "dataBase64": {
      "description": "read by the command beside its listed parameters",
      "type": "string"
    },
    "id": {
      "description": "object ID",
      "type": "integer",
      "x-khp-types": [
        "Node"
      ]
    },
    "ids": {
      "description": "object IDs",
      "items": {
        "type": "integer"
      },
      "type": "array",
      "x-khp-types": [
        "Node"
      ]
    },
    "isolate": {
      "type": "boolean"
    },
    "item": {
      "description": "read by the command beside its listed parameters",
      "type": "string"
    },
    "knockout": {
      "oneOf": [
        {
          "enum": [
            "on",
            "off",
            "neutral"
          ],
          "type": "string"
        },
        {
          "type": "boolean"
        }
      ]
    },
    "knockoutShape": {
      "type": "boolean"
    },
    "locked": {
      "type": "boolean"
    },
    "name": {
      "type": "string"
    },
    "opacity": {
      "description": "0 to 100",
      "type": "integer"
    },
    "target": {
      "description": "\"object\" (default) or \"contents\": the objects themselves, or what their groups and layers hold",
      "type": "string"
    },
    "visible": {
      "type": "boolean"
    }
  },
  "returns": "attrs.data)}",
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (vector_commands through @kition/[email protected], built from KitionAI/kition-vector@7cf908f). As data: commands.jsonl.