Ops reference
About ops
Ops are a small JSON language for building scenes without shipping a full ProjectJSON. Send an ops array to POST /v1/scenes. Coordinates are integers in voxel space.
Scene & layers
| Op | Fields |
|---|---|
scene.set_name | { name } |
scene.clear | Remove all voxels |
layer.add | { id?, name? } |
layer.set_active | { id } |
layer.clear | { id? } — active layer if omitted |
Color & mode
| Op | Fields |
|---|---|
color.set | { hex } or { rgba } |
mode.set | add | sub | paint |
Voxels
| Op | Fields |
|---|---|
voxel.set | { x, y, z, hex?, rgba? } |
voxel.remove | { x, y, z } |
voxel.set_many | { voxels: [...] } |
Shapes
| Op | Fields |
|---|---|
shape.box | { from, to, hex?, rgba?, mode? } |
shape.sphere | { center, radius, ... } |
shape.cylinder | { from, to, radius, ... } |
Palette
| Op | Fields |
|---|---|
palette.use | Curated id, e.g. curated_pico8 |
Example
[
{ "op": "palette.use", "id": "curated_pico8" },
{ "op": "color.set", "hex": "#ff004d" },
{ "op": "mode.set", "mode": "add" },
{ "op": "shape.box", "from": [0, 0, 0], "to": [4, 4, 4] }
]