Environment LOD Tools are a collection of plugins for Blender (v. 4.2.0 and above). The plugins are designed to help with the creation of environment levels of detail (LODs) for terrestrial photogrammetry models. (Models of Landscapes, Cities, and other "flat" structures).
The tools are split into several single plugins, that can be used independently of each other. There is also a combined plugin that can load a model from the file system and generate LODs for it, without actively rendering it to the viewport. This is essential for source files that are too massive to display in the viewport.
Blender Plugins are available for Windows, Linux and Mac (experimental).
Note
For Windows there is also a self-contained, zero-config GUI application available.
-
Cleanup: Cleans/Preprocesses the mesh for use in the LOD pipeline. All mesh operations are done using the BMesh framework to ensure performance. Pyfqmr is used for mesh reduction.
-
Mesh Slicer: Cuts a mesh into a user-defined amount of square slices. (This reimplements Blenders Bisect logic in a way that does not require to duplicate the mesh in order to keep both half's)
-
LOD Pipeline: Generates the levels of detail (LODs) for all the selections using pyfqmr again. The LOD generation retains the borders of the highest LOD for flawless LOD transitions of individual modules.
-
XAtlas Unwrapper: Unwraps the model using the xatlas-python bindings. Utilizes multiprocessing to speed up the unwrapping of multiple meshes significantly.
-
Baker: Transfers the base color of a defined mesh onto one or multiple selected meshes. Blender is used as the baking framework.
EnvironmentLodTools can also be used with a "standalone" PySide6 based GUI. It exposes the exact same parameters, but uses a small C++ Launcher targeting an embedded Python install, with Blender as a module.
To use the GUI do the following:
- Download the
enviro_gui[...].zipfrom the latest release. - Run the contained .exe file.
To install the plugins, follow these steps:
- Download the latest release from GitHub.
- In Blender, go to
Edit->Preferences->Add-onsand click on theInstall from lokal diskhidden in the submenu on the top right. - Select the .zip file from the download folder.
- Enable the plugins by checking the plugins checkbox.
- Once installed, the plugins can be accessed through the
ToolandToolspanel.
- Run
build.shusing a applicable shell (i.e. GitShell, MinGW64, MSYS2, etc...)
Note
build.sh takes two additional optional arguments:
--blender (which lets you define the fielpath to the blender installation to use for plugin building.)
--python-version (which lets you define the python version for building. i.e.: 3.11.9)
-
Download the correct wheels pyfqmr and xatlas for your correct platform and python version an place them in
.plugin_src/wheels -
Add the path(s) to the wheels to the blender manifest at
.plugin_src/blender_manifest.toml -
Ensure you have Blender installed.
-
Build the Plugin using Blenders build command:
blender --command extension build
See also: Blender Docs
-
Ensure the plugins name has the correct naming depending on your target platform:
- Win:
windows_x64.zip - OSX:
macos_arm64.zip - Linux:
linux_x64.zip
- Win:
-
Download the desired embeddable python package.
-
Unpack it to
.python_embed/, unless you change the path in thelauncher.cpp. -
Enable Site Support by either using Powershell or Bash. Do this by running one of the following commands inside the directory where there embedded python exectuable lives.
-Command "(Get-Content python*._pth) -replace '^#import site', 'import site' | Set-Content python*._pth"
or
sed -i 's/^#import site/import site/' python*._pth
-
Install pip into the embeddable Python:
- Download get-pip.py from here.
- Navigate to the directory the embeddable
python.exeis located, place the downloaded file here and run:python.exe get-pip.py
-
Using the embeddable Python Pip install the Blender as a module and PySide
python.exe -m pip install bpy python.exe -m pip install PySide6
-
Build the launcher using CMake (We are using MinGW, but you can use any Compiler you please):
cmake -G "MinGW Makefiles" .. cmake --build . -
Ensure the folder structure looks as follows:
π root βββ π launcher.exe βββ π enviro_tools_gui.py βββ π styles.qss (optional) βββ π blender_plugin_windows_x64.zip βββ π python_embed/ β βββ π ... βββ π plugin_src/ βββ π ...
This behavior occurs because, in Python, two event loops cannot run concurrently in the same thread. This limitation stems from the environment in which the application is currently executed. I plan to address this in a future update by running the two event loops of PySide and Blender-as-a-module in separate threads and connecting them via IPC. Do not worry though, even if the GUI freezes, the processing will still take place.
Contributions are welcome! If you find any bugs or have suggestions for improvements, please open an issue or submit a pull request.
The code is licensed under the GPLv3 License.
This project was originally created by Nico Breycha (High Vision) for the Deine Stadt project.
3rd party libraries used in this project are licensed under their own licenses.
-
xatlas-python bindings, licensed under the MIT License.
-
pyfqmr, licensed under the MIT License
- (Original Fast-Quadric-Mesh-Simplification implementation by sp4cerat)
-
Blender, licensed under the GPLv2 License
-
Pyside6, licensed under the LGPLv3/GPLv3
As of June 2025 I no longer support Blender Versions 4.1 and below. The latest release for these versions can be found here.