Page MenuHome

PDB (Protein Data Base) files can be loaded with the Atomic Blender script
Closed, ArchivedPublic

Description

Project: Blender Extensions
Tracker: Py Scripts Release
Blender: 2.64
Python: 3.2
Dependencies: none
Script name: Atomic Blender
Homepage: http://development.root-1.de/Atomic_Blender.php
Wiki page: http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Import-Export/PDB
Author(s): Clemens Barth
Category: Import Export
SVN Download: https://svn.blender.org/svnroot/bf-extensions/trunk/py/scripts/addons/io_mesh_pdb/
Status: Open

The Phyton script Atomic Blender can be used to load PDB (Protein Data Base) files into Blender. It reads the coordinates of all atoms in the PDB file (<file name.pdb>) and represents the atoms as balls in the Blender scene. Also the sticks, which connect atoms, are shown if this option is chosen and if the sticks are listed in the PDB file.

Only atoms as balls and corresponding sticks are shown in the Blender scene but no complex structures.

Atomic Blender opens a panel in Blender, which can be found in the tab physics (see image on the right). Many options can be chosen, which help to well-represent the atoms and sticks. For instance, after loading a PDB file the radius of one type of atom can be explicitly changed after. All other options are described further below. Note that the utilities of Blender allow additional changes of the objects.

Atomic Blender is interesting for scientists, who want to visualize their molecules, crystal structures, surfaces, etc. with Blender. The PDB format is widely distributed and can be produced by many programs including programs like CrystalMaker or Vesta.

Thanks to Blender, fancy graphics of molecules, crystal structures, surfaces and complex atomic arrangements can be obtained. Such graphics meet the standards of top-level journals, which have an high impact factor.

Installation, quick manual

- Uncompress the file.
- Open the file Atomic_Blender_v1.1.blend
- On the left, the Python script can be seen. At the beginning of the script, you find the absolute paths for the PDB and data file. Modify the path of the data file.
Run the script: push the right mouse button in the script window and choose 'Run Script'. The key combination 'Alt-P' is doing basically the same. In the panel 'physics' (right), the sub-panel 'PDB Blender' can be seen.
- Open the first file dialog for loading the PDB file. Search your PDB file.
- Push the button 'DRAW THE OBJECT …'. Your molecules or whatever should appear after some time in the Blender scene. You can now model you object.

More details can be found here: http://development.root-1.de/Atomic_Blender.php

Event Timeline

Last week I committed a different script to trunk, not realizing this one existed too.

I'll review and see how they compare.

review line-by-line here.
http://codereview.appspot.com/5369091/

@Clemens, would you like subversion access to further develop your script?

Moved from Py Scripts Upload to Py Scripts Contrib

moving page to contrib section as script is in svn

Moved from Py Scripts Contrib to Py Scripts Release

moved projects page to release

New version (2011-12-30): Version 1.2

See: http://development.root-1.de/Atomic_Blender_PDB.php

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

Hi,
Due to changes to the api including the merging of bmesh, several addons are outdated.
Please, if you are the author of an addon check your script with blender revision 44256 or newer.
That is builds made After blender 2.62 official release.
I would ask that updates be made to your addon before the Blender 2.63 release.
6-8 weeks away.
This allows time for the api to become more exposed & bmesh to stablize furthur.
If you need help, drop into irc freenode #blenderpython or #blendercoders & feel welcome to ask questions.
At the time of 2.63 release, scripts that are not repaired or in active developement will have their tracker page marked "Closed"
this will not affect your links to the tracker, similar to closing scripts in 2.49b, the page will be still availible & can be re-opened.

Thanks for your understanding & patience during these Exciting Times.
Brendon.

As Campell wrote in his review here:
http://codereview.appspot.com/5369091/diff/1//dsk/data/src/blender/blender/release/scripts/addons/io_pdb_atomic.py#newcode290

the properties shouldn't be stored in the current scene, especially 'cause Presets won't store their settings (not written to preset file)

if you add bl_options = {'PRESET', 'UNDO'} to the import panel code, Preset dropdown list and buttons will show but not doing anything useful

@Sebastian Nell,

Dont understand your reply...

Presets are stored in files, thats how they work.

"""Preset dropdown list and buttons will show but not doing anything useful"""

- Also not sure how you came to this conclusion, if you enable presets for an operator there are none to begin with, but you can stull add then either as a user while blender runs, or as a developer in SVN. this needs to be better documented.

If one clicks the add preset button, a preset file will be written. But if applied, it won't restore the states of the checkboxes, sliders etc.

Why? 'cause the checkbox/slider/... properties aren't properties of the operator, but of the current scene.

if operator's "self" was used for the properties, it would work without problems. Blendphys did not intentionally store them in the scene object, but copy&pasted example code. He told me he will fix this in a few days.

Campbell and Sebastian,

thanks for your comments. I have changed the code such that it has now the preset option set in the file dialogue of the importer and exporter. All values of the properties are stored now.

Mission accomplished.

Hi,

I don't know if it is the right place but there seem to be a bug with the pdb importer add-on.
Indeed when I choose the file to import there is no problem if I choose Meta or Nurbs as type of balls but if I choose mesh it shows the following message :

NameError: global name "Ball_azimuth" is not defined

Thanks for this great add-on

Kali

Hi Kali.

I will check the addon today. If possible, can you attach your PDB file and briefly describe your Blender version? This would help tracking the error. Thanks

Re Kali.

I immediately found the error and I could fix the bug. See here: http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=4574
Everything should be alright now.

Thanks for reporting,

cheers,

Blendphys.

You were faster than me uploading the blend ;)

Thanks a lot

This task was automatically closed as archived as part of migration, because it was determined to be no longer active.

The authoritative list of addons is on the wiki, we no longer have a report for each addon to track bugs and updates. Bugs can be reported individually and assigned to the addon developers. See the Addons project page for more information on the workflow.

Nobody (None) closed this task as Archived.Nov 11 2011, 1:54 PM