TouchDesigner Python API
Native Python interface for controlling Lightpath from inside TouchDesigner.
Native Python interface for controlling Lightpath from inside
TouchDesigner. The LightpathAPI.tox component (provided by
Digital Ambiance) wraps the HTTP API and exposes everything two
ways: as custom parameters you can wire in the editor, and as
extension methods you can call from any DAT via
op.LIGHTPATH_API.MethodName().
Setup
-
Load
LightpathAPI.toxinto your.toe. The component self-installs theLIGHTPATH_APIglobal op shortcut, so you can reach it from anywhere asop.LIGHTPATH_API. -
Configure the server. On the component's Server page, set:
- Host — the Lightpath server hostname or IP. Leave as
localhostif you're running on the same machine. - Port — defaults to
3001. Leave as-is unless your install overrides it.
- Host — the Lightpath server hostname or IP. Leave as
-
Log in. Lightpath's content routes are auth-gated, so the component needs to hold a valid token before it can do anything:
- Enter your Username and Password on the Server page.
- Pulse Login. On success, the Status page's Logged In
field shows
yes (expires …).
-
Sync data. Pulse Sync Data to query the server for all looks, scenes, sequences, playlists, outputs, and actions, and populate the dropdown menus on every page. Now you can pick things by name from a dropdown instead of typing them.
Sync Data auto-fires whenever Host or Port changes, so once you're configured you rarely need to pulse it manually.
That's it — you can now drive Lightpath either by pulsing the parameter buttons on the component, or by calling the extension methods from Python:
Configuration
| Method | Description |
|---|---|
SetServer(host="localhost", port=3001) | Set the Lightpath server address |
GetServer() | Returns { "host": "...", "port": ... } |
Login(username, password) | Authenticate and store the returned JWT |
Logout() | Clear the stored token |
Content activation
| Method | Description |
|---|---|
ActivateLook(name) | Activate a look on its configured output |
ActivateSequence(name) | Start a sequence on its assigned output |
ActivateScene(name) | Activate a scene across all of its outputs |
ActivatePlaylist(name) | Start a global playlist (scene rotation) |
Each look is bound to one output at design time, so ActivateLook
doesn't take a target — the look already knows where it goes. Use
scenes or playlists when you want one trigger to drive several
outputs at once.
Playlist control
Per-output and global playlists share the same methods — pass output="Name"
to control a specific output's sequence, omit it to control the global
scene-rotation playlist.
| Method | Description |
|---|---|
PausePlaylist(output=None) | Pause a playlist |
ResumePlaylist(output=None) | Resume a playlist |
StopPlaylist(output=None) | Stop a playlist |
SetTrack(index, output=None) | Jump to a specific track (0-based) |
ToggleLoop(output=None) | Toggle loop mode |
NextTrack(output) | Advance to next track (per-output only) |
PrevTrack(output) | Go to previous track (per-output only) |
PauseSequence, ResumeSequence, StopSequence are kept as aliases for
backward compatibility.
Actions
| Method | Description |
|---|---|
FireAction(name, targetState=None) | Execute an action. For toggles, pass targetState=True/False |
SetActionState(name, state) | Set a toggle action state (True/False or "on"/"off") |
Output control
| Method | Description |
|---|---|
SetDimmer(outputName, value) | Set output brightness (0.0 – 1.0) |
SetOutputEnabled(outputName, enabled) | Power toggle |
Global playback
| Method | Description |
|---|---|
StopAll() | Stop all playback across all outputs |
GetPlaybackStatus() | Get playback status for all playlists |
State queries
| Method | Description |
|---|---|
GetState() | Get full current system state |
GetLooks() | Get all looks |
GetSequences() | Get all playlists (per-output) |
GetScenes() | Get all scenes |
GetPlaylists() | Get all global playlists |
GetOutputs() | Get all outputs |
GetActions() | Get all actions |

