Designer Plugins
Plugins for Disguise Designer software.
Plugins for Disguise Designer software.
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.
| Task | Python |
|---|---|
| Get the main Device Manager object | device_manager = state.devicesReturns 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 Manager | device_manager.devices.append(device_object)Adds a Device object to the manager, making it active in the project. |
| Remove a device from the Device Manager | device_manager.devices.remove(device_object)Removes a Device object from the manager. |
| Get a device by description | my_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. |
for device in device_manager.devices:
# Process each device
pass
Iterates through all currently active Device objects.
(Assumes device is a Device object, e.g., from iterating device_manager.devices.)
| Task | Python |
|---|---|
| Get the device’s type name | type(device).__username__Returns the user-visible name of the type of the device (e.g., “DmxDevice”, “OscDevice”). |
| Get the device’s user-facing name | device.name |
| Get the device’s unique path | device.pathReturns a Path object representing the device’s location in the project. |
| Check if the device is enabled | device.enabledReturns True if the device is enabled/active. |
| Enable or disable a device | device.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. |
(Assumes osc_device is an instance of OscDevice.)
| Task | Python |
|---|---|
| Set OSC input (receive) port | osc_device.receivePort = 8000 |
| Set OSC output (send) port | osc_device.sendPort = 8001 |
| Set OSC destination IP address | osc_device.sendIPAddress = "127.0.0.1" |
| Get OSC device’s current status | osc_device.statusReturns the current connection/status string. |
| Task | Python |
|---|---|
| Save changes to a device | device.save()Persists any modifications to disk. |
| Reload a device from disk | device.reload()Reloads the device, discarding unsaved changes. |
| Delete a device | device_manager.deleteDevice(device)Removes the device from the project and deletes its file. |