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

OpFields
scene.set_name{ name }
scene.clearRemove all voxels
layer.add{ id?, name? }
layer.set_active{ id }
layer.clear{ id? } — active layer if omitted

Color & mode

OpFields
color.set{ hex } or { rgba }
mode.setadd | sub | paint

Voxels

OpFields
voxel.set{ x, y, z, hex?, rgba? }
voxel.remove{ x, y, z }
voxel.set_many{ voxels: [...] }

Shapes

OpFields
shape.box{ from, to, hex?, rgba?, mode? }
shape.sphere{ center, radius, ... }
shape.cylinder{ from, to, radius, ... }

Palette

OpFields
palette.useCurated 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] }
]