[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2564] branches/geodesic_domes/gui_pkhg .py: bug's hopefully removed

Peter K.H. Gragert pkhgragert at gmail.com
Wed Nov 2 07:43:39 CET 2011


Revision: 2564
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2564
Author:   pkhg
Date:     2011-11-02 06:43:37 +0000 (Wed, 02 Nov 2011)
Log Message:
-----------
bug's hopefully removed
Preparation for simplifying done, a lot of commands camouflaged by putting inside ''' ''' ;-)

Modified Paths:
--------------
    branches/geodesic_domes/gui_pkhg.py

Modified: branches/geodesic_domes/gui_pkhg.py
===================================================================
--- branches/geodesic_domes/gui_pkhg.py	2011-11-01 20:49:45 UTC (rev 2563)
+++ branches/geodesic_domes/gui_pkhg.py	2011-11-02 06:43:37 UTC (rev 2564)
@@ -1,9 +1,8 @@
-#pkhg_test version
+#pkhg_test version created_vefm_mesh_values
 import bpy
 import sys
 #sys.path.append("c:/BlenderSVN/cmake_all3/bin/2.60/scripts/addons/geodesic_domes")
 #print(sys.path)
-
 from geodesic_domes import vefm_259 as vefm_259
 
 from geodesic_domes import forms_259  as forms_259
@@ -12,6 +11,7 @@
 import math
 from math import pi,cos, sin, sqrt
 from bpy.props import EnumProperty, IntProperty, FloatProperty, StringProperty, BoolProperty
+created_vefm_mesh_values = None
 
 bpy.types.Scene.superformula_um = FloatProperty(name = 'um', min = 0, soft_min=0.1, soft_max=5,max = 10, default =  3)
 bpy.types.Scene.superformula_un1 = FloatProperty(name = 'un1', min = 0, soft_min=0.1, soft_max=5,max = 20, default =  1)
@@ -33,6 +33,8 @@
 bpy.types.Scene.superformula_vtwist = FloatProperty(name = 'vtwist', min = 0, soft_min=0.1, soft_max=5,max = 10, default =  0)
 #for Geodesics
 bpy.types.Scene.geodesic_frequency = IntProperty(name="Frequency",min = 1, soft_max=5, max = 10, default = 1,description="number of subdivisions")
+
+'''
 #for Grid
 bpy.types.Scene.grid_xres = IntProperty(name="X res",min = 1, soft_min = 2, soft_max=10, max = 20, default = 2)
 bpy.types.Scene.grid_yres = IntProperty(name="Y res",min = 1, soft_min = 2, soft_max=10, max = 20, default = 2)
@@ -95,8 +97,8 @@
 bpy.types.Scene.sphere_vtwist = FloatProperty(name = 'vtwist', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  0) 
 bpy.types.Scene.sphere_xscale = FloatProperty(name = 'xscale', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)  #scale in x direction
 bpy.types.Scene.sphere_yscale = FloatProperty(name = 'yscale', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)  #scale in z direction not y ?! the heigth so to say
+#'''
 
-
 bpy.types.Scene.class_one = BoolProperty(
     name="Class nr 1",
     description="Class nr 1",
@@ -176,13 +178,12 @@
     bl_label = "Geodesic Domes"
     bl_region_type = "TOOLS"
     bl_space_type = "VIEW_3D"
-
    
     def draw(self,context):
         layout = self.layout
         col = layout.column(align=True)
         col = layout.column()
-        col.label("First choice")
+        col.label("Types")
         col.prop(context.scene,"choose_type")
         #chosen = int(context.scene.choose_type)
         tmp =  get_chosen_type(context)
@@ -209,9 +210,9 @@
         elif tmp == 'Sphere':
             row = layout.row()
             row.operator(AddSphere.bl_idname,"Sphere")
-        elif tmp == 'Parabol':
+        elif tmp == 'Parabola':
             row = layout.row()
-            row.operator(AddParabol.bl_idname,"Parabol")       
+            row.operator(AddParabola.bl_idname,"Parabola")       
         elif tmp == 'Cylinder':
             row = layout.row()
             row.operator(AddCylinder.bl_idname,"Cylinder")       
@@ -252,8 +253,7 @@
     bl_label = "Your chosen Geodesic"
     bl_options = {'REGISTER','UNDO'}
     
-    frequency = IntProperty(name="Frequency",min = 1, soft_max=5, max = 10, default = 1,description="number of subdivisions") #bpy.context.scene.geodesic_frequency
-    #PKHG TODO 1-11-2011 not yet implemented parameter values!
+    frequency = IntProperty(name="Frequency",min = 1, soft_max=5, max = 10, default = 1,description="number of subdivisions") 
     radius = FloatProperty(name="Radius",min = 0.001, soft_min=0.1, soft_max=4,max = 5, default = 1.0)
     eccentricity = FloatProperty(name="Eccentricity",min = 0.001, soft_min=0.1, soft_max=4,max = 5, default = 1.0)
     flatten = FloatProperty(name="Flatten",min = 0.001, soft_min=0.1, soft_max=4,max = 5, default = 1.0)
@@ -270,6 +270,8 @@
         col.prop(self,"frequency")
             
     def execute(self,context):
+        global  last_generated_object,created_vefm_mesh_values
+        geodesic_choice = None
         frequency = context.scene.geodesic_frequency
         um = context.scene.superformula_um
         un1 = context.scene.superformula_un1
@@ -295,29 +297,43 @@
         parameters=[self.frequency, self.eccentricity, self.flatten, self.radius, self.square,self.square_z,0,0,0,0,False,0,0,1,superformparam]
         if which_geodesic == 'Tetrahedron':
             if which_orientation == "PointUp":
+                geodesic_choice = ['Geodesic','tetrahedron']
+                print("\nDBG >>>>>> geodesic_choice",geodesic_choice)
                 new_geodesic = geodesic_classes_259.tetrahedron(parameters)
-                created_vefm_mesh_values = ['Tetrahedron',new_geodesic.PKHG_parameters]
-#                print("\n**DBG***>>>>>> created_vefm_mesh_values",created_vefm_mesh_values)
             elif which_orientation == "EdgeUp":
+                geodesic_choice = ['Geodesic','tetraedge']
                 new_geodesic = geodesic_classes_259.tetraedge(parameters)
             else:
+                geodesic_choice = ['Geodesic','tetraface']
                 new_geodesic = geodesic_classes_259.tetraface(parameters)
-        elif which_geodesic == 'Octahedron':
+        elif which_geodesic == 'Octahedron':            
             if which_orientation == "PointUp":
+                geodesic_choice = ['Geodesic','octahedron']                
                 new_geodesic = geodesic_classes_259.octahedron(parameters)
             elif which_orientation == "EdgeUp":
+                geodesic_choice = ['Geodesic','octaedge']
                 new_geodesic = geodesic_classes_259.octaedge(parameters)
             else:
+                geodesic_choice = ['Geodesic','octaface']                
                 new_geodesic = geodesic_classes_259.octaface(parameters)
-        elif which_geodesic == 'Icosahedron':       
+        elif which_geodesic == 'Icosahedron':
             if which_orientation == "PointUp":
+                geodesic_choice = ['Geodesic','icosahedron']                
                 new_geodesic = geodesic_classes_259.icosahedron(parameters)
             elif which_orientation == "EdgeUp":
+                geodesic_choice = ['Geodesic','icoedge']                
                 new_geodesic = geodesic_classes_259.icoedge(parameters)
             else:
+                geodesic_choice = ['Geodesic','icoface']                
                 new_geodesic = geodesic_classes_259.icoface(parameters)
         new_geodesic.config()
         new_geodesic.connectivity()
+        print("\nDBG>>>>>>>> geodesic_choice",geodesic_choice)
+
+        tmp = [el for el in new_geodesic.PKHG_parameters]
+#        created_vefm_mesh_values = geodesic_choice.extend(tmp)
+        created_vefm_mesh_values = [geodesic_choice,tmp]
+        print("\n*DBG geodesic created_vefm_mesh_values =",created_vefm_mesh_values)
         dual = False #PKHG TODO 31-10-2011
         if dual:
             if frequency == 1 and not(which_geodesic == 'Icosahedron'):
@@ -379,7 +395,7 @@
         row.prop(self,"torus_yscale")
         
     def execute(self,context):
-        global superformparam, created_vefm_mesh_values
+        global superformparam, created_vefm_mesh_values, last_generated_object
 #        [1, 1.0, 1.0, 1.0, 2.0, 2.0, 0, 0, 5, 0, 0, 0.0, 0.0, 0]
         superformparam = [3, 1.0, 1.0, 1.0, 1.0, 1.0, 4, 1.0, 1.0, 1.0, 1.0, 1.0, False, False, 0.0, 0.0, 0.0, 0.0]
         torus = forms_259.torus(self.torus_uresolution,self.torus_vresolution,self.torus_uscale,self.torus_vscale,self.torus_upart,self.torus_vpart,self.torus_uphase,self.torus_vphase,self.torus_utwist,self.torus_vtwist,self.torus_xscale,self.torus_yscale,superformparam)
@@ -435,7 +451,7 @@
         row.prop(self,"sphere_yscale")
         
     def execute(self,context):
-        global superformparam, created_vefm_mesh_values
+        global superformparam, created_vefm_mesh_values, last_generated_object
 #        [1, 1.0, 1.0, 1.0, 2.0, 2.0, 0, 0, 5, 0, 0, 0.0, 0.0, 0]
         superformparam = [3, 1.0, 1.0, 1.0, 1.0, 1.0, 4, 1.0, 1.0, 1.0, 1.0, 1.0, False, False, 0.0, 0.0, 0.0, 0.0]
         sphere = forms_259.sphere(self.sphere_uresolution,self.sphere_vresolution,self.sphere_uscale,self.sphere_vscale,self.sphere_upart,self.sphere_vpart,self.sphere_uphase,self.sphere_vphase,self.sphere_utwist,self.sphere_vtwist,self.sphere_xscale,self.sphere_yscale,superformparam)
@@ -445,26 +461,26 @@
         bpy.context.active_object.location = (0,0,0)
         return {'FINISHED'} 
 
-class AddParabol(bpy.types.Operator):
-    bl_idname = "mesh.add_pkhgparabol"
-    bl_label = "PKHG Parabol"
+class AddParabola(bpy.types.Operator):
+    bl_idname = "mesh.add_pkhgparabola"
+    bl_label = "PKHG Parabola"
     bl_options = {'REGISTER','UNDO'}
     
-    parabol_uresolution = IntProperty(name = 'uresolution', min = 2, soft_min = 4, soft_max = 24, max = 36, default =  8) #PKHG 23 oct needed for parabol
-    parabol_vresolution = IntProperty(name = 'vresolution', min = 2, soft_min = 4, soft_max = 24, max = 36, default =  6)
+    parabola_uresolution = IntProperty(name = 'uresolution', min = 2, soft_min = 4, soft_max = 24, max = 36, default =  8) #PKHG 23 oct needed for parabola
+    parabola_vresolution = IntProperty(name = 'vresolution', min = 2, soft_min = 4, soft_max = 24, max = 36, default =  6)
     
-    parabol_uscale = FloatProperty(name = 'small radius', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default = .25)   #seams to be scaling from center in r direction
-    parabol_vscale = FloatProperty(name = 'big radius', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)    #expand and shift get factor vscale
-    parabol_upart = FloatProperty(name = 'upart(gap)', min = -4, soft_min = 0, soft_max = 1 ,max = 4, default =  1)  #PKHG default no u-gap
-    parabol_vpart = FloatProperty(name = 'vpart(gap)', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  1)  #PKHG defalut: no v-gap
-    parabol_uphase = FloatProperty(name = 'uphase', min = -4, soft_min = 0, soft_max = 1 ,max = 4, default =  1) 
-    parabol_vphase = FloatProperty(name = 'vphase', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  1) 
-    parabol_utwist = FloatProperty(name = 'utwist', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  0) 

@@ Diff output truncated at 10240 characters. @@


More information about the Bf-extensions-cvs mailing list