Scene kit command

particle.set

Particle Settings

Changes particle system `system`'s settings, including airborne boids with averaged Goal, Avoid, Separate and Flock rules. Targets use their current world-space positions; animated target history, collisions and force fields are unsupported.

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 particle.set
NameTypeRequiredDescription
boidsobjectnoAirborne boids. Enabled rules are averaged, not evaluated by priority. Up to 2048 particles, 1000 emission-plus-lifetime frames and 500000 particle-frames and 500000 birth/death-aware particle updates. Faces or vertices only; scene force fields and collisions are inert. Targets use current world-space positions.
bouncenumbernoThe share of speed kept on a bounce, 0 to 1 (0.5)
childCountintegernoHair: children per parent strand (10)
childRadiusnumbernoHair: how far simple children spread round their parent, metres (0.2)
children"none" | "simple" | "interpolated"noHair: child strands
collidersinteger | string | (integer | string)[]noObjects particles bounce off (ids or names; an empty list for none)
countintegernoParticles or parent strands (1000, at most 100000)
densityGroupstringnoThe vertex group whose weights set how densely particles and strands start (empty: everywhere alike)
dieOnCollisionbooleannoParticles die where they hit a collider
distribution"jittered" | "random"noHow start points spread
dragnumbernoAir drag: the share of speed lost per second
dynamicsboolean | objectnoHair: dynamics simulated in the physics bake (true: on with the defaults, false: off; an object: its settings, turning it on)
emitFrom"faces" | "verts" | "volume"noWhere particles start
frameEndnumbernoEmitter: the last frame particles are born (200)
frameStartnumbernoEmitter: the first frame particles are born (1)
gravitynumbernoHow strongly the scene's gravity pulls (1)
hairLengthnumbernoHair: strand length, metres (4)
instanceObjectinteger | stringnoWith renderAs object: the object copied at each particle (null for none)
kind"emitter" | "hair"noEmitter (particles that fly) or hair (strands)
lifetimenumbernoEmitter: frames a particle lives (50)
lifetimeRandomnumbernoEmitter: how much of the lifetime may randomly be cut, 0 to 1
namestringnoA new name for the system
normalVelocitynumbernoStart speed along the surface normal, m/s (1)
objectinteger | stringnoThe mesh; the active one when left out
objectVelocitynumber[]noStart velocity along the emitter's axes, m/s [x, y, z]
physics"newtonian" | "boids"noEmitter physics: Newtonian or airborne boids with averaged rules
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)
randomVelocitynumbernoStart speed in a random direction, m/s
renderAs"halo" | "object" | "none"noHow particles show
rotationRandomnumbernoHow far instances turn at random, 0 to 1
seedintegernoDifferent seeds give different, each repeatable, particles (0)
segmentsintegernoHair: segments per strand (5)
sizenumbernoParticle size (halo diameter, instance scale), metres (0.05)
sizeRandomnumbernoHow much of the size may randomly be taken off, 0 to 1
strandWidthnumbernoHair: strand width at the root, metres (0.01)
systeminteger | stringnoThe system's index or name; the first when left out
timestepnumbernoSeconds simulated per frame (0.04)

Call through scene_run

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

The required parameters, with placeholders for their types: not a tested example. Optional: boids, bounce, childCount, childRadius, children, colliders, count, densityGroup, dieOnCollision, distribution, drag, dynamics, emitFrom, frameEnd, frameStart, gravity, hairLength, instanceObject, kind, lifetime, lifetimeRandom, name, normalVelocity, object, objectVelocity, physics, pick, randomVelocity, renderAs, rotationRandom, seed, segments, size, sizeRandom, strandWidth, system, timestep. 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": {
    "boids": {
      "additionalProperties": false,
      "description": "Airborne boids. Enabled rules are averaged, not evaluated by priority. Up to 2048 particles, 1000 emission-plus-lifetime frames and 500000 particle-frames and 500000 birth/death-aware particle updates. Faces or vertices only; scene force fields and collisions are inert. Targets use current world-space positions.",
      "properties": {
        "airAccMax": {
          "description": "Maximum acceleration as a fraction of maximum speed, 0 to 1 (0.5)",
          "type": "number"
        },
        "airAngularMax": {
          "description": "Maximum steering angle as a fraction of 180 degrees, 0 to 1 (0.5)",
          "type": "number"
        },
        "airPersonalSpace": {
          "description": "Personal space as a multiple of particle size, 0 to 10 (1)",
          "type": "number"
        },
        "airSpeedMax": {
          "description": "Maximum air speed, 0 to 100 m/s (10)",
          "type": "number"
        },
        "rules": {
          "description": "Up to eight applicable rules averaged; default Separate and Flock. Replaces the complete list.",
          "items": {
            "additionalProperties": false,
            "properties": {
              "kind": {
                "description": "Airborne rule",
                "enum": [
                  "goal",
                  "avoid",
                  "separate",
                  "flock"
                ],
                "type": "string"
              },
              "target": {
                "description": "Goal or Avoid target object, null for none",
                "oneOf": [
                  {
                    "description": "Target object's id",
                    "type": "integer"
                  },
                  {
                    "description": "Target object's name",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "x-khp-name": "name",
                "x-khp-role": "object",
                "x-khp-types": [
                  "Object"
                ]
              }
            },
            "required": [
              "kind"
            ],
            "type": "object"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "bounce": {
      "description": "The share of speed kept on a bounce, 0 to 1 (0.5)",
      "type": "number"
    },
    "childCount": {
      "description": "Hair: children per parent strand (10)",
      "type": "integer"
    },
    "childRadius": {
      "description": "Hair: how far simple children spread round their parent, metres (0.2)",
      "type": "number"
    },
    "children": {
      "description": "Hair: child strands",
      "enum": [
        "none",
        "simple",
        "interpolated"
      ],
      "type": "string"
    },
    "colliders": {
      "description": "Objects particles bounce off (ids or names; an empty list for none)",
      "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"
      ]
    },
    "count": {
      "description": "Particles or parent strands (1000, at most 100000)",
      "type": "integer"
    },
    "densityGroup": {
      "description": "The vertex group whose weights set how densely particles and strands start (empty: everywhere alike)",
      "type": "string"
    },
    "dieOnCollision": {
      "description": "Particles die where they hit a collider",
      "type": "boolean"
    },
    "distribution": {
      "description": "How start points spread",
      "enum": [
        "jittered",
        "random"
      ],
      "type": "string"
    },
    "drag": {
      "description": "Air drag: the share of speed lost per second",
      "type": "number"
    },
    "dynamics": {
      "description": "Hair: dynamics simulated in the physics bake (true: on with the defaults, false: off; an object: its settings, turning it on)",
      "oneOf": [
        {
          "type": "boolean"
        },
        {
          "additionalProperties": false,
          "properties": {
            "airDamping": {
              "description": "Air damping, 0 to 10 (1)",
              "type": "number"
            },
            "collision": {
              "description": "Strands collide with collision objects (on)",
              "type": "boolean"
            },
            "collisionDistance": {
              "description": "How close strands come to collision objects, metres (0.015)",
              "type": "number"
            },
            "damping": {
              "description": "How fast their bending settles (0.5)",
              "type": "number"
            },
            "mass": {
              "description": "Mass of each point in kg (0.3)",
              "type": "number"
            },
            "pinStiffness": {
              "description": "How strongly points are drawn to their rest place (0)",
              "type": "number"
            },
            "quality": {
              "description": "Steps per frame, 1 to 80 (5)",
              "type": "integer"
            },
            "stiffness": {
              "description": "How firmly strands bend back to their rest shape (0.5)",
              "type": "number"
            }
          },
          "type": "object"
        }
      ]
    },
    "emitFrom": {
      "description": "Where particles start",
      "enum": [
        "faces",
        "verts",
        "volume"
      ],
      "type": "string"
    },
    "frameEnd": {
      "description": "Emitter: the last frame particles are born (200)",
      "type": "number"
    },
    "frameStart": {
      "description": "Emitter: the first frame particles are born (1)",
      "type": "number"
    },
    "gravity": {
      "description": "How strongly the scene's gravity pulls (1)",
      "type": "number"
    },
    "hairLength": {
      "description": "Hair: strand length, metres (4)",
      "type": "number"
    },
    "instanceObject": {
      "description": "With renderAs object: the object copied at each particle (null for none)",
      "oneOf": [
        {
          "description": "the object's id",
          "type": "integer"
        },
        {
          "description": "the object's name",
          "type": "string"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Object"
      ]
    },
    "kind": {
      "description": "Emitter (particles that fly) or hair (strands)",
      "enum": [
        "emitter",
        "hair"
      ],
      "type": "string"
    },
    "lifetime": {
      "description": "Emitter: frames a particle lives (50)",
      "type": "number"
    },
    "lifetimeRandom": {
      "description": "Emitter: how much of the lifetime may randomly be cut, 0 to 1",
      "type": "number"
    },
    "name": {
      "description": "A new name for the system",
      "type": "string"
    },
    "normalVelocity": {
      "description": "Start speed along the surface normal, m/s (1)",
      "type": "number"
    },
    "object": {
      "description": "The mesh; the active one 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"
      ]
    },
    "objectVelocity": {
      "description": "Start velocity along the emitter's axes, m/s [x, y, z]",
      "items": {
        "type": "number"
      },
      "type": "array"
    },
    "physics": {
      "description": "Emitter physics: Newtonian or airborne boids with averaged rules",
      "enum": [
        "newtonian",
        "boids"
      ],
      "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"
    },
    "randomVelocity": {
      "description": "Start speed in a random direction, m/s",
      "type": "number"
    },
    "renderAs": {
      "description": "How particles show",
      "enum": [
        "halo",
        "object",
        "none"
      ],
      "type": "string"
    },
    "rotationRandom": {
      "description": "How far instances turn at random, 0 to 1",
      "type": "number"
    },
    "seed": {
      "description": "Different seeds give different, each repeatable, particles (0)",
      "type": "integer"
    },
    "segments": {
      "description": "Hair: segments per strand (5)",
      "type": "integer"
    },
    "size": {
      "description": "Particle size (halo diameter, instance scale), metres (0.05)",
      "type": "number"
    },
    "sizeRandom": {
      "description": "How much of the size may randomly be taken off, 0 to 1",
      "type": "number"
    },
    "strandWidth": {
      "description": "Hair: strand width at the root, metres (0.01)",
      "type": "number"
    },
    "system": {
      "description": "The system's index or name; the first when left out",
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "string"
        }
      ]
    },
    "timestep": {
      "description": "Seconds simulated per frame (0.04)",
      "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.