Blender

To use COMPAS in Blender it needs to be installed.

conda activate ita21
python -m compas_blender.install "%PROGRAMFILES%\\Blender Foundation\\Blender 2.93\\2.93"

If necessary, modify the installation path to match the path on your system.

What happens behind the screens is that the entire Python installation bundled with Blender is replaced by the one in the active environment. This is extremely convenient because it means that you can make any Python package available in Blender, simply by installing it in the environment.

However, there are some constraints.

The Python version of the environment must match the Python version for which Blender was compiled. This means that for Blender 2.93 LTS you MUST use an environment with Python 3.9, and for Blender 2.83 LTS you MUST use an environment with Python 3.7.

Note that if you install new packages in the environment, you have to restart Blender before this will have an effect.

Running Blender

Blender uses the command window of your system to display error messages and other text output. On Windows, the output window can be brought to the front directly from the “Window” menu in Blender. On macOS or Linux, you should start Blender from the command line.

By adding the Blender executable to the PATH variable this becomes really simple.

echo 'export PATH="/Applications/Blender.app/Contents/MacOS:$PATH"' >> ~/.zshrc
source ~/.zshrc

Starting Blender is then simply

blender

Known Issues

On Windows, Blender sometimes has issues with NumPy. If this is the case, the problem can usually be solved by using an environment in which COMPAS is installed using pip instead of conda. See here for more detailed instructions: Install COMPAS with pip

If you have this problem, it is easier to simply make a new environment than it is to modify the problematic one. In a nutshell (for Blender 2.93)

conda create -n blender python=3.9 cython --yes
conda activate blender
pip install compas
python -m compas_blender.install "%PROGRAMFILES%\\Blender Foundation\\Blender 2.93\\2.93"

Last updated