Scene kit command

physics.constraint.set

Rigid Body Constraint Settings

Changes a rigid body constraint's settings.

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

Parameters

Parameters of physics.constraint.set
NameTypeRequiredDescription
angleLimitany[]noHinge: [lower, upper] in degrees about Z, or null for none
angularLimitsany[]noGeneric spring: per axis X, Y, Z a [lower, upper] in degrees, or null for free
angularMaxImpulsenumbernoMotor: maximum angular impulse control, 0 to 1000000000 (default 1); step impulse is value times seconds
angularMotorbooleannoMotor: enable rotation about the constraint's X axis (default false)
angularSpringsany[]noGeneric spring: per axis X, Y, Z a stiffness in N·m/rad, or null for none
angularTargetVelocitynumbernoMotor: body 1 relative to body 2 in rad/s, -100000 to 100000 (default 1)
breakablebooleannoThe constraint breaks when it must push harder than the threshold
breakingThresholdnumbernoThe impulse (N·s) in one step that breaks it
disableCollisionsbooleannoThe joined bodies pass through each other (default true)
distanceLimitany[]noSlider: [lower, upper] in metres along X, or null for none
enabledbooleannoThe constraint acts
linearLimitsany[]noGeneric spring: per axis X, Y, Z a [lower, upper] in metres, or null for free
linearMaxImpulsenumbernoMotor: maximum linear impulse control, 0 to 1000000000 (default 1); step impulse is value times seconds
linearMotorbooleannoMotor: enable translation along the constraint's X axis (default false)
linearSpringsany[]noGeneric spring: per axis X, Y, Z a stiffness in N/m, or null for none
linearTargetVelocitynumbernoMotor: body 1 relative to body 2 in m/s, -100000 to 100000 (default 1)
object1integer | stringnoThe first rigid body joined
object2integer | stringnoThe second rigid body joined
objectsinteger | string | (integer | string)[]noThe objects; the selection when left out
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)
springDampingnumbernoGeneric spring: the springs' damping
type"fixed" | "point" | "hinge" | "slider" | "genericSpring" | "motor"nofixed: one piece; point: a ball joint; hinge: turns about Z; slider: slides along X; genericSpring: per axis limits and springs; motor: drives along/about X

Call through scene_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: angleLimit, angularLimits, angularMaxImpulse, angularMotor, angularSprings, angularTargetVelocity, breakable, breakingThreshold, disableCollisions, distanceLimit, enabled, linearLimits, linearMaxImpulse, linearMotor, linearSprings, linearTargetVelocity, object1, object2, objects, pick, springDamping, type. 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": {
    "angleLimit": {
      "description": "Hinge: [lower, upper] in degrees about Z, or null for none",
      "type": "array"
    },
    "angularLimits": {
      "description": "Generic spring: per axis X, Y, Z a [lower, upper] in degrees, or null for free",
      "type": "array"
    },
    "angularMaxImpulse": {
      "description": "Motor: maximum angular impulse control, 0 to 1000000000 (default 1); step impulse is value times seconds",
      "type": "number"
    },
    "angularMotor": {
      "description": "Motor: enable rotation about the constraint's X axis (default false)",
      "type": "boolean"
    },
    "angularSprings": {
      "description": "Generic spring: per axis X, Y, Z a stiffness in N·m/rad, or null for none",
      "type": "array"
    },
    "angularTargetVelocity": {
      "description": "Motor: body 1 relative to body 2 in rad/s, -100000 to 100000 (default 1)",
      "type": "number"
    },
    "breakable": {
      "description": "The constraint breaks when it must push harder than the threshold",
      "type": "boolean"
    },
    "breakingThreshold": {
      "description": "The impulse (N·s) in one step that breaks it",
      "type": "number"
    },
    "disableCollisions": {
      "description": "The joined bodies pass through each other (default true)",
      "type": "boolean"
    },
    "distanceLimit": {
      "description": "Slider: [lower, upper] in metres along X, or null for none",
      "type": "array"
    },
    "enabled": {
      "description": "The constraint acts",
      "type": "boolean"
    },
    "linearLimits": {
      "description": "Generic spring: per axis X, Y, Z a [lower, upper] in metres, or null for free",
      "type": "array"
    },
    "linearMaxImpulse": {
      "description": "Motor: maximum linear impulse control, 0 to 1000000000 (default 1); step impulse is value times seconds",
      "type": "number"
    },
    "linearMotor": {
      "description": "Motor: enable translation along the constraint's X axis (default false)",
      "type": "boolean"
    },
    "linearSprings": {
      "description": "Generic spring: per axis X, Y, Z a stiffness in N/m, or null for none",
      "type": "array"
    },
    "linearTargetVelocity": {
      "description": "Motor: body 1 relative to body 2 in m/s, -100000 to 100000 (default 1)",
      "type": "number"
    },
    "object1": {
      "description": "The first rigid body joined",
      "oneOf": [
        {
          "description": "the object's id",
          "type": "integer"
        },
        {
          "description": "the object's name",
          "type": "string"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Object"
      ]
    },
    "object2": {
      "description": "The second rigid body joined",
      "oneOf": [
        {
          "description": "the object's id",
          "type": "integer"
        },
        {
          "description": "the object's name",
          "type": "string"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Object"
      ]
    },
    "objects": {
      "description": "The objects; the selection when left out",
      "oneOf": [
        {
          "description": "an object's id",
          "type": "integer"
        },
        {
          "description": "an object's name",
          "type": "string"
        },
        {
          "description": "ids or names",
          "items": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "type": "array"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Object"
      ]
    },
    "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"
    },
    "springDamping": {
      "description": "Generic spring: the springs' damping",
      "type": "number"
    },
    "type": {
      "description": "fixed: one piece; point: a ball joint; hinge: turns about Z; slider: slides along X; genericSpring: per axis limits and springs; motor: drives along/about X",
      "enum": [
        "fixed",
        "point",
        "hinge",
        "slider",
        "genericSpring",
        "motor"
      ],
      "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.