Framing and starting options
Set these inSimliConfig, next to faceId. Fields left as None are left out of the request, so Simli’s defaults apply.
This config starts a 16:9 session with the camera zoomed in a little:
start() raise a SimliAPIError with status 422. See Framing the video for how the canvas is filled.
Changing the camera, background and foreground during a session
Oncestart() has returned, three methods change the avatar live:
setCamera
await connection.setCamera(camera, lerp_seconds=...) moves the camera. Each call replaces the whole camera, the session’s starting one included. Its values are offsets from the avatar’s own framing, not from the previous call, so fields you leave out are neutral, and None goes back to the avatar’s own framing. It cuts to the new camera, unless lerp_seconds is above 0: then it glides there over that many seconds, from wherever the camera is now.
setBackground and setForeground
Upload the image first, then pass the id the upload returned. setBackground(id) shows it behind the avatar, and setForeground(id) lays it over the avatar through its transparency. None goes back to the avatar’s own background, or takes the foreground away. The new image shows a moment later, once it has loaded, and if you send several, the last one wins.
Errors and notices
- A bad value raises
ValueError, and nothing is sent: a NaN or infinite camera value orlerp_seconds, or an id that isn’t the 36-character one the upload returned. - Simli’s notices are logged as warnings on the
simli_clientlogger: a camera value outside its supported range (applied anyway), an id that isn’t one of your uploads, an image that couldn’t be loaded, or a face that isn’t Trinity-2. None of them end the session. - Once the session has ended, these methods raise as
send()does.