[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [4195] contrib/py/scripts/addons/ io_atomblend_utilities: Objects with some new shapes for replacing the shapes of selected atoms were

Clemens Barth barth at root-1.de
Tue Jan 22 21:58:32 CET 2013


Revision: 4195
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=4195
Author:   blendphys
Date:     2013-01-22 20:58:24 +0000 (Tue, 22 Jan 2013)
Log Message:
-----------
Objects with some new shapes for replacing the shapes of selected atoms were
added.

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-22 18:56:51 UTC (rev 4194)
+++ contrib/py/scripts/addons/io_atomblend_utilities/__init__.py	2013-01-22 20:58:24 UTC (rev 4195)
@@ -24,7 +24,7 @@
 #
 #  Start of project              : 2011-12-01 by Clemens Barth
 #  First publication in Blender  : 2012-11-03
-#  Last modified                 : 2013-01-21
+#  Last modified                 : 2013-01-22
 #
 #  Acknowledgements 
 #  ================
@@ -183,6 +183,8 @@
                ('4a',"Icosphere 1", "Replace with a icosphere, subd=1"),  
                ('4b',"Icosphere 2", "Replace with a icosphere, subd=2"),  
                ('4c',"Icosphere 3", "Replace with a icosphere, subd=3"),                             
+               ('4d',"Icosphere 4", "Replace with a icosphere, subd=4"),                             
+               ('4e',"Icosphere 5", "Replace with a icosphere, subd=5"),                             
                ('5a',"Cylinder", "Replace with a cylinder"),
                ('5b',"Cylinder (NURBS)", "Replace with a cylinder (NURBS)"),               
                ('6',"Cone", "Replace with a cone"),

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-22 18:56:51 UTC (rev 4194)
+++ contrib/py/scripts/addons/io_atomblend_utilities/io_atomblend_utilities.py	2013-01-22 20:58:24 UTC (rev 4195)
@@ -604,33 +604,17 @@
             location=location, 
             rotation=(0, 0, 0), 
             layers=current_layers)
-    if obj_type == '4a': #Icosphere, subdivision=1        
+    if obj_type in {'4a','4b','4c','4d','4e'}: #Icosphere        
+        index = {'4a':1,'4b':2,'4c':3,'4d':4,'4e':5}  
+        print(obj_type, index[obj_type])
         bpy.ops.mesh.primitive_ico_sphere_add(
-            subdivisions=1, 
+            subdivisions=int(index[obj_type]), 
             size=1, 
             view_align=False, 
             enter_editmode=False, 
             location=location, 
             rotation=(0, 0, 0), 
-            layers=current_layers)                
-    if obj_type == '4b': #Icosphere, subdivision=2
-        bpy.ops.mesh.primitive_ico_sphere_add(
-            subdivisions=2, 
-            size=1, 
-            view_align=False, 
-            enter_editmode=False, 
-            location=location, 
-            rotation=(0, 0, 0), 
-            layers=current_layers)                
-    if obj_type == '4c': #Icosphere, subdivision=3
-        bpy.ops.mesh.primitive_ico_sphere_add(
-            subdivisions=3, 
-            size=1, 
-            view_align=False, 
-            enter_editmode=False, 
-            location=location, 
-            rotation=(0, 0, 0), 
-            layers=current_layers)                
+            layers=current_layers)
     if obj_type == '5a': #Cylinder
         bpy.ops.mesh.primitive_cylinder_add(
             vertices=32, 
@@ -742,8 +726,8 @@
         new_atom.name = name
         new_atom.select = True
 
-    if obj_type in {'0a','0b','1','2','3a','3b','4a','4b','4c','5a',
-                    '5b','6','7a','7b'}:
+    if obj_type in {'0a','0b','1','2','3a','3b','4a','4b','4c','4d','4e',
+                    '5a','5b','6','7a','7b'}:
         new_atom = bpy.context.scene.objects.active
         new_atom.scale = scale
         new_atom.active_material = material



More information about the Bf-extensions-cvs mailing list