Objects with some new shapes for replacing the shapes of selected atoms were
authorClemens Barth <barth@root-1.de>
Tue, 22 Jan 2013 20:58:24 +0000 (20:58 +0000)
committerClemens Barth <barth@root-1.de>
Tue, 22 Jan 2013 20:58:24 +0000 (20:58 +0000)
added.

Blendphys.

io_atomblend_utilities/__init__.py
io_atomblend_utilities/io_atomblend_utilities.py

index 6e8ed0e1b89e2d741faa82ce9745fd51e1d5e8dd..b2aec457595796a5bcfedaeae11553581b2e4bd2 100644 (file)
@@ -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 @@ class PanelProperties(bpy.types.PropertyGroup):
                ('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"),
index 052279e03bb1d7189362383f6f75423304d13b8c..87a365df1a330c0e0f620e4267ea1687d60d3e0d 100644 (file)
@@ -604,33 +604,17 @@ def draw_obj(obj_type, name, location, scale, material):
             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 @@ def draw_obj(obj_type, name, location, scale, material):
         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