Skip to content
Changelog

object.add

Adds an object to a scene: a new source of a kind you name, or an existing source shown again.

JSON-RPC 2.0project.write

Without x, y, width and height the object is centred and fitted inside each canvas (never made larger than its own size), in front of the others. Given ones apply to every canvas, in canvas pixels. Without scene, it goes into the scene being edited.

| kind | settings | |---|---| | text | text | | image | file (a path, needed) | | video | local_file (a path, needed), looping (on by default) | | color | color (0xAARRGGBB as a number), width, height (the canvas's by default) | | browser | url (needed), width, height (1920 × 1080 by default), css | | display, window, app | display, window or app: a value from capture.targets; a display defaults to the main one | | camera | device from capture.targets (the first camera by default) | | microphone | device: adds a sound source and its track, with no object | | timer | seconds (a 300-second countdown by default) | | phone_camera | none: a Phone camera layer, paired from Lightair Live | | widget | widget: one of Lightair's widgets (scoreboard, lower-third, captions, …); or package (an installed package's id) and widget (its widget's name or folder, from packages.list) |

Any other kind is taken as a source kind id, with its settings as given.

Parameters

  • kindstringWhat to add (the table). Needed unless source is given.
  • sourcestringAn existing source's id or name, to show it again.
  • scenestringThe scene's id or name.
  • namestringThe object's name.
  • settingsobjectThe new source's settings.
  • xnumberLeft edge, canvas pixels.
  • ynumberTop edge, canvas pixels.
  • widthnumberWidth, canvas pixels.
  • heightnumberHeight, canvas pixels.

Result

  • scenestringThe scene's id.
  • objectstringThe new object's id.
  • sourcestringIts source's id.
  • trackstring | nullThe mixer track made for its sound, if it has any.
  • namestringIts name.

Errors

Invalid params (-32602) without kind or source, or without a setting the kind needs. Not found (-32004) for an unknown scene, source or package widget. A state error (-32005) for a camera when no camera is found.

Events

Subscribers to events get workspace.changed.

From an AI agent

The MCP server's add_object reaches this method.

Example

ws://localhost:4455/rpc
{
"jsonrpc": "2.0",
"id": 1,
"method": "object.add",
"params": {
"kind": "text",
"settings": {
"text": "Back soon"
},
"scene": "Break"
}
}

Result

{ "scene": "019ad3f2-6c1e-7a40-9b52-3f1d2e8c4a10", "object": "019ad3f4-1a2b-7c3d-8e4f-5a6b7c8d9e0f", "source": "019ad3f4-2b3c-7d4e-9f50-6b7c8d9e0f1a", "track": null, "name": "Back soon" }

capture.targets · object.update · audio.add