Skip to content
PuniDocs
Open Puni

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.

CommandWhat it does
puni scene createWrite a new scene from a study, or an empty one with a name.
puni scene inspectList objects by name, by ID, or all of them, 64 at a time.
puni scene modulePrint one complete module: its adapter, properties, assets and code.
puni scene applyApply a command, an array of commands or a nested batch, atomically.
puni scene fitMount a fitting on a form: a button, knob, pad, screen, port, strap, hinge, screw, foot or seam.
puni scene behaviorGive an object a behavior on its own clock, retune it, or take it off.
puni scene updateChange the stage's light, exposure, shadows and background, or the scene's description.
puni scene evaluatePrint every animated value at a time, for up to 64 objects. Numbers, not a picture.
puni scene simulateRun physics once and record each body's motion as an action the document keeps.
puni scene validateCheck a document or portable file and every asset it references.
puni scene exportWrite a portable project with every asset embedded and checksummed.
puni scene importValidate 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]

FlagTypeDefaultValuesWhat it does
--output requiredstringWhere to write the scene.
--studystringsoft-guest, relay, knot, glass-orchardStart from this study.
--namestringThe name of an empty scene.
--overwritebooleanfalseReplace the output file if it already exists.
--jsonbooleanfalseAnswer with one JSON envelope instead of the shell view. Exception: agent serve streams raw lifecycle JSON lines before its final envelope.
--help -hbooleanPrint the command list.

#Run scene create

bash
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]

FlagTypeDefaultValuesWhat it does
--file requiredstringThe scene document or portable file to read. `-` reads it from standard input.
--querystringMatch objects whose ID, name or module contains this text.
--idsstringA comma-separated list of object IDs.
--offsetnumber0Skip this many matches.
--jsonbooleanfalseAnswer with one JSON envelope instead of the shell view. Exception: agent serve streams raw lifecycle JSON lines before its final envelope.
--help -hbooleanPrint the command list.

#Run scene inspect

bash
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

FlagTypeDefaultValuesWhat it does
--file requiredstringThe scene document or portable file to read. `-` reads it from standard input.
--jsonbooleanfalseAnswer with one JSON envelope instead of the shell view. Exception: agent serve streams raw lifecycle JSON lines before its final envelope.
--help -hbooleanPrint the command list.

#Run scene module

bash
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

FlagTypeDefaultValuesWhat it does
--file requiredstringThe scene document or portable file to read. `-` reads it from standard input.
--commands requiredstringThe command JSON to apply. `-` reads it from standard input.
--outputstringWrite the result here instead of over the input.
--overwritebooleanfalseReplace the output file if it already exists.
--jsonbooleanfalseAnswer with one JSON envelope instead of the shell view. Exception: agent serve streams raw lifecycle JSON lines before its final envelope.
--help -hbooleanPrint the command list.

#Run scene apply

bash
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

FlagTypeDefaultValuesWhat it does
--file requiredstringThe scene document or portable file to read. `-` reads it from standard input.
--target requiredstringThe object to mount on.
--partstringbuttonbutton, knob, pad, screen, port, strap, hinge, screw, foot, seamThe kind of fitting. Defaults to button.
--anchorstring0,1,0Direction from the target's centre, in its own frame.
--widthnumberWidth in millimetres.
--heightnumberHeight in millimetres.
--depthnumberDepth in millimetres.
--insetnumberHow far the base sinks into the skin.
--turnnumberRotation about the surface normal, in degrees.
--markstringText printed on the fitting.
--idstringThe new object's ID.
--namestringThe new object's name.
--outputstringWrite the result here instead of over the input.
--overwritebooleanfalseReplace the output file if it already exists.
--jsonbooleanfalseAnswer with one JSON envelope instead of the shell view. Exception: agent serve streams raw lifecycle JSON lines before its final envelope.
--help -hbooleanPrint the command list.

#Run scene fit

bash
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

FlagTypeDefaultValuesWhat it does
--file requiredstringThe scene document or portable file to read. `-` reads it from standard input.
--target requiredstringThe object that behaves.
--kind requiredstringidle, blink, tap, hop, appear, wobbleThe behavior.
--feelnumber0.50 is calm, 1 is springy.
--eyesstringFor blink: the objects that close, comma-separated.
--removebooleanfalseTake the behavior off instead of adding it.
--outputstringWrite the result here instead of over the input.
--overwritebooleanfalseReplace the output file if it already exists.
--jsonbooleanfalseAnswer with one JSON envelope instead of the shell view. Exception: agent serve streams raw lifecycle JSON lines before its final envelope.
--help -hbooleanPrint the command list.

#Run scene behavior

bash
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

FlagTypeDefaultValuesWhat it does
--file requiredstringThe scene document or portable file to read. `-` reads it from standard input.
--patchstringJSON with any of lighting, exposure, shadows, background, transparent. `-` reads standard input.
--briefstringThe scene's description, up to 300 characters.
--outputstringWrite the result here instead of over the input.
--overwritebooleanfalseReplace the output file if it already exists.
--jsonbooleanfalseAnswer with one JSON envelope instead of the shell view. Exception: agent serve streams raw lifecycle JSON lines before its final envelope.
--help -hbooleanPrint the command list.

#Run scene update

bash
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

FlagTypeDefaultValuesWhat it does
--file requiredstringThe scene document or portable file to read. `-` reads it from standard input.
--timenumber0Scene time in seconds, from 0 to the scene duration.
--idsstringLimit the answer to these objects, comma-separated.
--jsonbooleanfalseAnswer with one JSON envelope instead of the shell view. Exception: agent serve streams raw lifecycle JSON lines before its final envelope.
--help -hbooleanPrint the command list.

#Run scene evaluate

bash
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

FlagTypeDefaultValuesWhat it does
--file requiredstringThe scene document or portable file to read. `-` reads it from standard input.
--idsstring1–32 top-level objects to simulate, comma-separated. Required unless --recipe is supplied; do not combine with --recipe.
--output requiredstringWhere to write the recorded motion.
--settingsstringSimulation settings: duration, height, restitution, spin, mass and collider only. Use with --ids, never --recipe. `-` reads standard input.
--recipestringA complete physics recipe file with gravity, ground, bodies and impulses. Replaces --ids and --settings; do not combine them.
--recipe-outputstringWrite the simulation recipe to this JSON file.
--overwritebooleanfalseReplace the output file if it already exists.
--jsonbooleanfalseAnswer with one JSON envelope instead of the shell view. Exception: agent serve streams raw lifecycle JSON lines before its final envelope.
--help -hbooleanPrint the command list.

#Run scene simulate

bash
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]

FlagTypeDefaultValuesWhat it does
--file requiredstringThe scene document or portable file to read. `-` reads it from standard input.
--asset-rootstringA directory mirroring the scene's asset URIs, for a bare document whose assets live on disk.
--jsonbooleanfalseAnswer with one JSON envelope instead of the shell view. Exception: agent serve streams raw lifecycle JSON lines before its final envelope.
--help -hbooleanPrint the command list.

#Run scene validate

bash
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]

FlagTypeDefaultValuesWhat it does
--file requiredstringThe scene document or portable file to read. `-` reads it from standard input.
--output requiredstringWhere to write the portable file.
--asset-rootstringA directory mirroring the scene's asset URIs, for a bare document whose assets live on disk.
--overwritebooleanfalseReplace the output file if it already exists.
--jsonbooleanfalseAnswer with one JSON envelope instead of the shell view. Exception: agent serve streams raw lifecycle JSON lines before its final envelope.
--help -hbooleanPrint the command list.

#Run scene export

bash
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

FlagTypeDefaultValuesWhat it does
--file requiredstringThe portable file to read.
--output requiredstringWhere to write the editable scene.
--overwritebooleanfalseReplace the output file if it already exists.
--jsonbooleanfalseAnswer with one JSON envelope instead of the shell view. Exception: agent serve streams raw lifecycle JSON lines before its final envelope.
--help -hbooleanPrint the command list.

#Run scene import

bash
puni scene import --file scene.puni.json --output imported.json --json

Back to the command line index for every group.

Was this useful?