[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2540] branches/geodesic_domes/ geodesic_259.py: After first creation of any object (has to be adjusted!)

Peter K.H. Gragert pkhgragert at gmail.com
Fri Oct 28 09:01:20 CEST 2011


Revision: 2540
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2540
Author:   pkhg
Date:     2011-10-28 07:01:20 +0000 (Fri, 28 Oct 2011)
Log Message:
-----------
After first creation of any object (has to be adjusted!)
in the UI of View3D action buttons will occur.
The Sform parameter will be available after the creation
of a torus, sphere, grid, cylinder, parabola and creates an object with the same size of the last created object.

 

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

Modified: branches/geodesic_domes/geodesic_259.py
===================================================================
--- branches/geodesic_domes/geodesic_259.py	2011-10-28 06:57:55 UTC (rev 2539)
+++ branches/geodesic_domes/geodesic_259.py	2011-10-28 07:01:20 UTC (rev 2540)
@@ -7,6 +7,8 @@
 from geodesic_domes import vefm_259 as vefm_259
 from geodesic_domes import geodesic_classes_259 as geodesic_classes_259
 
+created_vefm_mesh_values = None
+
 superformparam = []
 def check_contains(cl,name , print_value = False):
     dir_class = dir(cl)
@@ -26,9 +28,6 @@
 #    from geodesic_domes import forms_259  as forms_259
 #    from geodesic_domes import vefm_259 as vefm_259
 #    from geodesic_domes import geodesic_classes_259 as geodesic_classes_259
-
-    chosen_type = get_chosen_type(context)
-    print("\n***INFO*** geodesic_259 generate*** type chosen = ", chosen_type)
     um = context.scene.superformula_um
     un1 = context.scene.superformula_un1
     un2 = context.scene.superformula_un2
@@ -47,9 +46,10 @@
     vturn = context.scene.superformula_vturn
     utwist = context.scene.superformula_utwist
     vtwist = context.scene.superformula_vtwist
- 
     superformparam=[um,un1,un2,un3,ua,ub,vm,vn1,vn2,vn3,va,vb,uact,vact,uturn*math.pi,vturn*(math.pi),utwist,vtwist]
-    print("***info geodesic_259.generate***  \nsuperformparam = ",superformparam)    
+    chosen_type = get_chosen_type(context)
+    print("***INFO generate*** ,chosen:",chosen_type, " \nsuperformparam = ",superformparam)    
+   
 #startvaule 2.49
 #???PKHG TODO
     if chosen_type == 'Geodesic':
@@ -158,17 +158,20 @@
 
 def get_chosen_type(context):
     chosen_type = context.scene.choose_type
+    print("\n***INFO*** >>>>>chosen type =",chosen_type)
     posible_types = {'0':'Geodesic',
                '1':'Grid',
                '2':'Cylinder',
                '3':'Parabola',
                '4':'Torus',
                '5':'Sphere',
-               '6':'Your mesh'}
+               '6':'Your mesh',
+               '7':'Apply sform',      
+                     }    
     result = posible_types[chosen_type]
     return result
 
-'''
+''' PKHF??? needed? not  yet
 def get_parameter_of_chosen_type(chosen_type):
     #parameter = [(0,)*14]
     result = [(0,)*14]
@@ -253,11 +256,15 @@
     torus_vtwist = FloatProperty(name = 'vtwist', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  0) 
     torus_xscale = FloatProperty(name = 'xscale', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)  #scale in x direction
     torus_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
+    torus_uactive = BoolProperty(name = 'sup u-active',default = True)
+    torus_vactive =  BoolProperty(name = 'sup v-active',default = False)
     
     def execute(self,context):
-        global superformparam
+        global superformparam, created_vefm_mesh_values
         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)
+        created_vefm_mesh_values = ['Torus',torus.ures,torus.vres,torus.uscale,torus.vscale,torus.upart,torus.vpart,torus.uphase,torus.vphase,torus.utwist,torus.vtwist,torus.xscale,torus.yscale,superformparam]             
         add_object(torus)
+        print("\n>>>>>>>>debug, created_vefm_mesh_values",created_vefm_mesh_values," generated")
         return {'FINISHED'}
     
 def torus_menu_func(self, context):
@@ -268,7 +275,7 @@
     bl_label = "PKHG Cylinder"
     bl_options = {'REGISTER','UNDO'}
     cylinder_uresolution = IntProperty(name = 'uresolution', min = 2, soft_min = 4, soft_max=24, max = 36, default =  12) #PKHG 23 oct needed for cylinder
-    cylinder_vresolution = IntProperty(name = 'vresolution', min = 2, soft_max=5, max = 10, default =  4) 
+    cylinder_vresolution = IntProperty(name = 'vresolution', min = 2, soft_max=4, max = 36, default =  12) 
     cylinder_uscale = FloatProperty(name = 'radius', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)   #seams to be scaling from center in r direction
     cylinder_vscale = FloatProperty(name = 'height', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)    #expand and shift get factor vscale
     cylinder_upart = FloatProperty(name = 'upart(gap)', min = -4, soft_min = 0, soft_max = 1 ,max = 4, default =  1)  #PKHG default no u-gap
@@ -281,8 +288,9 @@
     cylinder_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
 
     def execute(self,context):
-        global superformparam
+        global superformparam, created_vefm_mesh_values
         cylinder = forms_259.cylinder(self.cylinder_uresolution,self.cylinder_vresolution,self.cylinder_uscale,self.cylinder_vscale,self.cylinder_upart,self.cylinder_vpart,self.cylinder_uphase,self.cylinder_vphase,self.cylinder_utwist,self.cylinder_vtwist,self.cylinder_xscale,self.cylinder_yscale,superformparam)
+        created_vefm_mesh_values = ['Cylinder',cylinder.ures,cylinder.vres,cylinder.uscale,cylinder.vscale,cylinder.upart,cylinder.vpart,cylinder.uphase,cylinder.vphase,cylinder.utwist,cylinder.vtwist,cylinder.xscale,cylinder.yscale,superformparam]                     
         add_object(cylinder)
         return {'FINISHED'}
 
@@ -294,8 +302,8 @@
     bl_idname = "mesh.add_pkhgparabola"
     bl_label = "PKHG Parabola"
     bl_options = {'REGISTER','UNDO'}
-    parabola_uresolution = IntProperty(name = 'uresolution', min = 2, soft_min = 4, soft_max = 24, max = 36, default =  12) #PKHG 23 oct needed for parabola
-    parabola_vresolution = IntProperty(name = 'vresolution', min = 2, soft_max = 12, max = 24, default =  6) 
+    parabola_uresolution = IntProperty(name = 'uresolution', min = 2, soft_min = 4, soft_max = 24, max = 36, default =  16) #PKHG 23 oct needed for parabola
+    parabola_vresolution = IntProperty(name = 'vresolution', min = 2, soft_max = 24, max = 36, default =  16) 
     parabola_uscale = FloatProperty(name = 'radius', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)   #seams to be scaling from center in r direction
     parabola_vscale = FloatProperty(name = 'height', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  2)    #expand and shift get factor vscale
     parabola_upart = FloatProperty(name = 'upart(gap)', min = -4, soft_min = 0, soft_max = 1 ,max = 4, default =  1)  #PKHG default no u-gap
@@ -308,8 +316,9 @@
     parabola_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
     
     def execute(self,context):
-        global superformparam
+        global superformparam, created_vefm_mesh_values
         parabola = forms_259.parabola(self.parabola_uresolution,self.parabola_vresolution,self.parabola_uscale,self.parabola_vscale,self.parabola_upart,self.parabola_vpart,self.parabola_uphase,self.parabola_vphase,self.parabola_utwist,self.parabola_vtwist,self.parabola_xscale,self.parabola_yscale,superformparam)
+        created_vefm_mesh_values = ['Parabola',parabola.ures,parabola.vres,parabola.uscale,parabola.vscale,parabola.upart,parabola.vpart,parabola.uphase,parabola.vphase,parabola.utwist,parabola.vtwist,parabola.xscale,parabola.yscale,superformparam]                     
         add_object(parabola)
         return {'FINISHED'}
     
@@ -337,18 +346,19 @@
     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
     
     def execute(self,context):
-        global superformparam
+        global superformparam, created_vefm_mesh_values
         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)
+        created_vefm_mesh_values = ['Sphere',sphere.ures,sphere.vres,sphere.uscale,sphere.vscale,sphere.upart,sphere.vpart,sphere.uphase,sphere.vphase,sphere.utwist,sphere.vtwist,sphere.xscale,sphere.yscale,superformparam]             
         add_object(sphere)
         return {'FINISHED'}
     
 def sphere_menu_func(self, context):
     self.layout.operator(AddSphere.bl_idname, icon='MESH_CUBE')
 
-#Plane
 
-#Sphere
 
+#Grid
+
 class AddGrid(bpy.types.Operator):
     bl_idname = "mesh.add_pkhgplane"
     bl_label = "PKHG Plane"
@@ -359,15 +369,95 @@
     grid_ysize = FloatProperty(name="Y size",min = 1, soft_min=0.1, soft_max=5,max = 10, default = 1.0)
     
     def execute(self,context):
-        global superformparam
-        grid=forms_259.grid(self.grid_xres,self.grid_yres,self.grid_xsize,self.grid_ysize,1.0,1.0,0,0,0,0,1.0,1.0,superformparam)        
+        global superformparam, created_vefm_mesh_values
+        grid=forms_259.grid(self.grid_xres,self.grid_yres,self.grid_xsize,self.grid_ysize,1.0,1.0,0,0,0,0,1.0,1.0,superformparam)
+        created_vefm_mesh_values = ['Grid',grid.ures,grid.vres,grid.uscale,grid.vscale,1.0,1.0,0,0,0,0,1.0,1.0,superformparam]             
+        
         add_object(grid)
         return {'FINISHED'}
     
 def grid_menu_func(self, context):
     self.layout.operator(AddGrid.bl_idname, icon='MESH_CUBE')
 
+class ApplySform(bpy.types.Operator):
+    bl_idname = "mesh.apply_sform"
+    bl_label = "PKHG Apply sform"
+    bl_options = {'REGISTER','UNDO'}
+    um = FloatProperty(name = 'um', min = 0, soft_min=0.1, soft_max=5,max = 10, default =  3)
+    un1 = FloatProperty(name = 'un1', min = 0, soft_min=0.1, soft_max=5,max = 20, default =  10)
+    un2 = FloatProperty(name = 'un2', min = 0, soft_min=0.1, soft_max=5,max = 10, default =  10)
+    un3 = FloatProperty(name = 'un3', min = 0,   soft_min=0.1, soft_max=5,max = 10, default =  1)
+    ua = FloatProperty(name = 'ua', min = 0, soft_min=0.1, soft_max=5,max = 10, default =  1.0)
+    ub = FloatProperty(name = 'ub', min = 0, soft_min=0.1, soft_max=5,max = 10, default =  4.0)

@@ Diff output truncated at 10240 characters. @@


More information about the Bf-extensions-cvs mailing list