Atomic Blender for loading PDB files into Blender 2.5


(Blendphys) #1

2012-03-13: Note that I’m trying to supply support as soon as possible. Please, in return, show us one of your structures you handle with Atomic Blender by uploading some nice rendered images. Thanks!

Wiki: http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Import-Export/PDB
Examples - 1: http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Import-Export/PDB#Examples
Examples - 2: http://development.root-1.de/Atomic_Blender_PDB_Examples.php

Here are some movies:

******************** Original message ********************

Dear all.

I just finished my small little Python/Blender project Atomic Blender. It loads crystal or molecule structures from PDB files into Blender 2.5 (and higher versions). I integrated a panel into the Tools tab with many kind of options, which permits an easy handling of the structures. More details can be found here:

http://development.root-1.de/Atomic_Blender.php

I hope that it is for some good use.

If you have any comments, please let me know.

Cheers.

EDIT (2011-12-30): New version of the script: Version 1.2 (see http://development.root-1.de/Atomic_Blender_PDB_Changes.php)

EDIT (2011-12-16): Blender 2.61 is out. So, for activating the script in Blender 2.61 go to: File -> User Preferences -> Official/Community. Search and mark ‘PDB - Atomic Blender’ and choose also ‘Save As Default’. That’s it! You can import PDB files via: File -> Import -> Protein Data Bank (*.pdb)

Wiki page: http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Import-Export/PDB

EDIT (2011-12-09): A new version of Blender will be published soon, where Atomic Blender is a part of. Please, wait for the final release (next week).
Otherwise: You can find the newest version of Atomic Blender always here: https://svn.blender.org/svnroot/bf-extensions/trunk/py/scripts/addons/ or in the ad-on section of Blender (before version 2.61: User Preferences -> Testing, Later in version 2.61: User Preferences -> Official/Community).


(Atom) #2

If I click Draw The Object button without specifying valid paths to data (which I don’t have) the script crashes. So I pulled down a PDB file from your site. I still get a crash even if I browse to your .PDB file and .DAT file.

It does not seem to work for me on 2.6 r41192.


(Blendphys) #3

Dear Atom.

Yes, I forgot to mention one particular problem I still have (is described in the documentation though): You need to uncheck ‘relative path’ on the left of the file requester.
I have been searching for a long time for solving this problem (relative path doesn’t work) but couldn’t find a solution so far. May be, there is somebody who can help me:

When I open a file requester with …

bpy.types.Scene.pdb_filepath = bpy.props.StringProperty(name=“PDB File”, description=“Path to the PDB file”, maxlen = 256, default = PDBFILE, subtype=‘FILE_PATH’, options={‘HIDDEN’})

… ‘relative path’ in the file dialog doesn’t work. Question: How can I program it in Python such that ‘relative path’ is not automatically checked? Thanks for any help.

I use Blender 2.60.0 rs41282


(Meta-Androcto) #4

hi,
you could look at this script:
http://projects.blender.org/tracker/index.php?func=detail&aid=23566&group_id=153&atid=467
It’s broken but may help with the file path problem.
I/O scripts should open the filebrowser, then the user should navigate to the folder/file.
You could also look at 2.60a release i/o scripts to see how they do it to.
Thanks
I’m really interested in this script * would like to see .pdb working well,
then I will make every effort towards getting the script into blender contrib, then release.


(Blendphys) #5

Okay, I will see. The next days are reserved for this script anyway because I rewrite the drawing part at the moment => Blender has not been created for loading many NURBS (> 5000) - it takes a very long time. So, this is why I have to make the code more faster. And indeed, yesterday I could find a solution. - Give me a few days … I let you all know.

If I may contribute it would be nice.


(Blendphys) #6

Dear all.

I have put the new version 1.1 onto my server. More details can be found here:
http://development.root-1.de/Atomic_Blender_Changes.php


(Atom) #7

I just tried the version you have posted at your site. Atomic_Blender_v1.1.blend
I have downloaded PDB file C60.pdb from the site in the above link.

You script does come up and panels are drawn in the Properties panel.
I browse to the PDB file.
I browse to your DAT file.
I click DRAW THE OBJECT and I get an error that you see in the screen shot.

Your relative pathing code does not seem to work on Windows XP 64.

I moved Atomic_Blender.dat to a folder external to the BLEND file and this seemed to disable the relative pathing when I browse to it. HOWEVER, when I click DRAW THE OBJECT I still get no results in the scene.

Attachments



(Blendphys) #8

Dear Atom.

Hmmm, so there is still an issue with this path … . I have Linux 64 bit and I’m sure it works also for 32 Bit. Tomorrow, I will test it under Windows XP 32 Bit. I tell you what I have found. I also try Windows Vista by time … need to search somebody with this OS.

Be patient … thx.

EDIT -
A quick test under Windows XP 32Bit shows: Yes, ‘relative path’ crossed doesn’t work and I know why. I need to change a bit the code. Please wait. However, if ‘relative path’ is not crossed everything works fine, well at least for me. Please, confirm Atom, thx.


(Blendphys) #9

Things should work now.

BTW: I registered the script also here: http://projects.blender.org/tracker/index.php?func=detail&aid=29226&group_id=153&atid=467


(Meta-Androcto) #10

hi, thanks for the cool script :slight_smile:
I noticed you can actually import .ent (protein data bank extension) natively with your script.
All you need to do is in the import window at the top nest to show hidden, press “Enable Filtering of files”.
Then select the .ent file & the script imports successfully!
this is somewhat easier than renaming the .ent file extension to .pdb asI had suggested.
thanks for the cool script :slight_smile:


(Atom) #11

@BlendPhys: The link (http://projects.blender.org/tracker/index.php?func=detail&aid=29226&group_id=153&atid=467) seems to point to an ERROR page?


(Meta-Androcto) #12

atom, try http://projects.blender.org/tracker/index.php?func=detail&aid=29226&group_id=153&atid=468
also the script is in contrib svn


(Atom) #13

Thanks Meta,I finally got it to work using the downlaod from that page.


(Blendphys) #14

Hi Atom and Meta.

Sorry, that I haven’t replied sooner.

Yes, the link is the correct one. I’m currently working on the script. In 1-2 days, I have finished it. The latest version is always here: https://svn.blender.org/svnroot/bf-extensions/contrib/py/scripts/addons/

I keep you updated.

Cheers.


(Blendphys) #15

Dear all.

A new version of the script is available (https://svn.blender.org/svnroot/bf-extensions/contrib/py/scripts/addons/). The script can also be accessed (works like this under Linux) in Blender via: Menu -> User Preferences -> Testing -> Import-Export: PDB-Atomic Blender.


(ValterVB) #16

Just an example :slight_smile:


(Blendphys) #17

Valter, very nice! Did you load the PDB file with Atomic Blender (which version)?

Please, can you supply the PDB file? :slight_smile: I would like to play around, too … . :slight_smile:

Thanks.

EDIT: I got some cool stuff from here: http://li.mit.edu/Archive/Graphics/A/gallery.html There is also a nice carbon nanotube … .


(ValterVB) #18

Did you load the PDB file with Atomic Blender (which version)?

Of sure, what else? :slight_smile:
With version 0.9 (SVN revision: 2670)

Link to the file: http://www.malte-reimold.de/blender/files/dna.pdb


(Blendphys) #19

Thanks.

I’m currently creating a movie of the same molecule. It is really amazing … .


(Blendphys) #20

New version is available … the script uses now the dupliface technique for representing the sticks.

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