Atomic Blender for loading PDB files into Blender 2.5

Hello, thank you for your work on this, I myself planned to do an importer, since I work for a Chemistry faculty as an animator :slight_smile: So this is a great saving for me, since BioBlender never worked well for simple molecules(don’t know why).

However, I didn’t yet suceed in running the importer, but I hope soon I will get it working.
thanks

EDIT: also, the current version isn’t online, it’s not in the svn tree at all as far as i’ve seen.

Hello pildanovak.

Thank you for your positive comment. I’m sorry that you didn’t succeed to get run the script.

Well, the script comes with Blender 2.61 which is not yet out. However, I already had to prepare the wiki etc. … . So, what you can do is the following: Download the very latest version of Blender and install it. Go to ‘User preferences’ and then to addons. There is a section called ‘Testing’ I think. There you find the latest Atomic Blender script (version 1.0).

I tried a dozen of PDB files from many sources in the Internet and could load all structures. In the case you cannot load yours, please, supply a link to the PDB file. Just post the link here.

Cheers.

EDIT:

  1. Blender 2.61 is out, which means that the addon can be found in: User Preferences -> Addons -> PDB - Atomic Blender <= mark it and go to ‘Save as default’. That’s it.
  2. (old) You can also downlaod this directory ‘io_mesh_pdb’ from here:

https://svn.blender.org/svnroot/bf-extensions/trunk/py/scripts/addons/

Then, put the whole directory into the local directory: …/scripts/startup <= The location of this script depends on the OS you use.
Always when you start Blender, you will find the importer in: menu -> file -> import -> Protein Data Bank (.pdb)

Hi,
nice work. I suspect you may not be aware of BioBlender (www.bioblender.net ) that not only reads pdb files, but builds the molecule with rigid body joints at bonds (using a library), interpolates between different conformations, can upload Normal mode analysis, and calculates the surface. On the surface it can plot lipophilic potential, and can draw the electrostatic potential as lines (particles) moving towards or away from the surface (for negative and positive field lines).
If you are interested in molecular work in Blender, we will be happy to hear from you, and possibly do some work in collaboration

Ooops!!

What’s the problem with BioBlender?, can you give some example of pdb file that doesn’t work?
We are constantly working to make it usable for everyone, and information on any difficulty is important for us
Please let us know !! :slight_smile:

thanks,
Monica

Love this script!

As an animator with a background in biology and teaching, I think this has a great deal of potential.

I have been having some problems with it though and would be grateful for some advice.

Loading PDB files is easy and works well.
What I couldn’t figure out is how to edit materials on the protein structure.
I can see that the structure is divided according to the type of atom, but when I choose one of these groups and add a new material, it is ignored and the original colors are still used.

Is the script somehow enforcing specific materials or something?

Thanks for writing this and I hope you’ll have some info for me :slight_smile:

Hello TheFinalCut.

Thanks for your positive comments. What you have to do is to mark the balls in the outliner (see mouse arrow):


Changing the material properties is then possiblle.

Hello Monica.

Obviously we have developed our PDB readers at the same time! :cool:

Yep, my addon is just an importer, which I have written a year ago for my purposes. I decided to make public the code and … voila here it is. Thanks to the Blender Python developers I could considerably extend and improve the script.

I’ve seen your nice stuff after having submitted and noticed that you put in some simulation tools. For this you clearly need a team.

I’m open minded with respect to a collaboration. I think that your code is written in C/C++, right? Well, I know ANSI C quite a bit but decided once a day to use the convenient Python language, which is much ‘easier’ to deal with. :smiley:

Let me know if there are some possibilities or if you have some ideas.

Cheers.

Works nicely now, thanks!

Had to try the script out. Stupidly, a static image wasn’t good enough for me so I animated a DNA molecule in Cycles, and gave all the atoms a glass shader. Took forever, but here’s the result (with a little bit of compositing added):

Nice, TheFinalCut

EDIT (2012-02-07): It is very nice indeed !

Hi all.

A new version is available (version 1.1).

  1. If desired the sticks can now have same colours as the atoms. The option ‘color’ needs to be checked. See examples here: http://development.root-1.de/Atomic_Blender_PDB_Examples.php

  2. The panel is visually better structured now.

  3. some bugs could be removed

Elegant work.
Having tried various options, I am unable to create a .stl file of the image; either I get a single sphere or no spheres at all.
Also, where will I find the directory (iMac) so that I can redefine atomic colors?
Thanks, EM

Thanks a lot!

  1. The script produces a dupliverts mesh, where its mother object (a real object, a ball) is duplicated at each vertex of the mesh (atom positions of the structure). This means, there will be only one ball for each element of the structure. So, I don’t wonder if you obtain only one ball for each element - the export into .stl or any other format, which asks for a real Blender object for each atom, does not work. I’m sorry.

I don’t know this .stl format, it seems to be binary. To my opinion, the .stl exporter needs some changes. I can discuss it with the Blender developer.

EDIT: I have just discussed the issue (thanks meta-androcto)! So, you can do it.

Do the following: Select the whole structure (molecules, surface, or what ever) with the mouse. Go to objects -> Apply -> Make Dupliverts Real (Shift Control A). You produce real objects! In the outliner delete the remaining dupliverts, named like ‘Carbon’, ‘Hydrogen’, etc. Now you can export this structure into the .stl format. Attention though: you obtain a huge .stl file, and the structure is one mesh! The colours of the atoms get lost. I don’t know why this is but is definitely something related to the stl exporter.

  1. The data file is in the standard Blender directories. Each system (Windows, Mac, Linux) has its own specifications, see here. You need to find the ‘scripts’ directory. In the case of the Mac, you will probably find it here:

System
/Library/Application Support/Blender/2.57/
or User
/Users/{user}/Library/Application Support/Blender/2.57/

Then, go to addons/io_mesh_pdb/ and copy the file ‘atom_info.dat’ to some place on your hard disk. It is an ASCII file which contains the radii of the elements and their colors. You can change the radii and colors in this file and load this file via the Atomic Blender panel: ‘load custom data file’. More info can be found here and here (go to ‘Custom data file’ and read what is written on the right).

If you still have remaining questions just ask.

Blendphys.

Here is a nice movie I prepared with Blender and the Atomic Blender addon:

and here …

First, I want to thank you for this truly great importing tool. It’s made my life a lot easier…and fun!

Second, would you mind sharing how you rendered the above two movies? Is there a tutorial somewhere that I could follow? I recently made an image by importing our data, adjusting it in Blender, and then exporting it to Octane Render. But I’m interested in how to make movies in Blender (as you have done) and also understanding how you create these quality renderings in Blender. Did you use the Cycles engine in Blender? Thanks.

I mean to have seen you here one time … :slight_smile: . Thx kedmond.

Well, I already thought about making a movie … but this will take some time. I have to train … :slight_smile:

However, I can give you some hints which help to prepare a ‘surface scene’ for instance:

  1. Learn the basics of Blender: Go to youtube and search for ‘Blender 2.5 Tutorial’. Well, it takes some time (3 days) to understand the interface of Blender and the basic functions.

  2. If you want to create surfaces, install and use VESTA (better is the stable version) - Since you are a physicist, you know what to do: Choose symmetry group of crystal, type in relative coordinates of atoms (relative to the unit cell), create crystal. In the menu you find ‘Boundary’. With this, you can reproduce the unit cell in x, y and z. Note that with ‘Cutoff planes’ you can very easily cut the crystal so that you can obtain any kind of surface! In this case, save the data rather as xyz, because pdb will not store only the ‘visible’ atoms after having cut the bulk.

  3. In the Atomic Blender script: Go to the mesh and cut atoms out <= This means that you create some defects. See here: Creating some defects (separate and delete). Note that it is advisable to save, under Vesta, each atomic plane of a surface or slab into a separate xyz file. Loading this into Blender and addressing each plane a separate layer gives you much more control of removing or adding atoms.

  4. Then, learn to master the camera. Watch this for instance: camera

  5. Ready is the scene.

DNA in space: Load the DNA, prepare the camera path and that’s it.

I hope that helps … if not, don’t hesitate to ask questions … .

PS: If you have some fancy movies or graphics then, please, post them here. Thanks.

Hi all.

There have been some important improvements, and today, I have committed just another one: version 1.3, revision=3168, should be soon in the last update of Blender …

The wiki has been also updated: wiki

How can I group an entire protein to animate it!? When I parent the atom to an empty every duplicate collapses (or dissapears).

thank you for the script!

Thanks Igolden.

I try to answer your questions as follows: Grouping in general should work, I just tried it some minutes ago. What concerns parenting, it is true that if one selects the whole structure via the mouse, parenting, e.g., to an empty does not work - the whole thing ‘explodes’ and creates something strange. However, if you mark each element in the outliner separately (the dupliverts structure, not the ball or mesh), parenting to an empty works for each element. So, you just have to parent one element after the other one to the empty. And indeed, the elements are within the empty (see outliner and example below).

I hope that I could help. Let me know if you still fail … cheers.

EDIT - Parenting means: Choose element (e.g. hydrogens) in the outliner, mark the empty with the mouse (shift + right mouse button), then control-p, accept parenting => that’s it


Hi all,

I’m trying to make some basic visualizations of small Molecules with Atomic Blender. However I have issues to get the molecules to display the way i woudl like them to. Atoms appear too big and if I make them smaller, the bonds are in relation to thick.

I’m interested how you can achieve the different representations as shown on the examples page. Do I have to adjust the pdb files before import? Or can I change it in blender and if yes how?

Another issue I had is hat when clicking on reload, the old structure is not removed automatically. Maybe this is the desired behavior?