disguise developers

Designer Plugins

Plugins for Disguise Designer software.

Stage Coding Guide

This file covers concepts related to the stage, including accessing its collections, positioning objects, and building complex stage setups like DMX lighting.

The Object Class

All 3D stage elements (such as screens, props, surfaces, and lights) inherit from the core Object class. This class provides common spatial properties and methods, including:

When you interact with stage objects in Python, you are typically working with these properties and methods from the Object class.

Object hierarchy

There is a standard 3D scene node hierarchy to inherit parent Object transforms between Objects, but it is not mandatory. The correct method for adding and removing Objects from the stage is to add it to the correct typed list in the Stage object. Adding objects as parents and children of others is purely for inheriting transforms.

Object Collections

The stage contains several arrays of different object types. These arrays are the correct way to add, find and remove Objects from the Stage.

The lists within the reference are mostly self-explanatory, however there are some lists which behave differently to the others:

Displays

The stage.displays array contains all display surfaces on the stage, including screens and projectors. It duplicates the contents of all arrays which themselves contain Display subclasses. This is convenient for quickly accessing all display elements without needing to search through multiple arrays.

Pucks

Pucks are controlled by the stage.people property and accessible via the stage.pucks array. Each Puck is unnamed, and its description is always Puck. To identify Pucks, you should use their index in the stage.pucks array.

When asking for an overview of the stage, you can mention the number of Pucks, but unless explicitly asked for, the details of individual Pucks should be avoided as it can be overwhelming and is not usually relevant to the user’s needs.

Props

Props are held on the stage.venue, which can be None. If a Venue is present, it contains all the props visible in the Stage.

Some Props are used as a “null” object, in the 3D hierarchy, to provide transform information to groups of other Objects.

Stage & Object Access

TaskPython
Get the current stage objectstage = state.stage
Get an object collection from the stage (e.g., lights)stage.lights or stage.dmxLights
Get the stage’s venue object (can be None)stage.venue
Get all props from the venue (after checking if venue is not None)stage.venue.props
Find a specific projection surface on stage by its namemy_surface = next((s for s in stage.surfaces if s.description.lower() == "surface 1"), None)
Add a surface to the stage to make it visible/activestage.surfaces.append(my_surface_object)

Object Spatial Properties

Assumes my_obj is an object on the stage, inheriting from Object:

TaskPython
Get an object’s position/offsetcurrent_pos = my_obj.offset
Set an object’s position/offsetmy_obj.offset = Vec(1.0, 2.0, 3.0)
Set an object’s rotationmy_obj.rotation = Vec(0.0, 90.0, 0.0)
Set an object’s scalemy_obj.scale = Vec(16.0, 9.0, 0.1)
Set an object’s resolutionmy_obj.resolution = Int2(1920, 1080)

DMX Screens

DMX Screens are contiguous arrays of pixels (like LED tape) that are simpler to set up than DMX Lights.

TaskPython
Create a new DMX screendmx_screen = DmxScreen()
Set fixture type (RGB, RrGgBbWw, etc.)dmx_screen.fixture_type = 0 # 0 = RGB
Configure array parametersdmx_screen.array = 1
dmx_screen.origin = 0
Set DMX universe and channeldmx_screen.universe = 1
dmx_screen.channel = 101
Set universe step for multiple universesdmx_screen.universe_step = 3
Set scale and positiondmx_screen.scale = Vec(5.0, 0.1, 0.1)
dmx_screen.offset = Vec(0.0, 2.0, 0.0)
Add to stagestage.dmxScreens.append(dmx_screen)

Complete DMX Screen Setup Example

dmx_screen = DmxScreen()
dmx_screen.fixture_type = 0  # 0 = RGB
dmx_screen.array = 1
dmx_screen.origin = 0
dmx_screen.universe = 1
dmx_screen.channel = 101
dmx_screen.universe_step = 3
dmx_screen.scale = Vec(5.0, 0.1, 0.1)
dmx_screen.offset = Vec(0.0, 2.0, 0.0)
stage.dmxScreens.append(dmx_screen)

DMX Lights

DMX Lights are actually arrays of DMX lights, controlled as a screen by placing the individual light fixtures across the Object’s mesh.

Basic DMX Light Setup

TaskPython
Create a fixture resourcefixture = Fixture()
Set fixture channel count and sizefixture.nChannels = 3
fixture.size_ = Vec(0.1, 0.1, 0.1)
Create a driver (DmxDriver, GenericLampDriver, or MovingHeadLedDriver)driver = DmxDriver()
driver.mode = 0 # RGB mode
Assign driver to fixturefixture.driver = driver
Create DMX assignmentpatch = DmxAssigner()
Create DMX string configurationdmx_string = DmxString()
Add to stagestage.dmxLights.append(fixture_group)

Complete DMX Light Setup Example

# Create fixture
fixture = Fixture()
fixture.nChannels = 3
fixture.size_ = Vec(0.1, 0.1, 0.1)

# Create and configure driver
driver = DmxDriver()
driver.mode = 0  # RGB mode
fixture.driver = driver

# Create DMX assignment
patch = DmxAssigner()

# Configure DMX string
dmx_string = DmxString()
dmx_string.nUnits = 20
dmx_string.universe = 1
dmx_string.channel = 101
dmx_string.step = 3

# Add string to patch and apply
patch.strings.append(dmx_string)
patch.assign()

# Create fixture group and assign patch
fixture_group = DmxLight()
fixture_group.fixture = fixture
fixture_group.assignment = patch

# Add to stage
stage.dmxLights.append(fixture_group)

Advanced DMX Light Driver Types

TaskPython
Create GenericLampDriver for moving lightdriver = GenericLampDriver()
Create MovingHeadLedDriver for LED moving headdriver = MovingHeadLedDriver()
driver.first_pixel_channel = 1
Set fixture as aimablefixture.aimable = 1
Set fixture resolution for LED arraysfixture.resolution = Vec2(8, 1) # 8 LED pixels

Configure GenericLampDriver

driver = GenericLampDriver()

# Configure lamp controller (color channels)
driver.lamp.red_channel = 1
driver.lamp.green_channel = 2
driver.lamp.blue_channel = 3

# Configure pan/tilt controller
driver.pan_tilt.pan_channel = 5
driver.pan_tilt.tilt_channel = 6
driver.pan_tilt.pan_range = 540.0

Complex DMX Light Arrays

TaskPython
Clear all strings from patchpatch.strings = []

Multiple DMX Strings Example

# Create multiple DMX strings for different universes
string1 = DmxString()
string2 = DmxString()

# Configure string 1 (Universe 1)
string1.nUnits = 33
string1.universe = 1
string1.channel = 101
string1.step = 3

# Configure string 2 (Universe 2)
string2.nUnits = 33
string2.universe = 2
string2.channel = 1
string2.step = 3

# Add both strings to patch
patch.strings.append(string1)
patch.strings.append(string2)