Scene commands
Make, inspect, edit, evaluate and validate a scene as a file.
Everything here works on a file and needs no account. Read Commands for the command JSON scene apply takes.
puni sceneMake, inspect, edit, evaluate and validate a scene as a file.
| Command | What it does |
|---|---|
puni scene create | Write a new scene from a study, or an empty one with a name. |
puni scene inspect | List objects by name, by ID, or all of them, 64 at a time. |
puni scene module | Print one complete module: its adapter, properties, assets and code. |
puni scene apply | Apply a command, an array of commands or a nested batch, atomically. |
puni scene fit | Mount a fitting on a form: a button, knob, pad, screen, port, strap, hinge, screw, foot or seam. |
puni scene behavior | Give an object a behavior on its own clock, retune it, or take it off. |
puni scene update | Change the stage's light, exposure, shadows and background, or the scene's description. |
puni scene evaluate | Print every animated value at a time, for up to 64 objects. Numbers, not a picture. |
puni scene simulate | Run physics once and record each body's motion as an action the document keeps. |
puni scene validate | Check a document or portable file and every asset it references. |
puni scene export | Write a portable project with every asset embedded and checksummed. |
puni scene import | Validate a portable project and write it as an editable file that keeps its assets. |
#scene create
Write a new scene from a study, or an empty one with a name.
puni scene create --output scene.json [--study soft-guest | --name Scene]
| Flag | Type | Default | Values | What it does |
|---|---|---|---|---|
--output required | string | Where to write the scene. | ||
--study | string | soft-guest, relay, knot, glass-orchard | Start from this study. | |
--name | string | The name of an empty scene. | ||
--overwrite | boolean | false | Replace the output file if it already exists. | |
--json | boolean | false | Answer with one JSON envelope instead of the shell view. Exception: agent serve streams raw lifecycle JSON lines before its final envelope. | |
--help -h | boolean | Print the command list. |
#Run scene create
puni scene create --study soft-guest --output scene.json --json#scene inspect
List objects by name, by ID, or all of them, 64 at a time.
puni scene inspect --file scene.json [--query text] [--ids id,id] [--offset 0]
| Flag | Type | Default | Values | What it does |
|---|---|---|---|---|
--file required | string | The scene document or portable file to read. `-` reads it from standard input. | ||
--query | string | Match objects whose ID, name or module contains this text. | ||
--ids | string | A comma-separated list of object IDs. | ||
--offset | number | 0 | Skip this many matches. | |
--json | boolean | false | Answer with one JSON envelope instead of the shell view. Exception: agent serve streams raw lifecycle JSON lines before its final envelope. | |
--help -h | boolean | Print the command list. |
#Run scene inspect
puni scene inspect --file scene.json --query eye --json#scene module
Print one complete module: its adapter, properties, assets and code.
puni scene module <module-id> --file scene.json
| Flag | Type | Default | Values | What it does |
|---|---|---|---|---|
--file required | string | The scene document or portable file to read. `-` reads it from standard input. | ||
--json | boolean | false | Answer with one JSON envelope instead of the shell view. Exception: agent serve streams raw lifecycle JSON lines before its final envelope. | |
--help -h | boolean | Print the command list. |
#Run scene module
puni scene module soft-body --file scene.json --json#scene apply
Apply a command, an array of commands or a nested batch, atomically.
puni scene apply --file scene.json --commands edits.json --overwrite
| Flag | Type | Default | Values | What it does |
|---|---|---|---|---|
--file required | string | The scene document or portable file to read. `-` reads it from standard input. | ||
--commands required | string | The command JSON to apply. `-` reads it from standard input. | ||
--output | string | Write the result here instead of over the input. | ||
--overwrite | boolean | false | Replace the output file if it already exists. | |
--json | boolean | false | Answer with one JSON envelope instead of the shell view. Exception: agent serve streams raw lifecycle JSON lines before its final envelope. | |
--help -h | boolean | Print the command list. |
#Run scene apply
puni scene apply --file scene.json --commands edits.json --overwrite --json#scene fit
Mount a fitting on a form: a button, knob, pad, screen, port, strap, hinge, screw, foot or seam.
puni scene fit --file scene.json --target body --part button [--anchor 0,1,0] [--width 12 --height 4 --depth 12] --overwrite
| Flag | Type | Default | Values | What it does |
|---|---|---|---|---|
--file required | string | The scene document or portable file to read. `-` reads it from standard input. | ||
--target required | string | The object to mount on. | ||
--part | string | button | button, knob, pad, screen, port, strap, hinge, screw, foot, seam | The kind of fitting. Defaults to button. |
--anchor | string | 0,1,0 | Direction from the target's centre, in its own frame. | |
--width | number | Width in millimetres. | ||
--height | number | Height in millimetres. | ||
--depth | number | Depth in millimetres. | ||
--inset | number | How far the base sinks into the skin. | ||
--turn | number | Rotation about the surface normal, in degrees. | ||
--mark | string | Text printed on the fitting. | ||
--id | string | The new object's ID. | ||
--name | string | The new object's name. | ||
--output | string | Write the result here instead of over the input. | ||
--overwrite | boolean | false | Replace the output file if it already exists. | |
--json | boolean | false | Answer with one JSON envelope instead of the shell view. Exception: agent serve streams raw lifecycle JSON lines before its final envelope. | |
--help -h | boolean | Print the command list. |
#Run scene fit
puni scene fit --file scene.json --target body --part button --width 14 --height 5 --depth 14 --id play --overwrite --json#scene behavior
Give an object a behavior on its own clock, retune it, or take it off.
puni scene behavior --file scene.json --target body --kind idle [--feel 0.5] [--eyes eye-l,eye-r] [--remove] --overwrite
| Flag | Type | Default | Values | What it does |
|---|---|---|---|---|
--file required | string | The scene document or portable file to read. `-` reads it from standard input. | ||
--target required | string | The object that behaves. | ||
--kind required | string | idle, blink, tap, hop, appear, wobble | The behavior. | |
--feel | number | 0.5 | 0 is calm, 1 is springy. | |
--eyes | string | For blink: the objects that close, comma-separated. | ||
--remove | boolean | false | Take the behavior off instead of adding it. | |
--output | string | Write the result here instead of over the input. | ||
--overwrite | boolean | false | Replace the output file if it already exists. | |
--json | boolean | false | Answer with one JSON envelope instead of the shell view. Exception: agent serve streams raw lifecycle JSON lines before its final envelope. | |
--help -h | boolean | Print the command list. |
#Run scene behavior
puni scene behavior --file scene.json --target body --kind idle --feel 0.4 --overwrite --json#scene update
Change the stage's light, exposure, shadows and background, or the scene's description.
puni scene update --file scene.json [--patch environment.json] [--brief text] --overwrite
| Flag | Type | Default | Values | What it does |
|---|---|---|---|---|
--file required | string | The scene document or portable file to read. `-` reads it from standard input. | ||
--patch | string | JSON with any of lighting, exposure, shadows, background, transparent. `-` reads standard input. | ||
--brief | string | The scene's description, up to 300 characters. | ||
--output | string | Write the result here instead of over the input. | ||
--overwrite | boolean | false | Replace the output file if it already exists. | |
--json | boolean | false | Answer with one JSON envelope instead of the shell view. Exception: agent serve streams raw lifecycle JSON lines before its final envelope. | |
--help -h | boolean | Print the command list. |
#Run scene update
puni scene update --file scene.json --brief 'A quiet, gently moving character.' --overwrite --json#scene evaluate
Print every animated value at a time, for up to 64 objects. Numbers, not a picture.
puni scene evaluate --file scene.json --time 2
| Flag | Type | Default | Values | What it does |
|---|---|---|---|---|
--file required | string | The scene document or portable file to read. `-` reads it from standard input. | ||
--time | number | 0 | Scene time in seconds, from 0 to the scene duration. | |
--ids | string | Limit the answer to these objects, comma-separated. | ||
--json | boolean | false | Answer with one JSON envelope instead of the shell view. Exception: agent serve streams raw lifecycle JSON lines before its final envelope. | |
--help -h | boolean | Print the command list. |
#Run scene evaluate
puni scene evaluate --file scene.json --time 2 --json#scene simulate
Run physics once and record each body's motion as an action the document keeps.
puni scene simulate --file scene.json (--ids id,id [--settings physics.json] | --recipe recipe.json) --output motion.json
| Flag | Type | Default | Values | What it does |
|---|---|---|---|---|
--file required | string | The scene document or portable file to read. `-` reads it from standard input. | ||
--ids | string | 1–32 top-level objects to simulate, comma-separated. Required unless --recipe is supplied; do not combine with --recipe. | ||
--output required | string | Where to write the recorded motion. | ||
--settings | string | Simulation settings: duration, height, restitution, spin, mass and collider only. Use with --ids, never --recipe. `-` reads standard input. | ||
--recipe | string | A complete physics recipe file with gravity, ground, bodies and impulses. Replaces --ids and --settings; do not combine them. | ||
--recipe-output | string | Write the simulation recipe to this JSON file. | ||
--overwrite | boolean | false | Replace the output file if it already exists. | |
--json | boolean | false | Answer with one JSON envelope instead of the shell view. Exception: agent serve streams raw lifecycle JSON lines before its final envelope. | |
--help -h | boolean | Print the command list. |
#Run scene simulate
puni scene simulate --file scene.json --ids ball --output motion.json --settings physics.json --json#scene validate
Check a document or portable file and every asset it references.
puni scene validate --file scene.json [--asset-root ./assets]
| Flag | Type | Default | Values | What it does |
|---|---|---|---|---|
--file required | string | The scene document or portable file to read. `-` reads it from standard input. | ||
--asset-root | string | A directory mirroring the scene's asset URIs, for a bare document whose assets live on disk. | ||
--json | boolean | false | Answer with one JSON envelope instead of the shell view. Exception: agent serve streams raw lifecycle JSON lines before its final envelope. | |
--help -h | boolean | Print the command list. |
#Run scene validate
puni scene validate --file scene.json --json#scene export
Write a portable project with every asset embedded and checksummed.
puni scene export --file scene.json --output bundle.json [--asset-root ./assets]
| Flag | Type | Default | Values | What it does |
|---|---|---|---|---|
--file required | string | The scene document or portable file to read. `-` reads it from standard input. | ||
--output required | string | Where to write the portable file. | ||
--asset-root | string | A directory mirroring the scene's asset URIs, for a bare document whose assets live on disk. | ||
--overwrite | boolean | false | Replace the output file if it already exists. | |
--json | boolean | false | Answer with one JSON envelope instead of the shell view. Exception: agent serve streams raw lifecycle JSON lines before its final envelope. | |
--help -h | boolean | Print the command list. |
#Run scene export
puni scene export --file scene.json --output scene.puni.json --json#scene import
Validate a portable project and write it as an editable file that keeps its assets.
puni scene import --file bundle.json --output scene.json
| Flag | Type | Default | Values | What it does |
|---|---|---|---|---|
--file required | string | The portable file to read. | ||
--output required | string | Where to write the editable scene. | ||
--overwrite | boolean | false | Replace the output file if it already exists. | |
--json | boolean | false | Answer with one JSON envelope instead of the shell view. Exception: agent serve streams raw lifecycle JSON lines before its final envelope. | |
--help -h | boolean | Print the command list. |
#Run scene import
puni scene import --file scene.puni.json --output imported.json --jsonBack to the command line index for every group.
Was this useful?