[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [4180] contrib/py/scripts/addons/ io_atomblend_utilities: Code cleaning.

Clemens Barth barth at root-1.de
Sun Jan 20 04:46:22 CET 2013


Revision: 4180
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=4180
Author:   blendphys
Date:     2013-01-20 03:46:14 +0000 (Sun, 20 Jan 2013)
Log Message:
-----------
Code cleaning.

Blendphys.

Modified Paths:
--------------
    contrib/py/scripts/addons/io_atomblend_utilities/__init__.py
    contrib/py/scripts/addons/io_atomblend_utilities/io_atomblend_utilities.py

Modified: contrib/py/scripts/addons/io_atomblend_utilities/__init__.py
===================================================================
--- contrib/py/scripts/addons/io_atomblend_utilities/__init__.py	2013-01-19 21:41:14 UTC (rev 4179)
+++ contrib/py/scripts/addons/io_atomblend_utilities/__init__.py	2013-01-20 03:46:14 UTC (rev 4180)
@@ -24,7 +24,7 @@
 #
 #  Start of project              : 2011-12-01 by Clemens Barth
 #  First publication in Blender  : 2012-11-03
-#  Last modified                 : 2013-01-19
+#  Last modified                 : 2013-01-20
 #
 #  Acknowledgements 
 #  ================

Modified: contrib/py/scripts/addons/io_atomblend_utilities/io_atomblend_utilities.py
===================================================================
--- contrib/py/scripts/addons/io_atomblend_utilities/io_atomblend_utilities.py	2013-01-19 21:41:14 UTC (rev 4179)
+++ contrib/py/scripts/addons/io_atomblend_utilities/io_atomblend_utilities.py	2013-01-20 03:46:14 UTC (rev 4180)
@@ -225,84 +225,46 @@
         for obj in bpy.context.scene.objects:
             for layer in layers:
                 if obj.layers[layer] == True:
-                    change_objects_all.append(obj)
-                    
-        # This is very important now: If there are dupliverts structures, note 
-        # only the parents and NOT the children! Otherwise the double work is 
-        # done or the system can even crash if objects are deleted. - The 
-        # chidlren are accessed anyways (see below).
-        change_objects = []
-        for obj in change_objects_all:
-            if obj.parent != None:
-                FLAG = False
-                for obj2 in change_objects:
-                    if obj2 == obj.parent:
-                        FLAG = True
-                if FLAG == False:        
-                    change_objects.append(obj)
-            else:
-                change_objects.append(obj)
-                    
-        # Consider all objects, which are in the latter list.
-        for obj in change_objects:
-            if len(obj.children) != 0:
-                for obj_child in obj.children:
-                    if obj_child.type in {'SURFACE', 'MESH', 'META'}: 
-                            modify_objects(action_type, 
-                                   obj_child,
-                                   radius_all, 
-                                   radius_pm, 
-                                   radius_type,
-                                   radius_type_ionic,
-                                   sticks_all)
-            else:
-                if obj.type in {'SURFACE', 'MESH', 'META'}:
-                        modify_objects(action_type, 
-                                   obj,  
-                                   radius_all, 
-                                   radius_pm, 
-                                   radius_type,
-                                   radius_type_ionic,
-                                   sticks_all)
+                    change_objects_all.append(obj)                                  
     # For selected objects of the visible layer                               
-    if who == "ALL_ACTIVE":
+    elif who == "ALL_ACTIVE":
         change_objects_all = []
         # Note all selected objects first.
         for obj in bpy.context.selected_objects:
             change_objects_all.append(obj)   
-            
-        # This is very important now: If there are dupliverts structures, note 
-        # only the parents and NOT the children! Otherwise the double work is 
-        # done or the system can even crash if objects are deleted. - The 
-        # chidlren are accessed anyways (see below).
-        change_objects = []
-        for obj in change_objects_all:
-            if obj.parent != None:
-                FLAG = False
-                for obj2 in change_objects:
-                    if obj2 == obj.parent:
-                        FLAG = True
-                if FLAG == False:        
-                    change_objects.append(obj)
-            else:
+                    
+    # This is very important now: If there are dupliverts structures, note 
+    # only the parents and NOT the children! Otherwise the double work is 
+    # done or the system can even crash if objects are deleted. - The 
+    # chidlren are accessed anyways (see below).
+    change_objects = []
+    for obj in change_objects_all:
+        if obj.parent != None:
+            FLAG = False
+            for obj2 in change_objects:
+                if obj2 == obj.parent:
+                   FLAG = True
+            if FLAG == False:        
                 change_objects.append(obj)
-
-        # ... and do then your different kind of jobs ...    
-        for obj in change_objects:     
-            if len(obj.children) != 0:
-                for obj_child in obj.children:
-                    if obj_child.type in {'SURFACE', 'MESH', 'META'}:
-                        modify_objects(action_type, 
+        else:
+            change_objects.append(obj)
+        
+    # Consider all objects, which are in the latter list.
+    for obj in change_objects:
+        if len(obj.children) != 0:
+            for obj_child in obj.children:
+                if obj_child.type in {'SURFACE', 'MESH', 'META'}: 
+                    modify_objects(action_type, 
                                    obj_child,
                                    radius_all, 
                                    radius_pm, 
                                    radius_type,
                                    radius_type_ionic,
                                    sticks_all)
-            else:
-                if obj.type in {'SURFACE', 'MESH', 'META'}:
-                    modify_objects(action_type, 
-                                   obj,
+        else:
+            if obj.type in {'SURFACE', 'MESH', 'META'}:
+                modify_objects(action_type, 
+                                   obj,  
                                    radius_all, 
                                    radius_pm, 
                                    radius_type,
@@ -310,7 +272,6 @@
                                    sticks_all)
 
 
-
 # Modifying the radius of a selected atom or stick
 def modify_objects(action_type, 
                    obj, 
@@ -558,6 +519,10 @@
 def draw_obj(obj_type, name, location, scale, material):
 
     current_layers=bpy.context.scene.layers
+    
+    # F+  center: halo cloud + small sphere
+    # F++ center: halo cloud + 2 small spheres
+    # defect: halo cloud + circle
 
     if obj_type == '0a': #Sphere mesh
         bpy.ops.mesh.primitive_uv_sphere_add(
@@ -740,7 +705,7 @@
         material_new.type = 'HALO'
         material_new.halo.size = scale[0]*1.5
         material_new.halo.hardness = 25
-        material_new.halo.add = 0.7
+        material_new.halo.add = 0.0
         new_atom.active_material = material_new
         new_atom.name = name
         new_atom.select = True



More information about the Bf-extensions-cvs mailing list