disguise developers

Designer Plugins

Plugins for Disguise Designer software.

Devices Python Samples

This guide demonstrates how to use the Disguise Python API to interact with devices and the Device Manager. Devices represent external hardware or software endpoints (e.g., DMX, OSC, MIDI, projectors, cameras) that can be controlled or monitored by Disguise. The DeviceManager (state.devices) is responsible for managing all device objects in the project.

Device Manager Operations

TaskPython
Get the main Device Manager objectdevice_manager = state.devices
Returns the singleton DeviceManager instance for the current project.
Find all devices of a specific type (e.g., DmxDevice)[d for d in device_manager.devices if isinstance(d, DmxDevice)]
Returns a list of all devices of the specified type.
Add a device to the Device Managerdevice_manager.devices.append(device_object)
Adds a Device object to the manager, making it active in the project.
Remove a device from the Device Managerdevice_manager.devices.remove(device_object)
Removes a Device object from the manager.
Get a device by descriptionmy_device = next((d for d in device_manager.devices if d.description == "MyDevice"), None)
Finds a device by its user-facing description.
List all device description[d.description for d in device_manager.devices]
Returns a list of all device names.

List all active devices

for device in device_manager.devices:
    # Process each device
    pass

Iterates through all currently active Device objects.

Device Properties & Methods

(Assumes device is a Device object, e.g., from iterating device_manager.devices.)

TaskPython
Get the device’s type nametype(device).__username__
Returns the user-visible name of the type of the device (e.g., “DmxDevice”, “OscDevice”).
Get the device’s user-facing namedevice.name
Get the device’s unique pathdevice.path
Returns a Path object representing the device’s location in the project.
Check if the device is enableddevice.enabled
Returns True if the device is enabled/active.
Enable or disable a devicedevice.enabled = True or device.enabled = False
Get a DmxDevice’s driver type (e.g., “ArtNet”)device.driverType()
Returns the DMX driver type as a string. Only for DmxDevice objects.

OSC Device Example

(Assumes osc_device is an instance of OscDevice.)

TaskPython
Set OSC input (receive) portosc_device.receivePort = 8000
Set OSC output (send) portosc_device.sendPort = 8001
Set OSC destination IP addressosc_device.sendIPAddress = "127.0.0.1"
Get OSC device’s current statusosc_device.status
Returns the current connection/status string.

Additional Device Operations

TaskPython
Save changes to a devicedevice.save()
Persists any modifications to disk.
Reload a device from diskdevice.reload()
Reloads the device, discarding unsaved changes.
Delete a devicedevice_manager.deleteDevice(device)
Removes the device from the project and deletes its file.