Generate Lights - World Editor Plugin I'm so tired now, that I used AI to write this description here. Sorry I will shorten it someday. quick test on west coast with existing streetlamps placed as forestitems Author: AlexKidd71 Version: 1.0 Release Date: October 9, 2025 Overview Generate Lights is a World Editor plugin that automates the placement of lights for repeating objects in your BeamNG.drive maps. Whether you're working with TSStatic objects from Scenetree or Forest items, this tool saves hours of manual light placement by automatically generating lights at the correct positions and rotations for all matching objects in your scene. Key Features Supports both TSStatic objects and Forest items Preserves light rotation and all properties from template lights Automatically creates organized SimGroups for generated lights Handles multiple lights per object Skips the template object to avoid duplicating source lights Simple 3-step workflow Installation Download the .zip file in this thread article. Open up the file and place its content into your userfolder. Alternatively, open up the file and place its content into your BeamNG.drive root directory (can be easily found by right-clicking on BeamNG Drive in Steam → Manage → Browse local files): Place the lua folder where the lua folder is. Alternatively, navigate through all folders in the .zip attached and place the .lua files in BeamNG.drive\lua\ge\extensions\editor. Restart BeamNG.drive or reload the World Editor Access the plugin from the World Editor menu: Editor → Generate Lights How It Works The plugin calculates the relative position and rotation of lights compared to a template object, then replicates those lights at all matching objects in your scene with the correct transformations. Step-by-Step Tutorial Example Scenario: Street Lamps Let's say you have 50 lamp posts placed as Forest items in your map, and you want to add lights to each one. Step 1: Set Up Your Template Select ONE lamp post that will serve as your template Place and configure your lights on this lamp post: Position them exactly where you want them Configure all properties (color, brightness, radius, angles, etc.) Adjust rotation for spotlights to point in the correct direction Make sure you're happy with the result - these will be your reference lights Step 2: Select Template Object Open the Generate Lights window from the Editor menu In the World Editor Scene Tree, select your template lamp post For TSStatic objects: Select the object in the Scene Tree For Forest items: Use the Forest Editor to select the item Click the "Get Object by Selection" button in the plugin window You should see the shape filename displayed (e.g., "lamp_post_01.dae") Step 3: Select Template Lights In the Scene Tree, select the light(s) you placed on the template object You can select multiple lights by holding Ctrl Only PointLight and SpotLight objects are supported Click the "Get Light(s) by Selection" button The plugin will show how many lights are selected Step 4: Generate Lights Click the "Generate Lights" button The plugin will: Find all objects matching your template shape Skip the template object itself (no duplicate lights) Create copies of your lights at each matching object Preserve all light properties and rotations Place all generated lights in a numbered SimGroup (e.g., "generated_lights_1") Step 5: Review and Adjust All generated lights are organized in a SimGroup in your Scene Tree You can easily delete all generated lights by removing the SimGroup If you need to regenerate, just delete the group and run the plugin again Working with TSStatic Objects TSStatic objects are regular scene objects like props, signs, or decorative elements. Process: Place your TSStatic template object Add and configure lights on it Select the TSStatic object in the Scene Tree Follow the 3-step workflow above The plugin finds all TSStatic objects with the same shapeName field and generates lights for each one. Working with Forest Items Forest items are BeamNG's optimized system for placing many identical objects (trees, rocks, lamp posts, bollards, etc.). Process: Place your forest items using the Forest Editor Select one forest item as your template Add and configure lights near that forest item's position In the Forest Editor, select the template forest item Follow the 3-step workflow above The plugin finds all forest items with the same shapeFile and generates lights for each one. Tips and Best Practices Light Configuration: Configure all light properties (color, range, brightness, shadows) on the template lights before generating For spotlights, pay special attention to rotation - it will be preserved Use realistic light ranges to maintain good performance Organization: Each generation creates a new numbered SimGroup (generated_lights_1, generated_lights_2, etc.) This makes it easy to manage and delete light batches Keep your template lights in a separate group for easy reference Performance: Generated lights use the same SimGroup system as manual lights Consider using lights with appropriate ranges to avoid performance issues Test with a small section first before generating lights for hundreds of objects Iteration Workflow: If you need to adjust lights, delete the generated_lights group Modify your template lights Regenerate - the plugin will skip the template object automatically Multiple Light Types: You can select multiple lights (e.g., one spotlight + one point light) All selected lights will be generated at each target object Useful for complex lighting setups like lamp posts with both main and ambient lights Troubleshooting "No valid TSStatic or Forest item selected" Make sure you're selecting the actual object, not a light For Forest items, use the Forest Editor selection tool Lights have wrong rotation The plugin preserves rotation from template lights Check your template light rotation before generating Lights not appearing Check the console log for error messages Verify the template object type matches target objects Too many/too few lights generated The plugin finds ALL objects matching the template shape Check how many matching objects exist in your scene Template object is automatically skipped Technical Details Supported Light Types: PointLight SpotLight Supported Object Types: TSStatic (scene tree objects) Forest Items Light Properties Preserved: All fields from template lights (color, brightness, range, etc.) Rotation (critical for spotlights) Light type and class Coordinate System: Uses quaternion math for accurate rotation handling Calculates relative positions in local coordinate space Applies rotations correctly regardless of object orientation Use Cases Street lighting for roads with lamp posts Decorative lights on repeating architectural elements Navigation lights on multiple identical structures Interior lighting for instanced building props Warning lights on safety barriers or bollards Atmospheric lighting for forest or environmental objects Version History Version 1.0 (October 9, 2025) Initial release Support for TSStatic objects Support for Forest items Automatic template object skipping Multi-light support Organized SimGroup creation Credits and License This plugin is released under the bCDDL v. 1.1 license. Developed by AlexKidd71 @stuffi3000 and @Barbent Servo GT for inspiration and good talks! For support, bug reports, or feature requests, please use this thread.. Happy map making! Planned Features: --- Post updated --- randomization option for variations in brightness and color for a more natural look. better names for generated lights select lights and optional static objects for generation. Usecase: Select a building as template object place a doorlamp dae file and place the lights, then generate lamp and lights for all similar buildings.
Ill def be checking this out this might help me alllott --- Post updated --- EDIT: Works great and will make my life alot easier, however would it be possible or planned for numerical naming as in "light1, light2, light3" and so forth?