Scene kit command

physics.softBody.add

Add Soft Body

Adds a soft body to `objects` (names or ids; the selection without it) with its goal, edge springs, mass, friction and per-system `effectorWeights`. All multiplies each field weight; nonpositive products disable fields. Gravity is independent.

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.softBody.add
NameTypeRequiredDescription
ballSizenumbernoSelf collision: each vertex's ball as a share of its edges' mean length (0.49)
bendingnumbernoSprings between vertices two edges apart, 0 to 10 (0: none)
dampingnumbernoEdge damping (0.5)
edgesbooleannoSprings along the mesh's edges (on)
effectorWeightsobjectnoPartial cloth or soft-body influence weights; All multiplies field weights, Gravity is independent
frameEndintegernoThe last simulated frame (250); after it the body holds
frameStartintegernoThe first simulated frame (1); before it the mesh is at rest
frictionnumbernoAir friction (0.5)
goalbooleannoVertices are drawn to where the mesh puts them (on)
goalDampingnumbernoGoal spring damping (0)
goalDefaultnumbernoThe goal weight, 0 to 1; 1 follows the mesh exactly (0.7)
goalGroupstringnoThe vertex group whose weights scale the goal (empty: every vertex alike)
goalMaxnumbernoThe goal weight at group weight 1, 0 to 1 (1)
goalMinnumbernoThe goal weight at group weight 0, 0 to 1 (0)
goalStiffnessnumbernoGoal spring stiffness, 0 to 0.999 (0.5)
massnumbernoMass of each vertex in kg (1)
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)
pullnumbernoEdge stiffness when stretched, 0 to 0.999 (0.5)
pushnumbernoEdge stiffness when squeezed, 0 to 0.999 (0.5)
selfCollisionbooleannoVertices keep apart from each other (off)
speednumbernoHow fast simulated time runs (1)

Call through scene_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: ballSize, bending, damping, edges, effectorWeights, frameEnd, frameStart, friction, goal, goalDamping, goalDefault, goalGroup, goalMax, goalMin, goalStiffness, mass, objects, pick, pull, push, selfCollision, speed. 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": {
    "ballSize": {
      "description": "Self collision: each vertex's ball as a share of its edges' mean length (0.49)",
      "type": "number"
    },
    "bending": {
      "description": "Springs between vertices two edges apart, 0 to 10 (0: none)",
      "type": "number"
    },
    "damping": {
      "description": "Edge damping (0.5)",
      "type": "number"
    },
    "edges": {
      "description": "Springs along the mesh's edges (on)",
      "type": "boolean"
    },
    "effectorWeights": {
      "additionalProperties": false,
      "description": "Partial cloth or soft-body influence weights; All multiplies field weights, Gravity is independent",
      "properties": {
        "all": {
          "description": "All field weights multiplier, -200 to 200 (1); does not affect gravity",
          "type": "number"
        },
        "drag": {
          "description": "Drag weight, -200 to 200 (1)",
          "type": "number"
        },
        "force": {
          "description": "Force weight, -200 to 200 (1)",
          "type": "number"
        },
        "gravity": {
          "description": "Signed gravity multiplier, -200 to 200 (1), independent of All",
          "type": "number"
        },
        "turbulence": {
          "description": "Turbulence weight, -200 to 200 (1)",
          "type": "number"
        },
        "vortex": {
          "description": "Vortex weight, -200 to 200 (1)",
          "type": "number"
        },
        "wind": {
          "description": "Wind weight, -200 to 200 (1)",
          "type": "number"
        }
      },
      "type": "object"
    },
    "frameEnd": {
      "description": "The last simulated frame (250); after it the body holds",
      "type": "integer"
    },
    "frameStart": {
      "description": "The first simulated frame (1); before it the mesh is at rest",
      "type": "integer"
    },
    "friction": {
      "description": "Air friction (0.5)",
      "type": "number"
    },
    "goal": {
      "description": "Vertices are drawn to where the mesh puts them (on)",
      "type": "boolean"
    },
    "goalDamping": {
      "description": "Goal spring damping (0)",
      "type": "number"
    },
    "goalDefault": {
      "description": "The goal weight, 0 to 1; 1 follows the mesh exactly (0.7)",
      "type": "number"
    },
    "goalGroup": {
      "description": "The vertex group whose weights scale the goal (empty: every vertex alike)",
      "type": "string"
    },
    "goalMax": {
      "description": "The goal weight at group weight 1, 0 to 1 (1)",
      "type": "number"
    },
    "goalMin": {
      "description": "The goal weight at group weight 0, 0 to 1 (0)",
      "type": "number"
    },
    "goalStiffness": {
      "description": "Goal spring stiffness, 0 to 0.999 (0.5)",
      "type": "number"
    },
    "mass": {
      "description": "Mass of each vertex in kg (1)",
      "type": "number"
    },
    "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"
    },
    "pull": {
      "description": "Edge stiffness when stretched, 0 to 0.999 (0.5)",
      "type": "number"
    },
    "push": {
      "description": "Edge stiffness when squeezed, 0 to 0.999 (0.5)",
      "type": "number"
    },
    "selfCollision": {
      "description": "Vertices keep apart from each other (off)",
      "type": "boolean"
    },
    "speed": {
      "description": "How fast simulated time runs (1)",
      "type": "number"
    }
  },
  "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.