[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2596] trunk/py/scripts/addons/ io_mesh_pdb/import_pdb.py: minor edits

Campbell Barton ideasman42 at gmail.com
Tue Nov 8 07:24:54 CET 2011


Revision: 2596
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2596
Author:   campbellbarton
Date:     2011-11-08 06:24:54 +0000 (Tue, 08 Nov 2011)
Log Message:
-----------
minor edits

Modified Paths:
--------------
    trunk/py/scripts/addons/io_mesh_pdb/import_pdb.py

Modified: trunk/py/scripts/addons/io_mesh_pdb/import_pdb.py
===================================================================
--- trunk/py/scripts/addons/io_mesh_pdb/import_pdb.py	2011-11-08 05:41:31 UTC (rev 2595)
+++ trunk/py/scripts/addons/io_mesh_pdb/import_pdb.py	2011-11-08 06:24:54 UTC (rev 2596)
@@ -226,8 +226,6 @@
     scene = context.scene
 
     file = open(filepath, 'r')
-    lines = file.readlines()
-    file.close()
 
     model_list = {}
     model_flag = False
@@ -239,7 +237,7 @@
     # -------------------------------------------------------------------------
     # Parse data
 
-    for line in lines:
+    for line in file:
         # print(line)
         if line[:6] == 'COMPND':
             if line[11:17] == 'CHAIN:':
@@ -366,15 +364,18 @@
                                                            tempfactor, element,
                                                            charge)
 
+    file.close()
+
     if (not multimers) or (not biomolecule_flag):
         # Create a default biomolecule w/ all chains and identity transform
         # Overwrites original biomolecule_list
         biomolecule_flag = True
-        biomolecule_list = {1: Biomolecule(1)}
-        biomolecule_list[1].chain_transforms[tuple(chain_list)] = []
-        biomolecule_list[1].chain_transforms[tuple(chain_list)].append([[1, 0, 0, 0],
-                                                                        [0, 1, 0, 0],
-                                                                        [0, 0, 1, 0]])
+        bm_serial = 1
+        biomolecule = Biomolecule(bm_serial)
+        biomolecule.chain_transforms[tuple(chain_list)] = [(((1.0, 0.0, 0.0, 0.0),
+                                                             (0.0, 1.0, 0.0, 0.0),
+                                                             (0.0, 0.0, 1.0, 0.0)))]
+        biomolecule_list = {bm_serial: biomolecule}
 
     # -------------------------------------------------------------------------
     # Create atom mesh template



More information about the Bf-extensions-cvs mailing list