A modular Python tool to generate LED sphere models for xLights, MadMapper, and Chromatik animation software. All configuration is managed via a single YAML file.
pip install PyYAMLpython generate_models.pyThis generates all enabled formats from config.yaml. By default, you'll get:
atlas_v2.xmodel- For xLights (2D grid layout)atlas_v2.csv- String configuration data for xLightsatlas_v2_3d.xmodel- For xLights (3D with ring submodels)atlas_v2_3d.csv- 3D string configuration dataatlas_v2_3d_coordinates.json- 3D LED coordinatesatlas_v2_coordinates.json- 2D LED coordinatesatlas_v2.mmfl- For MadMapperatlas_v2.lxf- For Chromatik
python generate_models.py --formats xlights
python generate_models.py --formats xlights3d
python generate_models.py --formats madmapper
python generate_models.py --formats chromatikpython generate_models.py --list-formatspython generate_models.py --output-dir ./models --prefix my_sphereFollow these steps to import and configure your Atlas v2 sphere model in xLights:
- Open your xLights project
- Navigate to the Layout tab
- Click Import in the model section
- Select a location in the show layout view
- In the file picker dialog, select your generated
.xmodelfile
- Assign Controller: Select your controller from the dropdown
- Starting Pin: Set the starting pin number for your controller
- Number of Strings: Set this to match your PORTS value (default: 16)
- Individual Start Nodes: Check this box to enable custom start positions
Using the values from your generated CSV file, set the start position for each string:
- Look for rows in the CSV where "PC Start" has a value (indicating the start of a new power channel)
- Use the "LED Start" value from these rows as your string start positions
Example Configuration:
- String 1: 1 (LED Start from first PC Start row)
- String 2: 333 (LED Start from second PC Start row)
- String 3: 765 (LED Start from third PC Start row)
- String 4: 1148 (LED Start from fourth PC Start row)
- ... continue for all strings
- Check that all strings have the correct start positions
- Verify the total number of strings matches your PORTS setting
- Test the model by creating a simple effect to ensure all LEDs respond correctly
The 3D model (atlas_v2_3d.xmodel) provides enhanced 3D visualization with ring submodels:
- Follow the same import process as the 2D model
- The 3D model will appear with proper 3D positioning in the layout view
- Ring Submodels: Each ring is a separate submodel for better organization
- 3D Coordinates: All LEDs have proper 3D coordinates for realistic visualization
- Spherical Distribution: Rings are positioned to form a true sphere shape
- Individual Ring Control: You can select and manipulate individual rings
- The 3D model uses the same controller settings as the 2D model
- Ring spacing and positioning are controlled via the
xlights3dconfiguration section - Each ring maintains its LED numbering and controller assignments
- Open MadMapper and go to the LED Fixture Library
- Click Import and select your
.mmflfile - The fixture will be available with proper DMX channel mapping
- The grid projection uses the
grid_resolutionsetting from your config
- Copy the generated
.lxffile to the Chromatik fixtures directory:- macOS:
~/Chromatik/Fixtures/ - Windows:
%USERPROFILE%\Chromatik\Fixtures\ - Linux:
~/Chromatik/Fixtures/
- macOS:
- Open Chromatik and navigate to the FIXTURES section on the left-pane MODEL tab
- The fixture will appear in the Fixture Chooser arranged by subdirectory name
- The fixture uses arc components for each ring with proper 3D positioning
- ArtNet output is configured with segmented structure matching your controller ports
- Configure ArtNet settings (host, universe) in the fixture parameters if needed
Note: The fixture uses arc components representing each ring as a 360-degree arc at its proper latitude on the sphere. Each ring is positioned correctly in 3D space to form the complete sphere shape.
Edit config.yaml to customize your model:
model:
name: "Atlas v2"
version: "2.0"
description: "LED Sphere by DrZzs & GrZzs"
# LED Ring Configuration (49 rings, 6119 total LEDs)
rings:
1: 33
2: 55
# ... (see config.yaml for full list)
49: 33
# Controller Settings
controller:
ports: 16
total_size: 1000
# Geometry Settings
geometry:
sphere_radius: 100.0
coordinate_system: "spherical"
# MadMapper Settings
madmapper:
grid_resolution: 100 # Grid size for projection
dmx_start_channel: 1 # Starting DMX channel
# Chromatik Settings
chromatik:
artnet_host: "127.0.0.1" # ArtNet destination IP address
artnet_start_universe: 0 # Starting ArtNet universe number
dmx_start_channel: 1 # Starting DMX channel for the first LED
# xLights 3D Settings
xlights3d:
grid_width: 50 # Width of each 2D slice
grid_height: 50 # Height of each 2D slice
grid_depth: 50 # Number of z-layers (depth)
sphere_radius: 100.0 # Radius for coordinate mapping
# Output Settings
output:
default_prefix: "atlas_v2"
formats:
xlights:
enabled: true
extension: ".xmodel"
filename: "atlas_v2.xmodel"
xlights3d:
enabled: true
extension: "_3d.xmodel"
filename: "atlas_v2_3d.xmodel"
madmapper:
enabled: true
extension: ".mmfl"
filename: "atlas_v2.mmfl"
chromatik:
enabled: true
extension: ".lxf"
filename: "atlas_v2.lxf"- Developer Guide - Project structure, extending the generator, and advanced usage
- AI Guide - Prompts used to create this codebase and templates for AI-assisted development
- Output Format Documentation - Detailed specifications for generated file formats:
- xLights xmodel format - 2D custom model format
- xLights 3D xmodel format - 3D custom model format
- MadMapper mmfl format - LED fixture library format
- File formats overview - General format information
- Chromatik lxf format - Custom fixture format (external documentation)
The generator creates the following files:
{prefix}.xmodel- 2D custom model for xLights{prefix}.csv- String configuration data
{prefix}_3d.xmodel- 3D custom model with ring submodels{prefix}_3d.csv- 3D string configuration data{prefix}_3d_coordinates.json- 3D LED coordinates{prefix}_3d_rings.csv- Ring configuration data
{prefix}.mmfl- LED fixture library file
{prefix}.lxf- Custom fixture file with arc components for each ring
{prefix}_coordinates.json- 2D LED coordinates (generated by xLights format)
python generate_models.py [OPTIONS]
Options:
-h, --help Show help message and exit
-c, --config CONFIG Path to configuration file (default: config.yaml)
-o, --output-dir DIR Output directory for generated files (default: current directory)
-f, --formats FORMATS Specific formats to generate (xlights, xlights3d, madmapper, chromatik)
-p, --prefix PREFIX Output filename prefix (default: from config)
--list-formats List available formats and exit