An import plugin specialized for .xyz files of molecules used in, for example, quantum chemistry
- imports using linked objects making rapid changes to the aesthetics feasible
- basic styling (stick model, VDW, ball and stick, wireframe) and sensible defaults
- support for animations (input as multiframe .xyz files) including dynamically drawing bonds
- find and fill in aromatic rings
- draw spheres sitting on atoms to represent atomic charges and dynamically scale them during an animation
- draw molecular orbital and density isosurfaces with .cube files or .molden files
The easiest way to install Molecular Blender in Blender is using the pre-built addon zip:
- Download
molecular_blender.zipfrom the GitHub Releases page - In Blender: Edit → Preferences → Add-ons → Install
- Select the downloaded zip file (do not extract it!)
- Enable the "Molecular Blender" addon
The zip includes pre-compiled Cython extensions for all platforms (Linux, macOS, Windows). Blender automatically uses the correct ones for your system.
If you want to use molecular_blender as a Python package outside of Blender, or contribute to development:
Install from PyPI (once published):
pip install molecular_blenderOr download wheels from GitHub Releases:
pip install molecular_blender-*.whlThere are two basic ways to install Molecular Blender from source, depending on whether you want to use the optional cython enhanced isosurface routines (highly recommended, if you're drawing isosurfaces at all).
The most robust way to install from source is to use the included setup.py.
To create a Blender-ready zip file:
cd /path/to/molecular/blender/repo
python3 setup.py build
python3 setup.py exportThis creates a zip file that can be installed directly in Blender (Edit → Preferences → Add-ons → Install).
To install directly to Blender's addon directory:
python3 setup.py build
python3 setup.py install # or use --mode=link for a symlinkThis will build the Cython extensions and install/link to all Blender versions found in the standard directories (tested on macOS).
Requirements:
- Python version matching your Blender version (3.9 for Blender 3.0-3.1, 3.10 for 3.2-3.6, 3.11 for 4.0-4.1, 3.12 for 4.2+)
- Cython installed:
pip install cython - NumPy installed:
pip install numpy - C++ compiler (gcc, clang, or MSVC)
If you are okay with skipping Cython compilation, you can directly symlink from the python package to the Blender scripts directory. Note: The non-cython version is roughly 100x slower at drawing orbitals from molden files, so this is not recommended if you're using isosurfaces.
ln -s /path/to/molecular/blender/repo/molecular_blender /path/to/blender/scripts/addons/On macOS, the user addon path is:
/Users/<username>/Library/Application Support/Blender/<version>/scripts/addons
On Linux:
~/.config/blender/<version>/scripts/addons
On Windows:
%APPDATA%\Blender Foundation\Blender\<version>\scripts\addons
After symlinking, activate the addon in Blender's preferences.
To draw isosurfaces, you need either a cube file or a molden file. If using a molden file, you also need to specify which orbital or density you want to draw. In the orbital selection box, you can specify a comma separated list of orbitals to draw. molecular_blender also understands the keywords homo, lumo, and density, and they can be combined with additional math. For example:
homo - 1would compute the second highest occupied molecular orbitallumo + 2would compute the third highest unoccupied molecular orbital4would compute the 4th molecular orbitaldensitywould compute the density
The standard development workflow for working on the addon:
python setup.py build # Build Cython extensions
python setup.py install # Install to Blender (or --mode=link for symlink)
python setup.py export # Export Blender-ready addon zipThis creates a zip file that can be distributed to Blender users or uploaded to GitHub releases.