[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2615] contrib/py/scripts/addons/ io_import_pdb_atomic_blender.py:

Clemens Barth barth at root-1.de
Wed Nov 16 00:21:55 CET 2011


Revision: 2615
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2615
Author:   blendphys
Date:     2011-11-15 23:21:55 +0000 (Tue, 15 Nov 2011)
Log Message:
-----------


Attention: The functionalities of the Atomic Blender script
have not been changed. I merely followed almost all advices 
on this page (rather cosmetics at the script):

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

For instance, I removed all 'Delete buttons', or I changed 
the layout of the buttons etc. in the panel, which looks 
more fancy now.


I still need to do:

 - Entry in menue Import file. (I will do 
   this the next days, should be easy)
 - This 'last active object' thing, Campbell is mentioning on
   the page above. (Also this will be done the next days)
   
There are a few other changes

 - I removed a bug in the routine, which is responsible
   for scaling the radii of all atoms.
 - I introduced a new feature: One can scale all radii at
   once but now also invert this. There is a new button
   (Invert ...) and input field (Invert). All this helps 
   to well adjust the radii of the atoms.

   Remarks:
   1. I will include also an option that the radius of the
   sticks are modified at the same time. (This week)
   2. The same will be done with atoms of one specific type.


Cheers,

Blendphys.

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-15 23:21:41 UTC (rev 2614)
+++ contrib/py/scripts/addons/io_import_pdb_atomic_blender.py	2011-11-15 23:21:55 UTC (rev 2615)
@@ -43,8 +43,8 @@
 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"
+Atomic_Blender_string     = "Atomic Blender 1.1 -- Dr. Clemens Barth -- November 2011\n========================================================"
+Atomic_Blender_panel_name = "PDB - Atomic Blender"
 
 
 class OBJECT_PDB_Panel(bpy.types.Panel):
@@ -57,101 +57,107 @@
         layout = self.layout
         scn    = bpy.context.scene
 
-
-        layout.operator( "fp.button_delete_all" )
         row = layout.row()
-        layout.operator( "fp.button_delete_atoms" )
-        layout.operator( "fp.button_delete_camlamp" )
-        row = layout.row()
         layout.prop(scn, "pdb_filepath")
         layout.prop(scn, "data_filepath")
         row = layout.row()
 
-        row.label("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------")
 
         row = layout.row()
         row.prop(scn, "entry_group_atoms_yesno")
-        row = layout.row()
         row.prop(scn, "entry_group_atoms_dn")
-        row = layout.row()
 
-        row.label("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------")
         row = layout.row()
-        
-        row.prop(scn, "entry_mesh_yesno")
-        row = layout.row()
-        row.prop(scn, "entry_sectors_azimuth")
-        row.prop(scn, "entry_sectors_zenith")
-        
-        row = layout.row()
-        row.label("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------")
-        row = layout.row()
+        col = row.column(align=True)        
+        col.prop(scn, "entry_mesh_yesno")
+        col.prop(scn, "entry_sectors_azimuth")
+        col.prop(scn, "entry_sectors_zenith")        
+        col = row.column(align=True)        
+        col.label(text="Scaling factors")
+        col.prop(scn, "entry_ball_radius")
+        col.prop(scn, "entry_distances")
+        col = row.column(align=True) 
+        col.prop(scn, "entry_sticks_yesno")
+        col.prop(scn, "entry_sticks_sectors")
+        col.prop(scn, "entry_sticks_radius")
 
-        row.label(text="Scaling factors")
-        row = layout.row()
-        row.prop(scn, "entry_ball_radius")
-        row.prop(scn, "entry_distances")
+        row = layout.row()        
+        col = row.column(align=True)  
+        col.prop(scn, "entry_scene_x")
+        col.prop(scn, "entry_scene_y")
+        col.prop(scn, "entry_scene_z")
+        col = row.column()         
+        col.prop(scn, "entry_center_yesno")
 
-        row = layout.row()
-        row.label("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------")
-        row = layout.row()
-        
-        row.prop(scn, "entry_sticks_yesno")
-        row = layout.row()
-        row.prop(scn, "entry_sticks_sectors")
-        row.prop(scn, "entry_sticks_radius")
+        row = layout.row(align=True)        
+        col = row.column()
+        col.prop(scn, "entry_cam_yesno")
+        col.prop(scn, "entry_lamp_yesno")        
+        col = row.column() 
+        col.operator( "fp.button_start" )
+        row2 = col.row()
+        row2.label(text="Number of atoms")
+        row2.prop(scn, "entry_start_number_atoms")
 
-        row = layout.row()
-        row.label("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------")
-        row = layout.row()
         
-        row.prop(scn, "entry_center_yesno")
-        row = layout.row()    
-        row = layout.row()
-        row.label(text="Now, use an offset for all objects")
-        row = layout.row()
-        row.prop(scn, "entry_scene_x")
-        row.prop(scn, "entry_scene_y")
-        row.prop(scn, "entry_scene_z")
-       
-        row = layout.row()
-        row.label("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------")
-        row = layout.row()
         
-        row.prop(scn, "entry_cam_yesno")
-        row.prop(scn, "entry_lamp_yesno")
-        row = layout.row()  
-        layout.operator( "fp.button_start" )
-        row = layout.row()  
-        row.label(text="No. of atoms: ")
-        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 = layout.row()             
+            row.operator( "fp.button_distance")
+            row.prop(scn, "entry_distance") 
+            
+            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()
+            col = row.column()            
+            col.prop(scn, "entry_mod_pm_yesno")
+            col.prop(scn, "entry_mod_pm_radius")
+            col = row.column()  
+            col.prop(scn, "entry_mod_rel_yesno")
+            col.prop(scn, "entry_mod_rel_radius")
+            col = row.column()
+            col.prop(scn, "entry_mod_atomname")
+            col.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.operator( "fp.button_modify_2" )
+            row = layout.row()
+            row.prop(scn, "entry_mod_all_radii_inv")
+            row.operator( "fp.button_modify_3" )
 
 
+class Input_Output(bpy.types.PropertyGroup):
+    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'})
+    bpy.types.Scene.data_filepath             = bpy.props.StringProperty(name = "DATA File", description="Path to the dat file", maxlen = 256, default = DATAFILE, subtype='FILE_PATH')
+    bpy.types.Scene.entry_group_atoms_yesno   = bpy.props.BoolProperty  (name = "Group atoms", default=False, description = "Grouping same type of atoms speeds up the loading of large-atom-PDB files")    
+    bpy.types.Scene.entry_group_atoms_dn      = bpy.props.IntProperty   (name = "Delta N", default=200, min=0, description = "")
+    bpy.types.Scene.entry_mesh_yesno          = bpy.props.BoolProperty  (name = "Mesh balls", default=False, description = "Yes or no")    
+    bpy.types.Scene.entry_sectors_azimuth     = bpy.props.IntProperty   (name = "Azimuth", default=32, min=0, description = "")
+    bpy.types.Scene.entry_sectors_zenith      = bpy.props.IntProperty   (name = "Zenith", default=32, min=0, description = "")
+    bpy.types.Scene.entry_ball_radius         = bpy.props.FloatProperty (name = "Balls", default=1.0, min=0.0, description = "Ball radius")
+    bpy.types.Scene.entry_distances           = bpy.props.FloatProperty (name = "Distances", default=1.0, min=0.0, description = "All distances")
+    bpy.types.Scene.entry_center_yesno        = bpy.props.BoolProperty  (name = "Object to origin", default=True, description = "Yes or no")    
+    bpy.types.Scene.entry_scene_x             = bpy.props.FloatProperty (name = "X", default=0.0, description = "X coordinate")
+    bpy.types.Scene.entry_scene_y             = bpy.props.FloatProperty (name = "Y", default=0.0, description = "Y coordinate")
+    bpy.types.Scene.entry_scene_z             = bpy.props.FloatProperty (name = "Z", default=0.0, description = "Z coordinate")
+    bpy.types.Scene.entry_sticks_yesno        = bpy.props.BoolProperty  (name = "Use sticks", default=False, description = "Shall sticks connect the atoms?")    
+    bpy.types.Scene.entry_sticks_sectors      = bpy.props.IntProperty   (name = "Sector", default = 20, min=0,   description = "Number of sectors of a stick")        
+    bpy.types.Scene.entry_sticks_radius       = bpy.props.FloatProperty (name = "Radius", default =  0.1, min=0.0, description = "Radius of a stick")  

@@ Diff output truncated at 10240 characters. @@


More information about the Bf-extensions-cvs mailing list