Installing Blendyn - zanoni-mbdyn/blendyn GitHub Wiki
Blendyn has been ported to Blender >=2.80.
Blendyn is currently still compatible with Blender
versions from 2.50 to 2.79, through the code in the branch blendyn27
.
Be careful though, that only occasional bugfixes will be applied in that branch,
as the main development will be carried out in the devel
and master
branches.
The basic installation of the add-on is very simple. Download the repository as a
.zip
file using the Download ZIP button at the top right of the repository
main page, under the Code menu.
NOTE: please check that the current active branch is "master": that is the one you want to download, unless you are an MBDyn developer or, in general, have access to the bleeding edge MBDyn's source code.
In Blender, go to
Edit
-> Preferences
-> Add-ons
-> Install
and locate the .zip
file that you have downloaded. The add-on will be shown
under the Physics
category. You will have to activate it in the usual way,
by clicking on the checkbox on the right.
If, upon the activation of the add-on, complaints that the
numpy
package is not installed, please follow the instructions below to installpip
, if it is not already present in your system, and then installnumpy
with
# pip install numpy
or
# pip3 install numpy
Additionally, for some elements (like beams, for example) to be
visualized correctly, you need to activate the Auto Run Python Scripts
option in the Save & Load
tab of the Blender User Preferences,
as shown in the picture below.
A few optional Python packages are needed to enable some additional features in Blendyn:
- the
netcdf4
package is needed to import MBDyn results in NetCDF format - the
pygal
andcairosvg
packages are needed to enable the plotting of MBDyn output from the Blender UI - the
psutil
package is needed to enable running MBDyn from the Blender UI
Blendyn depends also on numpy
, which should be bundled in recent
Blender versions, but may be missing on some platforms.
In the current version, Blendyn is equipped with an automatic system to check for the
presence of the packages required by the additional features, and install them. The panel
is accessed through the Blendyn addon section in the Edit
-> Preferences
-> Add-ons
Blender menu.
Below the Blendyn info, a Preferences
section, dedicated to optional features, is
displayed:
if the packages required by an additional feature are missing, an Install dependencies
button is displayed at the end of the related block. Clicking on it will result in Blendyn
checking for and, if needed, installing pip
and using it to install the required packages. The latter will be installed in the
modules
folder aside of Blender user addons folder (e.g., for GNU/Linux systems,
/home/user/.config/blender/v.vv/scripts/addons/modules
, where v.vv
is the installed
Blender version).
If the packages are found, the Install dependencies
button is hidden and a checkmark
appears next to the Python packages names.
WARNING: after installing and additional dependency, you should restart Blender to enable Blendyn to recognise and load it.
NOTE 1: Using MBDyn NetCDF output with Blendyn is highly recommended.
The following guide2 will provide help in the installation of both MBDyn and Blendyn in Windows 10/11 operating system, using the Windows Subsystem for Linux feature. It assumes that WSL is installed, so please refer to the linked page on the Microsoft documentation to get started from scratch. This guide also assumes that the distribution installed in the WSL is Ubuntu, but keep in mind that other are available, including some (albeit not officially supported by Microsoft) based on Arch (for example this). If you choose one of the latter, you can directly head over to the Linux installation guide.
The part related to the MBDyn installation can be used also as a reference for a Blendyn-friendly MBDyn installation in Ubuntu (and most of Debian and Ubuntu based distributions).
Open WSL and install the required (first apt install
line) and additional
(second apt install
line) packages for MBDyn:
$ sudo apt update
$ sudo apt install autoconf libtool make gcc g++ gfortran
$ sudo apt install liblapack-dev libnetcdf-dev [ libnetcdf-cxx-legacy-dev | libnetcdf-c++4-dev ]
meaning that you can either install libnetcdf-cxx-legacy-dev
or libnetcdf-c++4-dev
, as
MBDyn supports both. The latter is actually to be preferred.
Optional but recommended, to be able to perform eigenanalyses, load runtime module and enable some additional linear solvers (refer to the Linux installation guide for details):
$ sudo apt install libltdl-dev libsuitesparse-dev liblapack-dev libarpack2-dev
Download MBDyn, ore clone it from the Gitlab repository (install git if needed before cloning)
$ git clone https://public.gitlab.polimi.it/DAER/mbdyn.git
$ cd mbdyn/
Generate the configure scripts:
$ sh bootstrap.sh
You are now ready to configure, build, and install the MBDyn package:
$ LDFLAGS="-rdynamic -lsuitesparseconfig" \
CPPFLAGS="-I/usr/local/include/suitesparse" \
./configure \
--prefix=/usr/local \
--enable-netcdf=yes \
--with-umfpack=yes \
--with-lapack=yes \
--with-arpack=yes \
--with-module="hid hfelem" \
--enable-runtime-loading
$ make -j4
$ sudo make install
the choice of changing the prefix to /usr/local
is arbitrary: one can choose
to keep the default prefix /usr/local/mbdyn
and add the /usr/local/mbdyn/bin
directory to the systems' PATH
environment variable (look
here, for example,
for more information).
Also the choice of building the hid
and hfelem
modules it is just an
example: you can choose which ones are of interest for you, or just remove
the --with-module=""
switch entirely if you do not wish to build any of them.
Head over to the Blender website and download the most recent release.
Download the .zip
from this repo and install the addon following the
instructions at the top of this page.
1: Thanks to Stefano Francesco Pitton for the tip.
2: The original version of this guide was kindly sponsored by Jacopo Surra.