Closed ForceFaction closed 5 years ago
I just tried on my computer (mac, blender 2.79) and it worked without issue.
Most errors I see with using this library aren't with the blender version, but with the openbabel dependency. Did you follow the recommended guide of installing the binary with conda?
I am having a similar issue viewing xyz or pdb or Gaussian input files, the atoms are in an incorrect orientation and the bonds drawn at the wrong place.
`Package Version
ase 3.16.2 blender-chemicals 0.2.1 certifi 2019.6.16 Click 7.0 cycler 0.10.0 Cython 0.29.12 Flask 1.1.1 itsdangerous 1.1.0 Jinja2 2.10.1 kiwisolver 1.1.0 MarkupSafe 1.1.1 matplotlib 3.1.0 mkl-fft 1.0.12 mkl-random 1.0.2 numpy 1.16.4 pip 19.1.1 pyparsing 2.4.0 python-dateutil 2.8.0 pytz 2019.1 scipy 1.2.1 setuptools 41.0.1 six 1.12.0 tornado 6.0.3 Werkzeug 0.15.4 wheel 0.33.4`
Just to supply my input, below is the input .cif file that I am trying to get into blender, I can visualize the structure in IQmol. Also, this is a fantastic tool!
data_image0 _cell_length_a 19.1412 _cell_length_b 16.5034 _cell_length_c 15.9369 _cell_angle_alpha 90 _cell_angle_beta 90 _cell_angle_gamma 90
_symmetry_space_group_name_H-M "P 1" _symmetry_int_tables_number 1
loop_ _symmetry_equiv_pos_as_xyz 'x, y, z'
loop_ _atom_site_label _atom_site_occupancy _atom_site_fract_x _atom_site_fract_y _atom_site_fract_z _atom_site_thermal_displace_type _atom_site_B_iso_or_equiv _atom_site_type_symbol C1 1.0000 0.64305 0.61271 0.52180 Biso 1.000 C C2 1.0000 0.62264 0.36281 0.54262 Biso 1.000 C C3 1.0000 0.43169 0.44340 0.51179 Biso 1.000 C C4 1.0000 0.41994 0.54131 0.40416 Biso 1.000 C C5 1.0000 0.35954 0.44214 0.52330 Biso 1.000 C C6 1.0000 0.34803 0.54119 0.41257 Biso 1.000 C C7 1.0000 0.56401 0.45396 0.62713 Biso 1.000 C C8 1.0000 0.31744 0.49135 0.47344 Biso 1.000 C C9 1.0000 0.69301 0.54833 0.49514 Biso 1.000 C C10 1.0000 0.55835 0.54277 0.61650 Biso 1.000 C C11 1.0000 0.67726 0.40930 0.49050 Biso 1.000 C C12 1.0000 0.48004 0.38763 0.55767 Biso 1.000 C C13 1.0000 0.68094 0.49704 0.36216 Biso 1.000 C C14 1.0000 0.52056 0.64990 0.51842 Biso 1.000 C Fe1 1.0000 0.56092 0.49126 0.44334 Biso 1.000 Fe H1 1.0000 0.73465 0.48225 0.35156 Biso 1.000 H H2 1.0000 0.64849 0.45749 0.32594 Biso 1.000 H H3 1.0000 0.71805 0.57108 0.55036 Biso 1.000 H H4 1.0000 0.73878 0.57523 0.46523 Biso 1.000 H H5 1.0000 0.69137 0.37414 0.43670 Biso 1.000 H H6 1.0000 0.72267 0.42013 0.52802 Biso 1.000 H H7 1.0000 0.64196 0.35625 0.60695 Biso 1.000 H H8 1.0000 0.58357 0.42861 0.32630 Biso 1.000 H H9 1.0000 0.61356 0.30297 0.51597 Biso 1.000 H H10 1.0000 0.55620 0.34783 0.37928 Biso 1.000 H H11 1.0000 0.67161 0.55846 0.34379 Biso 1.000 H H12 1.0000 0.52568 0.67247 0.45446 Biso 1.000 H H13 1.0000 0.51035 0.43487 0.64023 Biso 1.000 H H14 1.0000 0.46720 0.63130 0.53187 Biso 1.000 H H15 1.0000 0.44701 0.57920 0.35919 Biso 1.000 H H16 1.0000 0.33750 0.40241 0.57054 Biso 1.000 H H17 1.0000 0.31691 0.57987 0.37236 Biso 1.000 H H18 1.0000 0.26122 0.49086 0.48181 Biso 1.000 H H19 1.0000 0.53619 0.69703 0.56300 Biso 1.000 H H20 1.0000 0.65795 0.64141 0.58095 Biso 1.000 H H21 1.0000 0.64126 0.65910 0.47277 Biso 1.000 H H22 1.0000 0.55543 0.61540 0.37487 Biso 1.000 H H23 1.0000 0.47232 0.32663 0.53239 Biso 1.000 H H24 1.0000 0.46751 0.38576 0.62461 Biso 1.000 H H25 1.0000 0.50228 0.54333 0.62878 Biso 1.000 H H26 1.0000 0.58382 0.58176 0.66278 Biso 1.000 H H27 1.0000 0.59184 0.46241 0.68626 Biso 1.000 H H28 1.0000 0.53181 0.54621 0.31374 Biso 1.000 H N1 1.0000 0.55568 0.40956 0.54542 Biso 1.000 N N2 1.0000 0.46033 0.49329 0.45353 Biso 1.000 N N3 1.0000 0.66456 0.48732 0.45171 Biso 1.000 N N4 1.0000 0.56952 0.58015 0.53107 Biso 1.000 N O1 1.0000 0.55724 0.40552 0.37165 Biso 1.000 O O2 1.0000 0.56544 0.56155 0.35551 Biso 1.000 O
@craigerboi Thanks!
I don't see openbabel in your package list. As I said above, most issues I see are related to open babel. You can test by opening a python terminal and loading the molecule into open babel. If this works, you're good. If not, you'll have to either install it via conda (recommended) or retry the compilation with the right links.
Here's a test:
▶ python
Python 3.7.3 (default, Mar 27 2019, 16:54:48)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
>>> import pybel
>>> mol = pybel.readstring('smi', 'c1ccccc1')
>>> print(mol)
c1ccccc1
@patrickfuller You are absolutely right, thanks!
I had been forgetting to use the isolated environment with packages as above, and had installed openbabel in the regular site-packages directory and was crossing between the two when attempting to use blender-chemicals.
I compiled it myself, but had to use another solution nonetheless :)
Hi,
i just wanted to try out your script with blender 2.80 on a Linux machine. The benzene example just creates a cylinder and a sphere in the middle of the viewport and nothing else.
Maybe something changed in the last 2 years, which version did you use?
Or do you have another idea?
forcefaction