johschmitz/blender-driving-scenario-creator
Blender add-on for creating OpenDRIVE and OpenSCENARIO based automotive driving scenarios including 3D models
Blender Driving Scenario Creator – an add‑on for building autonomous‑driving test scenes
What it does – The add‑on turns Blender into a visual editor for OpenDRIVE road networks and OpenSCENARIO traffic scenarios. You can draw roads, junctions, signs, parking spots, and place vehicles or pedestrians directly in the 3D view, then export the whole scene as a set of files (.xodr, .xosc) that can be run in a driving‑simulator such as esmini.
Why it matters – OpenDRIVE/OpenSCENARIO are the de‑facto standards for describing road geometry and dynamic traffic behavior in autonomous‑vehicle development. By providing a GUI‑based workflow inside a popular 3D tool, the add‑on lowers the barrier for creating realistic test scenarios without hand‑coding XML.
Key capabilities
| Feature | How it works |
|---|---|
| Road network authoring | Click‑and‑drag to place road start/end points, add geometry sections (clothoid, NURBS, polyline), adjust headings, elevation, and snap to the grid or existing lanes. |
| Junction creation | Build 4‑way junctions and connect roads while automatically snapping to matching lane types (driving, walking, biking). |
| Road objects | Place traffic signs, lights, stop lines, and stencils; the add‑on ships public‑domain German sign textures. |
| Entity placement | Insert cars or pedestrians, assign them to trajectories, and edit their properties via pop‑ups. |
| Trajectory editing | Draw polyline, NURBS, or clothoid‑spline paths; modify heading, elevation, and segment direction with mouse/keyboard shortcuts. |
| OpenSCENARIO action graph | A custom node editor lets you compose actions (speed changes, lane changes, distance triggers, user‑defined commands) and logical triggers (AND/OR, time‑based, scenario stop). |
| Export formats | Export the complete scenario as OpenDRIVE/OpenSCENARIO plus optional 3D assets (.fbx, .gltf, .osgb). |
| In‑Blender preview | Integrated esmini preview runs the scenario head‑less and streams entity transforms back into Blender for quick visual checks. |
Installation outline (platform‑agnostic steps)
- Install dependencies –
scenariogeneration(Python library that writes.xodr/.xosc) andpyclothoidsare required. They must be installed into Blender’s bundled Python interpreter (pip install scenariogeneration). - OpenSceneGraph – Needed for exporting
.osgbfiles; install via the system package manager (Linuxapt install openscenegraph, macOSbrew install open-scene-graph, Windows download and addosgconvtoPATH). - Add‑on zip – Download the latest release zip from the GitHub releases page and install it through Edit → Preferences → Add‑ons → Install… inside Blender.
- esmini library – Install the esmini simulator and point the add‑on’s esmini library path setting to the shared library (
esminiLib/libesminiLib).
Typical workflow
- Set up the viewport – Increase clipping range (
Clip Start = 1 m,Clip End = 10000 m) and switch shading to Texture to see road‑sign graphics. - Create the road network – Use the mouse and the shortcuts listed in the README (e.g.,
Shift+MouseLeftfor extra geometry sections,Altto adjust heading,E/Sfor elevation). Build junctions and connect lanes as needed. - Add objects & entities – Place signs, traffic lights, parking spots, then drop vehicles or pedestrians onto the lanes.
- Define trajectories – Select an entity and draw its path; optionally chain actions in the node editor (speed, lane change, triggers).
- Export – Click Export driving scenario, choose a folder and a 3D asset format. The exporter writes the OpenDRIVE road file, the OpenSCENARIO scenario file, and any selected 3D meshes.
- Run / preview – Either launch esmini from the command line (
esmini --osc xosc/bdsc_export.xosc …) or use the built‑in preview button to see the motion inside Blender.
Development & testing
- Hot‑reloading – The recommended workflow uses the Blender VS Code extension for rapid iteration.
- Tests – Geometry tests are provided under
tests/and can be run withpytestfrom Blender’s Python interpreter. - Asset generation – SVG road‑signs are rasterised with
librsvgandImageMagickduring the build process.
License & contribution
The code is released under GPL‑3.0, the standard license for Blender add‑ons. Commercial use is permitted as long as the source remains available. Contributions are welcomed via pull requests; the maintainer can be contacted through the repository’s issue tracker or listed contact channels.
Bottom line
The Blender Driving Scenario Creator bridges the gap between 3D modelling and autonomous‑vehicle simulation standards. It lets engineers and researchers prototype realistic road networks and traffic scenarios visually, then feed them directly into simulation pipelines like esmini for validation of ADAS and self‑driving algorithms.
Related
- Project
- Project
- Project
- Project
- Project