A comprehensive Blender addon for importing and exporting BeamNG.drive level data, featuring complete round-trip terrain workflows with 16-bit EXR displacement textures and coordinate system correction.
- 🏞️ Complete Terrain Workflow - Full import/export pipeline with BeamNG
.terfiles - 🔄 Round-trip Support - Import, edit, and export back to BeamNG with coordinate consistency
- 📸 16-bit EXR Textures - High-precision displacement and layermap textures for non-destructive editing
- 🎨 Blender Integration - Use Blender's texture painting tools to modify terrain
- ⚡ Geometry Nodes - Real-time preview with advanced node-based terrain system
- 🛣️ DecalRoad Import - Import road networks with materials and geometry nodes
- 🗺️ Coordinate Correction - Automatic handling of BeamNG ↔ Blender coordinate system differences
- 📁 Level Detection - Smart BeamNG level directory validation and parsing
- Static Objects Export - Export prefab objects and meshes to
.prefabfiles - Advanced Materials - Multi-layer terrain textures and blending
- Texture Pipeline - DDS texture conversion and optimization
# Clone repository
git clone https://github.com/yourusername/beamng-blender-addon.git
cd beamng-blender-addon
# Run installation script
chmod +x quick_install.sh
./quick_install.sh- Download or clone this repository
- Copy
beamng_blender_addon/to your Blender addons directory:- macOS:
~/Library/Application Support/Blender/4.x/scripts/addons/ - Windows:
%APPDATA%/Blender Foundation/Blender/4.x/scripts/addons/ - Linux:
~/.config/blender/4.x/scripts/addons/
- macOS:
- Open Blender > Edit > Preferences > Add-ons
- Search for "BeamNG" and enable the addon
-
Access Import Dialog
- Go to
File → Import → BeamNG Level (.ter, .prefab) - Browse to your BeamNG level directory (contains
.terand.terrain.jsonfiles)
- Go to
-
Configure Import Options
- ✅ Import Terrain - Import heightmap and materials
- ✅ Import Objects - Import prefab objects (placeholder)
- ✅ Import Materials - Create terrain materials
- ✅ Import DecalRoads - Import road networks
-
Click Import
- The addon automatically detects terrain parameters and applies coordinate correction
BeamNG_Terrainobject with geometry nodes modifierBeamNG_Terrain_Displacement.exr- 16-bit heightmap textureBeamNG_Terrain_Layermap.exr- Material assignment texture (if available)- DecalRoad curves with proper materials and geometry nodes
- Automatic coordinate correction (Y-axis flip applied during import)
-
Texture Painting Workflow
Switch to Shading workspace → Select BeamNG_Terrain object → Open Shader Editor → Select displacement texture node → Switch to Texture Paint workspace → Paint directly on the EXR texture -
Advanced Editing
- Sculpting: Use Blender's sculpt tools on the subdivided mesh
- Modifiers: Add noise, displacement, or other modifiers
- Material Painting: Edit the layermap texture to change terrain materials
- Geometry Nodes: Modify the terrain node group for advanced effects
-
Real-time Preview
- Changes to EXR textures update automatically in the viewport
- Use Material Preview or Rendered viewport shading for best results
-
Access Export Dialog
- Go to
File → Export → BeamNG Level - Choose destination directory for your custom level
- Go to
-
Configure Export Options
- ✅ Export Terrain - Generate
.terand.terrain.jsonfiles - ✅ Export Objects - Export prefab objects (placeholder)
- ✅ Export Materials - Export material definitions
- ✅ Export Config - Generate level configuration files
- Level Name: Set name for your exported level
- ✅ Export Terrain - Generate
-
Click Export
- Creates complete BeamNG level directory structure
- Generates properly formatted
.terfile with material data - No coordinate transformation needed (already corrected during import)
-
Install Your Level
Copy exported level folder to: BeamNG.drive/mods/unpacked/levels/[your_level_name]/ -
Launch BeamNG
- Start BeamNG.drive
- Go to Levels menu
- Select your custom level
- Terrain should appear identical to your Blender edits
graph LR
A[BeamNG Level] --> B[Import to Blender]
B --> C[Y-axis Flip Applied]
C --> D[Edit in Blender]
D --> E[Export from Blender]
E --> F[Back to BeamNG]
F --> G[Perfect Coordinate Match]
Key Benefits:
- Non-destructive: Original data preserved in 16-bit EXR textures
- Coordinate consistency: Automatic handling of coordinate system differences
- Live preview: Real-time feedback during editing
- Complete pipeline: Import → Edit → Export → Test
- Blender 4.0+ (tested with 4.3)
- Python 3.9+ with NumPy
- BeamNG.drive (for test data)
.ter- Binary terrain heightmaps (with corrected parser).terrain.json- Terrain configuration metadata- Level Detection -
info.json,mainLevel.lua
.prefab- TorqueScript object definitions.dds- DirectDraw Surface textures.json- Various configuration files.dae- Collada mesh files
- Binary Parsing - Read
.terfiles using corrected format (offset 0x05, little-endian) - Coordinate Transformation - Apply Y-axis flip to convert BeamNG bottom-left origin to Blender top-left
- 16-bit EXR Creation - Generate high-precision displacement and layermap textures
- Geometry Nodes Setup - Create advanced node-based terrain system with real-time preview
- Material Assignment - Set up PBR materials with proper displacement and texture nodes
- Texture Extraction - Read EXR textures from Blender scene (displacement + layermap)
- Data Conversion - Convert float textures back to 16-bit heightmaps and 8-bit material maps
- Binary Writing - Generate BeamNG-compatible
.terfiles with material data - Configuration Export - Create
.terrain.jsonwith proper metadata and material lists
- BeamNG: Bottom-left origin, Y-axis increases south→north
- Blender: Top-left origin, Y-axis increases top→bottom
- Solution: Single Y-axis flip during import, no transformation needed during export
- Result: Perfect coordinate consistency in round-trip workflow
- Geometry Nodes: Real-time viewport updates with efficient subdivision
- 16-bit Precision: No quality loss during import/export cycle
- Memory Efficient: EXR textures packed in Blender, minimal memory overhead
- Viewport Performance: Adaptive subdivision based on view distance
# Default BeamNG installation (Steam)
Windows: "Program Files (x86)/Steam/steamapps/common/BeamNG.drive/content/levels/levels/"
macOS: "/Volumes/Goodboy/crossover/Steam/drive_c/Program Files (x86)/Steam/steamapps/common/BeamNG.drive/content/levels/levels/"
# Recommended levels for testing:
- small_island # 1024x1024 island with varied terrain
- gridmap_v2 # Flat grid, good for coordinate testing
- automation # Complex multi-biome terrain
- hirochi_raceway # Road-heavy level for DecalRoad testing-
Import Test
- Navigate to a level directory (e.g.,
small_island/) - Import using
File → Import → BeamNG Level - Verify terrain shape, roads, and coordinate alignment
- Navigate to a level directory (e.g.,
-
Edit Test
- Switch to Texture Paint workspace
- Make visible changes to the displacement texture
- Verify real-time preview updates
-
Export Test
- Export using
File → Export → BeamNG Level - Set level name (e.g., "test_level")
- Check generated
.terand.terrain.jsonfiles
- Export using
-
Game Test
- Copy exported level to BeamNG mods directory
- Launch BeamNG and select your custom level
- Verify terrain appears identical to Blender version
- Test coordinate consistency (features in same positions)
Current Status: Core Functionality Complete
- ✅ Complete Terrain Pipeline: Import/export with coordinate correction
- ✅ 16-bit EXR Workflow: Non-destructive terrain editing
- ✅ DecalRoad Support: Road networks with materials and geometry nodes
- ✅ Geometry Nodes Integration: Advanced node-based terrain system
- ✅ Material System: Automated PBR material setup
- ✅ Level Detection: Smart BeamNG level directory parsing
Next Development Priorities:
- 🔄 Static Objects Export: Export prefab objects from Blender
- 🔄 Advanced Materials: Multi-layer terrain texture blending
- 🔄 Optimization: Performance improvements for large terrains
See BeamNG_Blender_Task_Breakdown.md for detailed progress.
- Static Object Export: Not yet implemented (prefab objects)
- Multi-layer Materials: Advanced terrain blending not available
- Large Terrain Performance: Very high subdivision levels may cause lag
"No BeamNG terrain object found in scene"
- Ensure you have a
BeamNG_Terrainobject in your scene - Check that the object hasn't been renamed or deleted
- Try re-importing the level if the terrain object is missing
"Could not extract displacement data from terrain object"
- Verify the terrain object has geometry nodes modifier
- Check that displacement texture exists in the node group
- Ensure the texture is named with "displacement" in the name
"Terrain appears flipped or rotated in BeamNG"
- This should not occur with the current version (coordinate correction applied)
- If it does occur, please report as a bug with your test level details
"Exported terrain is all flat"
- Check that the displacement texture has visible height variations
- Verify the texture is properly connected in the geometry nodes
- Ensure you're not painting on a copy of the texture
"Export dialog not appearing"
- Ensure the addon is properly enabled in Blender preferences
- Try reloading the addon using the hot-reload script (see Development section)
- Check the Blender console for error messages
When developing or debugging the addon, you can hot-reload it without restarting Blender:
- Open Blender's Scripting Workspace
- Paste this code snippet into the text editor:
def reload_addon(module_name='beamng_blender_addon'):
import sys
modules_to_remove = [name for name in sys.modules.keys() if name.startswith(module_name)]
for module_name in modules_to_remove:
del sys.modules[module_name]
# Now disable and re-enable
import addon_utils
addon_utils.disable(module_name)
addon_utils.enable(module_name)
reload_addon()- Run the script - This will completely reload the addon with your latest changes
- Alternative: You can also run this one-liner in the Python console:
exec("import sys; [sys.modules.pop(k) for k in [k for k in sys.modules.keys() if k.startswith('beamng_blender_addon')]]; import addon_utils; addon_utils.disable('beamng_blender_addon'); addon_utils.enable('beamng_blender_addon')")
This method cleans the Python module cache and forces a complete reload, which is more reliable than the standard disable/enable approach for complex multi-module addons.
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push branch (
git push origin feature/amazing-feature) - Open Pull Request
This project is licensed under Unlicense - see LICENSE for details.
- BeamNG GmbH for the amazing BeamNG.drive simulation
- Blender Foundation for the powerful 3D creation suite
- Community contributors and testers
For issues or questions, please open a GitHub issue.
