Scene kit command

constraint.set

Change Constraint

Changes the settings of constraint `index` or `name`.

Kit
Scene 0.1.0 (.kscene)
Changes the document
yes
Acts on
object (one id), which a run step’s on fills

Parameters

Parameters of constraint.set
NameTypeRequiredDescription
actionstringnoaction: the action's name
axesboolean[]nocopyLocation and copyRotation: [x, y, z] axes copied
axis"x" | "y" | "z" | "-x" | "-y" | "-z"nofloor: the plane's side the owner stays on
bonestringnoA bone of the owner (an armature) to constrain instead of the object; the active bone in pose mode
bulgenumbernostretchTo and splineIk: how strongly the other axes thin as it stretches, 0 to 100 (1 keeps the volume)
chainintegernoik: bones in the chain counting this one, 0 runs to the root; splineIk: bones fitted to the curve (1)
chainOffsetbooleannosplineIk: keep the chain's root where it is
channel"locationX" | "locationY" | "locationZ" | "rotationX" | "rotationY" | "rotationZ" | "scaleX" | "scaleY" | "scaleZ"noaction: the target's channel that picks the frame
curveRadiusbooleannosplineIk: the curve's radius scales the bones' thickness (true)
enabledbooleannoOn or off
evenDivisionsbooleannosplineIk: share the curve evenly between the bones
extrapolatebooleannotransform: map values beyond the source range too
frameEndnumbernoaction: the frame the channel's maximum plays
frameStartnumbernoaction: the frame the channel's minimum plays
fromMaxnumber[]notransform: the source range's high end [x, y, z]
fromMinnumber[]notransform: the source range's low end (degrees for rotation) [x, y, z]
indexintegernoThe constraint's position in the stack, from 0
influencenumbernoHow much of the result is used, 0 to 1 (1)
invertboolean[]nocopyLocation and copyRotation: [x, y, z] axes inverted
iterationsintegernoik: solver iterations (500)
keepAxis"swingY" | "planeX" | "planeZ"nostretchTo: how Y turns to the target
limitboolean[]nolimitRotation: [x, y, z] angles limited
mapFrom"location" | "rotation" | "scale"notransform: the target's channel read
mapTo"location" | "rotation" | "scale"notransform: the owner's channel set
mapping("x" | "y" | "z")[]notransform: for the owner's x, y, z, the target axis each reads
maxnumber[] | numbernolimitRotation: highest angles, degrees [x, y, z]; action: the channel value that plays frameEnd
minnumber[] | numbernolimitRotation: lowest angles, degrees [x, y, z]; action: the channel value that plays frameStart (degrees for rotation)
mix"add" | "replace" | "before" | "after" | "multiply" | "beforeFull" | "beforeSplit" | "afterFull" | "afterSplit"notransform: add or replace (location), add, replace, before, or after (rotation), replace or multiply (scale); action: how the action combines with the owner
namestringnoThe constraint's name (instead of index)
objectinteger | stringnoThe owner; the active object when left out
offsetnumbernocopyLocation: true adds to the owner's location; floor: metres beyond the plane
ownerSpace"world" | "local" | "pose" | "localWithParent"nocopyLocation, copyRotation, transform: the space the owner is read in (pose and localWithParent on bones)
picknumber[]noInstead of `object`/`objects`: a world point [x, y, z] in metres; the command acts on the object there now (the smallest whose mesh's bounds hold the point, else the nearest light, camera, empty, curve, text, lattice or armature whose origin is within 0.25 m). A place: with `basis`, a write by it is refused when what is at the point is no longer what was there (moved away, another moved in, its parent moved)
poleinteger | stringnoik: the pole target object
poleAnglenumbernoik: degrees the chain turns from the pole
poleBonestringnoik: a bone of the pole target
preserveVolumebooleannoarmature: blend the bones as dual quaternions
renamestringnoA new name
restLengthnumbernostretchTo: the distance, in the owner's Y units, at which it does not stretch; 0 takes the distance now
space"world" | "local" | "pose" | "localWithParent"nolimitRotation: the space the angles are read in (pose and localWithParent on bones)
targetinteger | stringnoThe target object
targetBonestringnoA bone of the target (an armature) to use instead of the object
targetSpace"world" | "local" | "pose" | "localWithParent"nocopyLocation, copyRotation, transform, action: the space the target is read in
targetsobject[]noarmature: the bones that move the owner, as { object, bone, weight }
toMaxnumber[]notransform: the destination range's high end [x, y, z]
toMinnumber[]notransform: the destination range's low end (degrees for rotation) [x, y, z]
trackAxis"x" | "y" | "z" | "-x" | "-y" | "-z"notrackTo and dampedTrack: the axis pointed at the target
upAxis"x" | "y" | "z"notrackTo: the axis kept up
useRotationbooleannofloor: the plane turns with the target
volume"xzx" | "x" | "z" | "none"nostretchTo: the axes that thin
xzScale"none" | "boneOriginal" | "inversePreserve" | "volumePreserve"nosplineIk: the bones' thickness
yScale"none" | "fitCurve" | "boneOriginal"nosplineIk: the bones' lengths

Call through scene_run

text
scene_run {
  "path": "<file>.kscene",
  "steps": [{ "command": "constraint.set" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: action, axes, axis, bone, bulge, chain, chainOffset, channel, curveRadius, enabled, evenDivisions, extrapolate, frameEnd, frameStart, fromMax, fromMin, index, influence, invert, iterations, keepAxis, limit, mapFrom, mapTo, mapping, max, min, mix, name, object, offset, ownerSpace, pick, pole, poleAngle, poleBone, preserveVolume, rename, restLength, space, target, targetBone, targetSpace, targets, toMax, toMin, trackAxis, upAxis, useRotation, volume, xzScale, yScale. 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": {
    "action": {
      "description": "action: the action's name",
      "type": "string"
    },
    "axes": {
      "description": "copyLocation and copyRotation: [x, y, z] axes copied",
      "items": {
        "type": "boolean"
      },
      "type": "array"
    },
    "axis": {
      "description": "floor: the plane's side the owner stays on",
      "enum": [
        "x",
        "y",
        "z",
        "-x",
        "-y",
        "-z"
      ],
      "type": "string"
    },
    "bone": {
      "description": "A bone of the owner (an armature) to constrain instead of the object; the active bone in pose mode",
      "type": "string"
    },
    "bulge": {
      "description": "stretchTo and splineIk: how strongly the other axes thin as it stretches, 0 to 100 (1 keeps the volume)",
      "type": "number"
    },
    "chain": {
      "description": "ik: bones in the chain counting this one, 0 runs to the root; splineIk: bones fitted to the curve (1)",
      "type": "integer"
    },
    "chainOffset": {
      "description": "splineIk: keep the chain's root where it is",
      "type": "boolean"
    },
    "channel": {
      "description": "action: the target's channel that picks the frame",
      "enum": [
        "locationX",
        "locationY",
        "locationZ",
        "rotationX",
        "rotationY",
        "rotationZ",
        "scaleX",
        "scaleY",
        "scaleZ"
      ],
      "type": "string"
    },
    "curveRadius": {
      "description": "splineIk: the curve's radius scales the bones' thickness (true)",
      "type": "boolean"
    },
    "enabled": {
      "description": "On or off",
      "type": "boolean"
    },
    "evenDivisions": {
      "description": "splineIk: share the curve evenly between the bones",
      "type": "boolean"
    },
    "extrapolate": {
      "description": "transform: map values beyond the source range too",
      "type": "boolean"
    },
    "frameEnd": {
      "description": "action: the frame the channel's maximum plays",
      "type": "number"
    },
    "frameStart": {
      "description": "action: the frame the channel's minimum plays",
      "type": "number"
    },
    "fromMax": {
      "description": "transform: the source range's high end [x, y, z]",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "fromMin": {
      "description": "transform: the source range's low end (degrees for rotation) [x, y, z]",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "index": {
      "description": "The constraint's position in the stack, from 0",
      "type": "integer"
    },
    "influence": {
      "description": "How much of the result is used, 0 to 1 (1)",
      "type": "number"
    },
    "invert": {
      "description": "copyLocation and copyRotation: [x, y, z] axes inverted",
      "items": {
        "type": "boolean"
      },
      "type": "array"
    },
    "iterations": {
      "description": "ik: solver iterations (500)",
      "type": "integer"
    },
    "keepAxis": {
      "description": "stretchTo: how Y turns to the target",
      "enum": [
        "swingY",
        "planeX",
        "planeZ"
      ],
      "type": "string"
    },
    "limit": {
      "description": "limitRotation: [x, y, z] angles limited",
      "items": {
        "type": "boolean"
      },
      "type": "array"
    },
    "mapFrom": {
      "description": "transform: the target's channel read",
      "enum": [
        "location",
        "rotation",
        "scale"
      ],
      "type": "string"
    },
    "mapTo": {
      "description": "transform: the owner's channel set",
      "enum": [
        "location",
        "rotation",
        "scale"
      ],
      "type": "string"
    },
    "mapping": {
      "description": "transform: for the owner's x, y, z, the target axis each reads",
      "items": {
        "enum": [
          "x",
          "y",
          "z"
        ],
        "type": "string"
      },
      "type": "array"
    },
    "max": {
      "description": "limitRotation: highest angles, degrees [x, y, z]; action: the channel value that plays frameEnd",
      "oneOf": [
        {
          "items": {
            "type": "number"
          },
          "type": "array"
        },
        {
          "type": "number"
        }
      ]
    },
    "min": {
      "description": "limitRotation: lowest angles, degrees [x, y, z]; action: the channel value that plays frameStart (degrees for rotation)",
      "oneOf": [
        {
          "items": {
            "type": "number"
          },
          "type": "array"
        },
        {
          "type": "number"
        }
      ]
    },
    "mix": {
      "description": "transform: add or replace (location), add, replace, before, or after (rotation), replace or multiply (scale); action: how the action combines with the owner",
      "enum": [
        "add",
        "replace",
        "before",
        "after",
        "multiply",
        "beforeFull",
        "beforeSplit",
        "afterFull",
        "afterSplit"
      ],
      "type": "string"
    },
    "name": {
      "description": "The constraint's name (instead of index)",
      "type": "string"
    },
    "object": {
      "description": "The owner; the active object when left out",
      "oneOf": [
        {
          "description": "the object's id",
          "type": "integer"
        },
        {
          "description": "the object's name",
          "type": "string"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Object"
      ]
    },
    "offset": {
      "description": "copyLocation: true adds to the owner's location; floor: metres beyond the plane",
      "type": "number"
    },
    "ownerSpace": {
      "description": "copyLocation, copyRotation, transform: the space the owner is read in (pose and localWithParent on bones)",
      "enum": [
        "world",
        "local",
        "pose",
        "localWithParent"
      ],
      "type": "string"
    },
    "pick": {
      "description": "Instead of `object`/`objects`: a world point [x, y, z] in metres; the command acts on the object there now (the smallest whose mesh's bounds hold the point, else the nearest light, camera, empty, curve, text, lattice or armature whose origin is within 0.25 m). A place: with `basis`, a write by it is refused when what is at the point is no longer what was there (moved away, another moved in, its parent moved)",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "pole": {
      "description": "ik: the pole target object",
      "oneOf": [
        {
          "description": "the object's id",
          "type": "integer"
        },
        {
          "description": "the object's name",
          "type": "string"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Object"
      ]
    },
    "poleAngle": {
      "description": "ik: degrees the chain turns from the pole",
      "type": "number"
    },
    "poleBone": {
      "description": "ik: a bone of the pole target",
      "type": "string"
    },
    "preserveVolume": {
      "description": "armature: blend the bones as dual quaternions",
      "type": "boolean"
    },
    "rename": {
      "description": "A new name",
      "type": "string"
    },
    "restLength": {
      "description": "stretchTo: the distance, in the owner's Y units, at which it does not stretch; 0 takes the distance now",
      "type": "number"
    },
    "space": {
      "description": "limitRotation: the space the angles are read in (pose and localWithParent on bones)",
      "enum": [
        "world",
        "local",
        "pose",
        "localWithParent"
      ],
      "type": "string"
    },
    "target": {
      "description": "The target object",
      "oneOf": [
        {
          "description": "the object's id",
          "type": "integer"
        },
        {
          "description": "the object's name",
          "type": "string"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Object"
      ]
    },
    "targetBone": {
      "description": "A bone of the target (an armature) to use instead of the object",
      "type": "string"
    },
    "targetSpace": {
      "description": "copyLocation, copyRotation, transform, action: the space the target is read in",
      "enum": [
        "world",
        "local",
        "pose",
        "localWithParent"
      ],
      "type": "string"
    },
    "targets": {
      "description": "armature: the bones that move the owner, as { object, bone, weight }",
      "items": {
        "additionalProperties": true,
        "properties": {
          "bone": {
            "description": "The bone name",
            "type": "string"
          },
          "object": {
            "description": "The armature object by id or name",
            "oneOf": [
              {
                "description": "the object's id",
                "type": "integer"
              },
              {
                "description": "the object's name",
                "type": "string"
              }
            ],
            "x-khp-name": "name",
            "x-khp-role": "object",
            "x-khp-types": [
              "Object"
            ]
          },
          "weight": {
            "description": "The bone weight",
            "type": "number"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "toMax": {
      "description": "transform: the destination range's high end [x, y, z]",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "toMin": {
      "description": "transform: the destination range's low end (degrees for rotation) [x, y, z]",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "trackAxis": {
      "description": "trackTo and dampedTrack: the axis pointed at the target",
      "enum": [
        "x",
        "y",
        "z",
        "-x",
        "-y",
        "-z"
      ],
      "type": "string"
    },
    "upAxis": {
      "description": "trackTo: the axis kept up",
      "enum": [
        "x",
        "y",
        "z"
      ],
      "type": "string"
    },
    "useRotation": {
      "description": "floor: the plane turns with the target",
      "type": "boolean"
    },
    "volume": {
      "description": "stretchTo: the axes that thin",
      "enum": [
        "xzx",
        "x",
        "z",
        "none"
      ],
      "type": "string"
    },
    "xzScale": {
      "description": "splineIk: the bones' thickness",
      "enum": [
        "none",
        "boneOriginal",
        "inversePreserve",
        "volumePreserve"
      ],
      "type": "string"
    },
    "yScale": {
      "description": "splineIk: the bones' lengths",
      "enum": [
        "none",
        "fitCurve",
        "boneOriginal"
      ],
      "type": "string"
    }
  },
  "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.