Skip to content
Snippets Groups Projects
Commit 08c946b8 authored by Clemens Barth's avatar Clemens Barth
Browse files

When exporting structures from Blender into a PDB file it happened 
sometimes that the xyz positions of the atoms weren't correctly 
stored. Bug fixed.
parent 0956876f
No related branches found
No related tags found
No related merge requests found
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
# #
# Start of project : 2011-08-31 by Clemens Barth # Start of project : 2011-08-31 by Clemens Barth
# First publication in Blender : 2011-11-11 # First publication in Blender : 2011-11-11
# Last modified : 2012-10-13 # Last modified : 2012-10-14
# #
# Acknowledgements: Thanks to ideasman, meta_androcto, truman, kilon, # Acknowledgements: Thanks to ideasman, meta_androcto, truman, kilon,
# dairin0d, PKHG, Valter, etc # dairin0d, PKHG, Valter, etc
......
...@@ -74,14 +74,16 @@ def DEF_atom_pdb_export(obj_type): ...@@ -74,14 +74,16 @@ def DEF_atom_pdb_export(obj_type):
if len(obj.children) != 0: if len(obj.children) != 0:
for vertex in obj.data.vertices: for vertex in obj.data.vertices:
location = obj.matrix_world*vertex.co
list_atoms.append(CLASS_atom_pdb_atoms_export( list_atoms.append(CLASS_atom_pdb_atoms_export(
name, name,
obj.location+vertex.co)) location))
else: else:
if not obj.parent: if not obj.parent:
location = obj.location
list_atoms.append(CLASS_atom_pdb_atoms_export( list_atoms.append(CLASS_atom_pdb_atoms_export(
name, name,
obj.location)) location))
pdb_file_p = open(ATOM_PDB_FILEPATH, "w") pdb_file_p = open(ATOM_PDB_FILEPATH, "w")
pdb_file_p.write(ATOM_PDB_PDBTEXT) pdb_file_p.write(ATOM_PDB_PDBTEXT)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment