Skip to content

TheChrisTech/xlights_models

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Files

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.

1. cleanup.py - Xmodel Organizer

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.

Prerequisites

  • Python 3.x (Python 3.9+ is recommended for best XML formatting).

Configuration

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!

How to Use

  1. Close Xlights and ensure your model file is saved.
  2. Run the script:
    python cleanup.py

Safety Features

  • 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_0 through _backup_4), ensuring you can always revert changes.

2. submodel_render.py - Submodel Image Renderer

This script creates visual representations of each <subModel> in your .xmodel file and generates a README.md table grouping submodels by their <modelGroup>.

Features

  • 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.

Prerequisites

  • Python 3.x
  • The Pillow library: pip install pillow

How to Use

  1. Close Xlights and ensure your .xmodel file is saved.
  2. Run the script:
python submodel_render.py <file.xmodel>
  1. Output:
  • All submodel images will be saved in renders/<model_name>/.
  • A README.md will be created inside that folder with a grouped image table and individual submodel previews.

Example Folder Structure

renders/
└── GE XLS 450/
    ├── Arm 1.png
    ├── Arm 2.png
    ├── Arm 3.png
    ├── README.md
    └── ...

Notes

  • Adjust the SCALE variable in the script to increase/decrease the resolution of rendered images.
  • The README table automatically uses model group definitions from the .xmodel file to organize submodels visually.

3. XLS450_node_relay.py - Model Component Generator for XLS450

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.

Prerequisites

  • Python 3.x
  • The pandas library: pip install pandas numpy

How to Use

  1. Configure: Open XLS450_node_relay.py and 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.).
  2. 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.

  3. Paste & Save: Copy the generated XML and paste it into your GE XLS 450.xmodel file, right before the closing </custommodel> tag.

Single Submodel Mode

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

About

Updated xLights models that contain corrected and more detailed submodels.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages