Scenes & Shoots

3min read
Sheet 41 of 47 · Filming

A scene is players placed in the world and doing things while the camera films. /scene/stage puts bots on the ground, /scene/act and /scene/choreo make them move, and /shoot runs the staging, the acting and a list of shots as one call. Like /film, all of it is API only. Everything here but /scene/surface, /job/status and /job/result moves bots or films, so it needs the API token in the default token mode.

Find spots to stand on

curl "localhost:8767/scene/surface?bot=Cam&x=120&z=-40&radius=40&step=3"

/scene/surface reads the bot's copy of the world around x, z and returns the spots a player can stand on: spots (up to 2000, each with its block) and clusters (up to 40) of them. radius is 40 by default and at most 128, step 3 and at most 16, yMin and yMax default to the world's limits. Only chunks the bot has loaded count.

Stage players

curl -H "X-ITT-Token: $TOKEN" "localhost:8767/scene/stage?bot=Cam&accounts=Aiden,Mila,Kai&x=120&z=-40&radius=12&lookX=120&lookY=72&lookZ=-40"

/scene/stage joins one bot per name in accounts, waits up to 15 s for each to spawn, sends it to a spot with /tp and makes it stand there.

ParameterDefaultMeaning
botThe bot whose world is read for spots
accountsNames to join, comma separated
spotsx,y,z;x,y,z;... to use these spots instead of searching
x, z, radius, step, yMin, yMaxradius 40, step 3Where to search, as for /scene/surface
spread2Blocks between two players, 1 to 64
host, port, versionWhere the players join
yaw, pitch or lookX, lookY, lookZWhich way they face
sneakoffMake them sneak

The answer has one row per player with ok and the spot, or a reason: no standable spot found, no spawn within 15 s.

Make them act

/scene/act takes a script per bot as the body and runs every bot at once:

curl -H "X-ITT-Token: $TOKEN" -X POST "localhost:8767/scene/act" -d '{
  "timeout": 120,
  "bots": {
    "Aiden": [{"do": "walk", "x": 124, "y": 72, "z": -38}, {"do": "look", "name": "Mila"}, {"do": "swing"}],
    "Mila":  [{"do": "wait", "ms": 1500}, {"do": "jump"}, {"do": "follow", "name": "Aiden", "distance": 2}]
  }
}'
StepParameters
waitms (500)
walkx, y, z, range, walks there with the pathfinder
lookx, y, z, or entity / name
sneak, unsneak, sprint, swing, jump, stop
followname, distance

timeout is 1 to 1800 s. A run past it fails with timed out after N s.

/scene/choreo writes such a script for you: preset is gather, crowd, patrol, mine, build, spar, follow or wander, bots the names, x, y, z the centre, radius (5) and timeout (180).

Shoot

/shoot takes the whole board as the body. It saves the server's time once, runs the stage and the acting, films each shot and restores the time and weather once at the end.

{
  "stage": {"bot": "Cam", "accounts": "Aiden,Mila", "x": 120, "z": -40, "radius": 12},
  "act": {"bots": {"Aiden": [{"do": "walk", "x": 124, "y": 72, "z": -38}]}},
  "shots": [
    {"bot": "Cam", "x": 110, "y": 78, "z": -50, "move": "push", "distance": 6, "ms": 6000, "lookX": 120, "lookY": 72, "lookZ": -40},
    {"bot": "Cam", "x": 130, "y": 76, "z": -40, "move": "orbit", "radius": 8, "degrees": 90, "ms": 8000}
  ],
  "reshoot": true
}

Each clip gets a smoothness score from ffmpeg (8 frames a second, small and grey): it passes when the frame to frame change is even and fewer than 10 percent of the frames are frozen. With reshoot: true a shot that fails the score is filmed once more and marked reshot.

Coverage of one subject

curl -H "X-ITT-Token: $TOKEN" "localhost:8767/film/coverage?bot=Cam&x=120&y=72&z=-40&distance=8&time=gold"

/film/coverage films four shots of the point x, y, z through /shoot, at distance (coverageDistance, 8):

ShotCameraMoveLength
wide2.6 x distance out, 0.6 x uppull7 s
medium1.6 x out, 0.25 x uporbit over 70 degrees7 s
close1.8 x out, 0.3 x uppush, with settle6 s
detail1.15 x out, 0.15 x uptruck, handheld on5 s

drive and recorder (filmDrive and filmRecorder when left out), time, weather, fps and hz pass through to every shot.

Several angles

/sequence films a list of shots with one save and one restore of the server state. Send the shots as a body (a JSON array, or {"shots": [...]}), or let it place them:

curl -H "X-ITT-Token: $TOKEN" "localhost:8767/sequence?bot=Cam&angles=6&lookX=120&lookY=72&lookZ=-40&radius=10"

angles (1 to 64) cameras sit on a ring of radius (coverageDistance) around the subject at 0.4 x radius above it, and cycle through push, orbit, truck and pull unless move is given. The answer lists every clip.

Batches in the background

/film, /shoot and /sequence answer when the last clip is written. /job/submit runs a batch in the background instead:

curl -H "X-ITT-Token: $TOKEN" -X POST "localhost:8767/job/submit" -d '{"stage": {...}, "shots": [{...}, {...}]}'
curl "localhost:8767/job/status?id=film-batch-1"
curl "localhost:8767/job/result?id=film-batch-1"

status is pending, running, done or error with done and total shot counts. The last 50 batches are kept.

Loading the index

Enter openUp Down moveEsc close