MacOS
Install Python dependencies
Go to your Blender python directory, e.g. /Applications/Blender.app/Contents/Resources/3.4/python/bin
, install pip:
$ ./python3.10 -m ensurepip
$ ./python3.10 -m pip install --upgrade pip
Install ASE and scikit-image inside Blender:
$ ./pip3 install --upgrade ase
$ ./pip3 install scikit-image
Install batoms
Download the latest version (beautiful-atoms.zip).
Extract the file, move the folder
batoms
to Blender addons folder/Applications/Blender.app/Contents/Resources/3.4/scripts/addons/
.Enable the addon in the Preferences setting. Please open a Blender Python console, and run the following code to enable the batoms:
import addon_utils import bpy addon_utils.enable('batoms', default_set=True) bpy.context.preferences.view.use_translate_new_dataname = False bpy.ops.wm.save_userpref()
Note
Or, you can visit here to learn how to enable an addon by hand. https://docs.blender.org/manual/en/latest/editors/preferences/addons.html. If you can not find the Blender addons folder, please see the directory layout docs. https://docs.blender.org/manual/en/dev/advanced/blender_directory_layout.html#blender-directory-layout
Test your installation
Start Blender, in the python console, run:
>>> from batoms import Batoms
>>> h2o = Batoms('h2o', species = ['O', 'H', 'H'],
... positions= [[0, 0, 0.40], [0, -0.76, -0.2], [0, 0.76, -0.2]])
If you saw a water molecule, you have run a successful installation, congratulations!
Install batoms-api on your computer (Optional)
First install ASE on your computer. Open a terminal, and run:
$ pip3 install --upgrade ase
$ pip3 install batoms-api
Then set a BLENDER_COMMAND
environment variables. One set these permanently in your ~/.bashrc
file:
export BLENDER_COMMAND='<path-to-blender>/blender'