cd# GE XLS 450 Xlights Model Utilities
This repository contains essential files and Python scripts for generating, customizing, and organizing the Xlights model elements for the GE XLS 450 prop.
| File | Type | Description |
|---|---|---|
cleanup.py |
Python Script | Cleans, sorts, and formats the <subModel> and <modelGroup> elements within your .xmodel file for better organization. |
submodel_render.py |
Python Script | Renders visual images of each <subModel> in the .xmodel file, and generates a README.md table with images grouped by <modelGroup>. |
./GE XLS 450/XLS450_Arm_Numbering.csv |
CSV Data | Defines the sequential node numbers assigned to each of the six arms. This data is critical for the Python utilities. |
./GE XLS 450/XLS450_node_relay.py |
Python Script | Generates <subModel> and <modelGroup> XML lines for component models (e.g., specific segments of the arms) based on the CSV data and user configuration. |
This script is designed to keep your model file tidy. After generating and pasting multiple <subModel> and <modelGroup> entries, running this script will sort them alphabetically and format the XML cleanly.
- Python 3.x (Python 3.9+ is recommended for best XML formatting).
You must update the MODEL_FILE_PATH variable within cleanup.py to point to the correct location of your .xmodel file.
# =========================================================================
# === USER CONFIGURATION: CHANGE THE PATH BELOW TO YOUR XMODEL FILE PATH ===
# =========================================================================
MODEL_FILE_PATH = "GE XLS 450.xmodel" # Update this path as necessary!- Close Xlights and ensure your model file is saved.
- Run the script:
python cleanup.py
- Sorting: The script sorts all
<subModel>elements first, followed by all<modelGroup>elements, using their names alphabetically. - Rolling Backups: The script automatically creates a rolling backup before modifying your file. It saves up to 5 copies (
_backup_0through_backup_4), ensuring you can always revert changes.
This script creates visual representations of each <subModel> in your .xmodel file and generates a README.md table grouping submodels by their <modelGroup>.
- High-resolution renderings of each submodel.
- Automatically generates a README.md with:
- Model group rows.
- Submodel images and names in table cells.
- Individual submodel sections for reference.
- Correctly handles spaces in filenames for Markdown rendering.
- Python 3.x
- The
Pillowlibrary:pip install pillow
- Close Xlights and ensure your
.xmodelfile is saved. - Run the script:
python submodel_render.py <file.xmodel>- Output:
- All submodel images will be saved in
renders/<model_name>/. - A
README.mdwill be created inside that folder with a grouped image table and individual submodel previews.
renders/
└── GE XLS 450/
├── Arm 1.png
├── Arm 2.png
├── Arm 3.png
├── README.md
└── ...
- Adjust the
SCALEvariable in the script to increase/decrease the resolution of rendered images. - The README table automatically uses model group definitions from the
.xmodelfile to organize submodels visually.
This script is used to quickly generate the XML needed to define new custom component models within your main .xmodel file. It works by mapping user-defined node ranges to the actual node numbers across the six arms, as defined in the CSV.
- Python 3.x
- The
pandaslibrary:pip install pandas numpy
-
Configure: Open
XLS450_node_relay.pyand modify the first few lines in the--- Configuration ---section to define the node range you want to extract and the naming convention you want to use.ARM1_COL: Do not change. This is the name of the reference column in the CSV ('Arm 1').INPUT_ARM1_STRING: Update this. Use standard Xlights range notation (e.g.,"1-5, 10, 12-15") to select the node positions you want to map from each arm.OUTPUT_NAME_TEMPLATE: Defines the name template (e.g.,"Inner Leg #", which will become "Inner Leg 1", "Inner Leg 2", etc.).
-
Generate XML: Run the script from your terminal:
python XLS450_node_relay.py
The script will print the generated XML for the new
<subModel>and<modelGroup>elements to your console. -
Paste & Save: Copy the generated XML and paste it into your
GE XLS 450.xmodelfile, right before the closing</custommodel>tag.
To generate a single, consolidated submodel containing all the nodes defined in your INPUT_ARM1_STRING across all six arms, use the --single flag:
python XLS450_node_relay.py --single