Install BlenderNC¶
Note
BlenderNC is supported by versions of Blender > 2.8.
Setting up the Blender Python environment¶
BlenderNC requires the following python modules to be installed in Blender’s Python environment:
numpy
zarr
ecmwflibs
cfgrib
xarray[complete]
cmocean
colorcet
matplotlib
dask
scipy
netCDF4
toolz
pooch
psutil
To install the previous python modules in your Blender distribution execute the following commands depending on your OS:
macOS¶
BLENDERPY=/Applications/Blender.app/Contents/Resources/2.XX/python/bin/python3.7m
$BLENDERPY -m ensurepip
$BLENDERPY -m pip install -r requirements.txt
Linux¶
BLENDERPY=/path/to/blender/2.83/python/bin/python3.7m
$BLENDERPY -m ensurepip
$BLENDERPY -m pip install -r requirements.txt
Windows¶
set BLENDERPY=/path/to/blender/2.82/python/bin/python.exe
%BLENDERPY%-m ensurepip
%BLENDERPY% -m pip install -r requirements.txt
or install the following requirements using:
$BLENDERPY -m pip install numpy cython zarr ecmwflibs cfgrib xarray cmocean matplotlib colorcet dask dask scipy netCDF4 toolz pooch psutil
Another, but not recommended option is to symbolically link your python modules to blender, first find the folder modules within the blender.app:
macOS:
cd /Applications/Blender.app/Contents/Resources/2.9{X}/scripts/modules
- Linux and Windows:
Go to the directory where Blender is installed and look for the
modules
folder
Then link all the packages from your python environment folder:
ln -s $PATH_PYTHON/lib/python3.6/site-packages/* .
Install Addon¶
The addon is installed just like any other Blender addon:
Get a BlenderNC installable zip:
(Recommended) Download the pre-generated zip from the GitHub, or download the current version zip (do not unzip it!).
Note
Under macOS - Safari downloading a .zip file will by default unzip it. You can fix this by:
Right-click link and select “Download Linked File As …”,
Manually zip the blendernc folder, or
change Safari preferences:
Manually zip the blendernc folder.
Change Safari preferences:
Open Safari
Click Preferences
Under the General tab, uncheck the option Open “safe” files after downloading
Clone BlenderNC and zip compress only the blendernc folder within the repository (i.e.
blendernc/blendernc
). Use your generatedblendernc.zip
in the following steps.
In Blender go to the user preferences and open the Addons tab.
Once there, click Install add-on from file (bottom right corner)
Navigate to the downloaded zip, select it, and click in install.
Finally, check the box next to the BlenderNC addon, to enable it.
Now you can follow the tutorials to import datacubes in Blender.
Optionally, but not recommended, you can link or copy the blendernc folder within the repository (i.e. blendernc/blendernc
) to your preferred blender add-on path. You can get the exact path by running within a Blender Console:
bpy.utils.user_resource("SCRIPTS", path="addons")
output example on:
macOS:
'/Users/{username}/Library/Application\ Support/Blender/2.9{X}/scripts/addons'
Linux:
'/usr/share/blender/2.9{X}/scripts/addons'
Windows 10:
'%USERPROFILE%\AppData\Roaming\Blender Foundation\Blender\2.9{X}\scripts\addons'
make sure you replace everything within the {}.
Update BlenderNC¶
A blender addon autoupdater has been implemented, for more information refer to blender-addon-updater. In order to update the BlenderNC:
Navegate to the user preferences and open the Addons tab.
Search for BlenderNC.
Click in Check for new blendernc update.
Optionally, you can set BlenderNC to check automatically for updates.
After checking for updates, select the branch you will like to install or release.
Important
The master branch contains the most recent bug fix (recommended).
The release mark milestones in the development, you can revert to them by selecting any release x.x.x. The latest release will point closely to master.
The dev branch is experimental and constantly changing, recommended if you are developing BlenderNC.
Optionally, you can do this process manually by uninstall the old version first. Thein install the new version of BlenderNC.
Note
You can just reinstall blendernc if you have enabled the Overwrite
option in Blender (enabled by default). Then automatically the new addon zip will replace the old version.
Restart Blender once the new version is installed.
Blender Compilation (optional)¶
Alternatively, to further configure Blender, you could install it using a conda environment by following the official Blender installation website.
Create conda environment:
conda create --prefix ~/path/to/python/root python=3.7
conda activate ~/path/to/python/root
conda install --file ./requirements.txt
Compile Blender:
cmake -DPYTHON_VERSION=3.7 -DPYTHON_ROOT_DIR=~/path/to/python/root ../blender
Note
Make sure to use the same python version.