> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/AcChosen/VR-Stage-Lighting/llms.txt
> Use this file to discover all available pages before exploring further.

# VRStageLighting_DMX_Static

> Core script for DMX-controlled stage lighting fixtures

## Overview

The `VRStageLighting_DMX_Static` class is the primary component for DMX-controlled lighting fixtures in VRSL. It handles DMX channel assignment, fixture properties, movement controls, and rendering for stage lights that can be controlled via industry-standard DMX protocols.

This script supports both modern industry-standard DMX channel assignment and legacy sector-based addressing. It can control movers, spot lights, and other fixture types with full support for pan/tilt, color, intensity, gobos, and strobes.

**Namespace:** `VRSL`\
**Inherits from:** `UdonSharpBehaviour` (in VRChat) or `MonoBehaviour` (in Unity)

## DMX Settings

<ParamField path="enableDMXChannels" type="bool" default="true">
  Enables DMX mode for this fixture. When enabled, the fixture responds to DMX input from the grid node.
</ParamField>

<ParamField path="fixtureID" type="int" default="0">
  Optional ID number for organizational purposes. Useful for matching IDs in DMX software and for Udon scripting references.
</ParamField>

<ParamField path="dmxChannel" type="int" default="1">
  The industry standard DMX Channel this fixture begins on. Most standard VRSL fixtures use 13 channels.
</ParamField>

<ParamField path="dmxUniverse" type="int" default="1">
  The industry standard Artnet Universe. Use this to choose which universe to read the DMX Channel from.
</ParamField>

<ParamField path="nineUniverseMode" type="bool" default="false">
  Enables 9-Universe mode for this fixture. The grid will be split up by RGB channels with each section and color representing a universe. Only available on the Vertical and Horizontal Grid nodes.
</ParamField>

<ParamField path="useLegacySectorMode" type="bool" default="false">
  Enables the legacy 'Sector' based method of assigning DMX Channels. Keep this unchecked to use industry standard DMX Channels.
</ParamField>

<ParamField path="singleChannelMode" type="bool" default="false">
  Enables single channel DMX mode for this fixture. This is for single channeled fixtures instead of the standard 13-channeled ones. Currently, the 'Flasher' fixture is the only single-channeled fixture.
</ParamField>

<ParamField path="sector" type="int" default="0">
  Chooses the DMX Address to start this fixture at when using legacy sector mode. A Sector in this context is every 13 Channels. I.E Sector 0 is channels 1-13, Sector 1 is channels 14-26, etc.
</ParamField>

<ParamField path="Channel" type="int" default="0" range="0-12">
  Chooses which of the 13 Channels of the current sector to sample from when single channel mode is enabled.
</ParamField>

<ParamField path="legacyGoboRange" type="bool" default="false">
  Enables legacy gobo range compatibility.
</ParamField>

## General Settings

<ParamField path="globalIntensity" type="float" default="1.0" range="0-1">
  Sets the overall intensity of the shader. Good for animating or scripting effects related to intensity. Its max value is controlled by Final Intensity.
</ParamField>

<ParamField path="finalIntensity" type="float" default="1.0" range="0-1">
  Sets the maximum brightness value of Global Intensity. Good for personalized settings of the max brightness of the shader by other users via UI.
</ParamField>

<ParamField path="finalIntensityComponentMode" type="bool" default="false">
  Choose between setting the Final Intensity for all meshes, or individual meshes.
</ParamField>

<ParamField path="finalIntensityVolumetric" type="float" default="1.0" range="0-1">
  Sets the maximum brightness value of Global Intensity for volumetric meshes only. Good for personalized settings of the max brightness of the shader by other users via UI.
</ParamField>

<ParamField path="finalIntensityProjection" type="float" default="1.0" range="0-1">
  Sets the maximum brightness value of Global Intensity for projection meshes only.
</ParamField>

<ParamField path="finalIntensityFixture" type="float" default="1.0" range="0-1">
  Sets the maximum brightness value of Global Intensity for fixture meshes only.
</ParamField>

<ParamField path="lightColorTint" type="Color" default="White * 2.0">
  The main color of the light. Leave it at default white for DMX mode. Supports HDR colors.
</ParamField>

## Movement Settings

<ParamField path="invertPan" type="bool" default="false">
  Invert the pan values (Left/Right Movement) for movers.
</ParamField>

<ParamField path="invertTilt" type="bool" default="false">
  Invert the tilt values (Up/Down Movement) for movers.
</ParamField>

<ParamField path="isUpsideDown" type="bool" default="false">
  Enable this if the mover is hanging upside down.
</ParamField>

## Fixture Settings

<ParamField path="enableAutoSpin" type="bool" default="true">
  Enable projection spinning (Udon Override Only).
</ParamField>

<ParamField path="enableStrobe" type="bool" default="true">
  Enable strobe effects (via DMX Only).
</ParamField>

<ParamField path="tiltOffsetBlue" type="float" default="90.0" range="0-360">
  Tilt (Up/Down) offset/movement. Directly controls tilt when in Udon Mode; is an offset when in DMX mode.
</ParamField>

<ParamField path="panOffsetBlueGreen" type="float" default="0.0" range="0-360">
  Pan (Left/Right) offset/movement. Directly controls pan when in Udon Mode; is an offset when in DMX mode.
</ParamField>

<ParamField path="selectGOBO" type="int" default="1" range="1-8">
  Use this to change what projection is selected. This is overridden in DMX mode.
</ParamField>

## Mesh Settings

<ParamField path="objRenderers" type="MeshRenderer[]" required>
  The meshes used to make up the light. You need at least 1 mesh in this group for the script to work properly. Supports up to 5 mesh renderers.
</ParamField>

<ParamField path="coneWidth" type="float" default="2.5" range="0-5.5">
  Controls the radius of a mover/spot light.
</ParamField>

<ParamField path="coneLength" type="float" default="8.5" range="0.5-10.0">
  Controls the length of the cone of a mover/spot light.
</ParamField>

<ParamField path="maxConeLength" type="float" default="1.0" range="0.275-10.0">
  Controls the mesh length of the cone of a mover/spot light.
</ParamField>

<ParamField path="maxMinPan" type="float" default="180.0">
  Maximum pan angle range in degrees.
</ParamField>

<ParamField path="maxMinTilt" type="float" default="-180.0">
  Maximum tilt angle range in degrees.
</ParamField>

## Public Methods

### \_UpdateInstancedProperties()

Updates all material property blocks with current fixture settings. Call this method after changing any public properties to apply changes to the fixture.

```csharp theme={null}
public void _UpdateInstancedProperties()
```

### \_UpdateInstancedPropertiesSansDMX()

Updates material property blocks without DMX functionality enabled. Used for non-DMX controlled fixtures.

```csharp theme={null}
public void _UpdateInstancedPropertiesSansDMX()
```

### \_DMXChannelToString()

Returns a string representation of the current DMX channel and universe.

```csharp theme={null}
public string _DMXChannelToString()
```

**Returns:** String in format "DMX Channel: X  Universe: Y"

### \_GetUniverse()

Gets the calculated DMX universe for this fixture.

```csharp theme={null}
public int _GetUniverse()
```

**Returns:** Integer representing the DMX universe

### \_GetDMXChannel()

Gets the calculated DMX channel for this fixture.

```csharp theme={null}
public int _GetDMXChannel()
```

**Returns:** Integer representing the DMX channel

## Properties (for Udon Scripting)

All public fields have corresponding properties for safe access from Udon scripts:

* `LightColorTint` - Get/Set the light color
* `ConeWidth` - Get/Set the cone width
* `ConeLength` - Get/Set the cone length
* `MaxConeLength` - Get/Set the maximum cone length
* `GlobalIntensity` - Get/Set the global intensity
* `FinalIntensity` - Get/Set the final intensity
* `FinalIntensityComponentMode` - Get/Set component mode
* `FinalIntensityVolumetric` - Get/Set volumetric intensity
* `FinalIntensityProjection` - Get/Set projection intensity
* `FinalIntensityFixture` - Get/Set fixture intensity
* `SelectGOBO` - Get/Set the selected gobo
* `NineUniverseMode` - Get/Set nine universe mode
* `InvertPan` - Get/Set pan inversion
* `InvertTilt` - Get/Set tilt inversion
* `IsDMX` - Get/Set DMX enabled state
* `ProjectionSpin` - Get/Set projection spin
* `Pan` - Get/Set pan offset
* `Tilt` - Get/Set tilt offset

## Usage Example

```csharp theme={null}
// Example: Setting up a DMX fixture on channel 14, universe 1
VRStageLighting_DMX_Static fixture = GetComponent<VRStageLighting_DMX_Static>();

// Configure DMX settings
fixture.enableDMXChannels = true;
fixture.dmxChannel = 14;
fixture.dmxUniverse = 1;

// Adjust intensity
fixture.globalIntensity = 0.8f;
fixture.finalIntensity = 1.0f;

// Apply changes
fixture._UpdateInstancedProperties();
```

## Related Components

* [VRStageLighting\_AudioLink\_Static](/api/vrstagelighting-audiolink-static) - AudioLink-controlled fixtures
* [VRSL\_LocalUIControlPanel](/api/vrsl-localuicontrolpanel) - Local UI control panel for VRSL
* [GridReader](/api/vrsl-gridreader) - OSC/DMX grid reader component
