[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2609] contrib/py/scripts/addons/ io_import_pdb_atomic_blender.py: Please, don' t think that I have changed the whole script.

Clemens Barth barth at root-1.de
Sun Nov 13 20:52:23 CET 2011


Revision: 2609
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2609
Author:   blendphys
Date:     2011-11-13 19:52:23 +0000 (Sun, 13 Nov 2011)
Log Message:
-----------
Please, don't think that I have changed the whole script. 
I merely changed the indent of each line such that the style 
meets the programming creteria of Blender. I also included the 
GPL license.

This is all.

To do 
=====
In the next days I will deal with the propositions,
which have been made here:  

http://codereview.appspot.com/5369091/diff/1//dsk/data/src/blender/blender/release/scripts/addons/io_pdb_atomic.py

Cheers.

Modified Paths:
--------------
    contrib/py/scripts/addons/io_import_pdb_atomic_blender.py

Modified: contrib/py/scripts/addons/io_import_pdb_atomic_blender.py
===================================================================
--- contrib/py/scripts/addons/io_import_pdb_atomic_blender.py	2011-11-13 16:03:47 UTC (rev 2608)
+++ contrib/py/scripts/addons/io_import_pdb_atomic_blender.py	2011-11-13 19:52:23 UTC (rev 2609)
@@ -1,60 +1,52 @@
-import bpy
-import io
-import sys
-import os
-from math import *
-import mathutils, math
-from mathutils import Vector
+# ##### BEGIN GPL LICENSE BLOCK #####
 #
-PDBFILE   = "PATH TO PDB FILE"
-DATAFILE  = "PATH TO DATA FILE"
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
 #
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
 #
+#  The main author of the script is Dr. Clemens Barth.
 #
-#  ____                   _   _                             _       _   
-# |  _ \ _   _ _ __      | |_| |__   ___      ___  ___ _ __(_)_ __ | |_ 
-# | |_) | | | | '_ \     | __| '_ \ / _ \    / __|/ __| '__| | '_ \| __|
-# |  _ <| |_| | | | |    | |_| | | |  __/    \__ \ (__| |  | | |_) | |_ 
-# |_| \_\\__,_|_| |_|     \__|_| |_|\___|    |___/\___|_|  |_| .__/ \__|
-#                                                            |_|        
-#		
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 #
-#
-#
-#
-#
-#
-#
-#
-#
-#
-#
-#
-#
-#
-#
-#
-#		
-# 
-Atomic_Blender_string     = "Atomic Blender 1.1 -- Dr. Clemens Barth -- November 2011\n======================================================="
-Atomic_Blender_panel_name = "Atomic Blender 1.1"
+# ##### END GPL LICENSE BLOCK #####
 
-
 bl_info = {
   "name": "Atomic Blender",
   "description": "Loading and manipulating atoms from PDB files",
-  "author": "Dr. Clemens Barth (barth at root-1.de)",
-  "version": (1,1),
+  "author": "Dr. Clemens Barth",
+  "version": (1,11),
   "blender": (2,6),
   "api": 31236,
   "location": "Properties > Physics => Panel Atomic Blender",
   "warning": "",
   "wiki_url": "http://development.root-1.de/Atomic_Blender.php",
-  "tracker_url": "",
-  "category": "Physicss"
+  "tracker_url": "http://projects.blender.org/tracker/?func=detail&atid=467&aid=29226&group_id=153",
+  "category": "Import-Export"
 }
 
+import bpy
+import io
+import sys
+import os
+from math import *
+import mathutils, math
+from mathutils import Vector
+#
+PDBFILE   = "PATH TO PDB FILE"
+DATAFILE  = "PATH TO DATA FILE"
 
+Atomic_Blender_string     = "Atomic Blender 1.1 -- Dr. Clemens Barth -- November 2011\n======================================================="
+Atomic_Blender_panel_name = "Atomic Blender 1.1"
+
+
 class OBJECT_PDB_Panel(bpy.types.Panel):
     bl_label       = Atomic_Blender_panel_name
     bl_space_type  = "PROPERTIES"
@@ -135,29 +127,29 @@
         row.prop(scn, "entry_start_number_atoms")
         
         if scn.entry_group_atoms_yesno == False:        
-           row = layout.row()       
-           row.label("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------")
-           row = layout.row()
-           row.prop(scn, "entry_distance")
-           layout.operator( "fp.button_distance" )        
-           row = layout.row()       
-           row.label("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------")
-           row = layout.row()
-           row.label(text="Modification of the radii of one type of atom")
-           row = layout.row()
-           row.prop(scn, "entry_mod_atomname")
-           row = layout.row()
-           row.prop(scn, "entry_mod_pm_yesno")
-           row.prop(scn, "entry_mod_pm_radius")
-           row = layout.row()
-           row.prop(scn, "entry_mod_rel_yesno")
-           row.prop(scn, "entry_mod_rel_radius")
-           layout.operator( "fp.button_modify" )
-           row = layout.row()
-           row.label(text="Modification of all atom radii")
-           row = layout.row()
-           row.prop(scn, "entry_mod_all_radii")
-           layout.operator( "fp.button_modify_2" )
+            row = layout.row()       
+            row.label("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------")
+            row = layout.row()
+            row.prop(scn, "entry_distance")
+            layout.operator( "fp.button_distance" )        
+            row = layout.row()       
+            row.label("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------")
+            row = layout.row()
+            row.label(text="Modification of the radii of one type of atom")
+            row = layout.row()
+            row.prop(scn, "entry_mod_atomname")
+            row = layout.row()
+            row.prop(scn, "entry_mod_pm_yesno")
+            row.prop(scn, "entry_mod_pm_radius")
+            row = layout.row()
+            row.prop(scn, "entry_mod_rel_yesno")
+            row.prop(scn, "entry_mod_rel_radius")
+            layout.operator( "fp.button_modify" )
+            row = layout.row()
+            row.label(text="Modification of all atom radii")
+            row = layout.row()
+            row.prop(scn, "entry_mod_all_radii")
+            layout.operator( "fp.button_modify_2" )
 
 
 
@@ -341,10 +333,10 @@
 def Measure_distance_in_scene():
 
     if len(bpy.context.selected_bases) > 1:
-       object_1 = bpy.context.selected_objects[0]
-       object_2 = bpy.context.selected_objects[1]
+        object_1 = bpy.context.selected_objects[0]
+        object_2 = bpy.context.selected_objects[1]
     else:
-       return "-1.0"
+        return "-1.0"
 
     v1     = object_1.location
     v2     = object_2.location
@@ -370,72 +362,72 @@
 # This part is for deleting all existing atoms.
 def Delete_atoms_in_scene():
   
-   # Deselect all objects
-   bpy.ops.object.select_all(action='DESELECT')
+    # Deselect all objects
+    bpy.ops.object.select_all(action='DESELECT')
 
-   # Go through all objects
-   for obj in bpy.data.objects:
+    # Go through all objects
+    for obj in bpy.data.objects:
 
-      # If a camera or lamp is not found, select the object
-      if "camera" not in obj.name:
-         if "lamp" not in obj.name:
-            bpy.ops.object.select_name(name = obj.name, extend=True)
+        # If a camera or lamp is not found, select the object
+        if "camera" not in obj.name:
+            if "lamp" not in obj.name:
+                bpy.ops.object.select_name(name = obj.name, extend=True)
                
-   #delete marked atoms
-   bpy.ops.object.delete()
+    #delete marked atoms
+    bpy.ops.object.delete()
    
-   bpy.ops.mesh.primitive_cube_add(view_align=False, enter_editmode=False, location=(100000.0, 100000.0, 100000.0), rotation=(0.0, 0.0, 0.0), layers=(True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False))
-   tmp_object = bpy.context.scene.objects[0]   
-   bpy.ops.object.select_name(name = bpy.data.objects[0].name, extend=True)
+    bpy.ops.mesh.primitive_cube_add(view_align=False, enter_editmode=False, location=(100000.0, 100000.0, 100000.0), rotation=(0.0, 0.0, 0.0), layers=(True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False))
+    tmp_object = bpy.context.scene.objects[0]   
+    bpy.ops.object.select_name(name = bpy.data.objects[0].name, extend=True)
 
 
 # This part is for deleting all existing cameras and lamps.
 def Delete_camlamp_in_scene():
    
-   # Deselect all objects
-   bpy.ops.object.select_all(action='DESELECT')
+    # Deselect all objects
+    bpy.ops.object.select_all(action='DESELECT')
 
-   # Go through all objects
-   for obj in bpy.data.objects:
+    # Go through all objects
+    for obj in bpy.data.objects:
 
-      # If a camera is found, select the camera
-      if "camera" in obj.name:
-         bpy.ops.object.select_name(name = obj.name, extend=True)
+        # If a camera is found, select the camera
+        if "camera" in obj.name:
+            bpy.ops.object.select_name(name = obj.name, extend=True)
 
-      # If a lamp is found, select the camera
-      if "lamp" in obj.name:
-         bpy.ops.object.select_name(name = obj.name, extend=True)
+        # If a lamp is found, select the camera
+        if "lamp" in obj.name:
+            bpy.ops.object.select_name(name = obj.name, extend=True)
             
-   #delete marked objects
-   bpy.ops.object.delete()
-   bpy.ops.mesh.primitive_cube_add(view_align=False, enter_editmode=False, location=(100000.0, 100000.0, 100000.0), rotation=(0.0, 0.0, 0.0), layers=(True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False))
-   tmp_object = bpy.context.scene.objects[0]      
-   bpy.ops.object.select_name(name = bpy.data.objects[0].name, extend=True)
+    #delete marked objects
+    bpy.ops.object.delete()
+    bpy.ops.mesh.primitive_cube_add(view_align=False, enter_editmode=False, location=(100000.0, 100000.0, 100000.0), rotation=(0.0, 0.0, 0.0), layers=(True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False))
+    tmp_object = bpy.context.scene.objects[0]      
+    bpy.ops.object.select_name(name = bpy.data.objects[0].name, extend=True)
 
 
 # Routine to modify the radii of a specific type of atom

@@ Diff output truncated at 10240 characters. @@


More information about the Bf-extensions-cvs mailing list