Scene kit command
object.hop
Hop
Keys `objects` hopping on a ballistic arc from where they are at `start` to `to` (a point for their centre, or an object to land on top of) over `duration` frames, rising `height` above the higher end, with optional `spin` degrees, landing with a squash that rings out (`impact` {squash, frames}), as one undo step. Answers the landing frame.
- Kit
- Scene 0.1.0 (.kscene)
- Changes the document
- yes
- Acts on
objects(a list of ids), which a run step’sonfills
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
duration | number | no | Frames in the air, 1 to 10000 (18) |
height | number | no | Metres the arc rises above the higher of its two ends, 0 to 10000 (0.6) |
impact | boolean | object | no | The squash and stretch as they land ({squash: 0.12, frames: 8}) |
objects | integer | string | (integer | string)[] | no | The objects; the selection when left out. They hop together, keeping their places relative to one another |
pick | number[] | no | 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) |
spin | number[] | no | Degrees they turn about X, Y and Z in the air [x, y, z] |
start | number | no | The frame they take off (the current frame) |
to | integer | string | number[] | yes | Where they land: a point their centre lands on, or an object they land on top of |
Call through scene_run
scene_run {
"path": "<file>.kscene",
"steps": [{ "command": "object.hop", "params": { "to": <integer | string | number[]> } }]
}The required parameters, with placeholders for their types: not a tested example. Optional: duration, height, impact, objects, pick, spin, start. scene_run answers the step’s result in completed[i].result.
Result
The kit gives no result schema for this command.
Parameter schema
{
"additionalProperties": false,
"properties": {
"duration": {
"description": "Frames in the air, 1 to 10000 (18)",
"type": "number"
},
"height": {
"description": "Metres the arc rises above the higher of its two ends, 0 to 10000 (0.6)",
"type": "number"
},
"impact": {
"description": "The squash and stretch as they land ({squash: 0.12, frames: 8})",
"oneOf": [
{
"description": "false: land without squashing",
"type": "boolean"
},
{
"additionalProperties": false,
"properties": {
"frames": {
"description": "frames the squash rings out over, 1 to 1000 (8)",
"type": "number"
},
"squash": {
"description": "share of their height they squash by on landing, 0 to 0.9 (0.12)",
"type": "number"
}
},
"type": "object"
}
]
},
"objects": {
"description": "The objects; the selection when left out. They hop together, keeping their places relative to one another",
"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"
},
"spin": {
"description": "Degrees they turn about X, Y and Z in the air [x, y, z]",
"items": {
"type": "number"
},
"type": "array"
},
"start": {
"description": "The frame they take off (the current frame)",
"type": "number"
},
"to": {
"description": "Where they land: a point their centre lands on, or an object they land on top of",
"oneOf": [
{
"description": "an object's id (its bounding box's centre)",
"type": "integer"
},
{
"description": "an object's name (its bounding box's centre)",
"type": "string"
},
{
"description": "a point [x, y, z] in metres",
"items": {
"type": "number"
},
"type": "array"
}
],
"x-khp-name": "name",
"x-khp-types": [
"Object"
]
}
},
"required": [
"to"
],
"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.