[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2568] branches/geodesic_domes/gui_pkhg .py: Cleaned up and a memory is built in if one creates the same

Peter K.H. Gragert pkhgragert at gmail.com
Wed Nov 2 15:55:25 CET 2011


Revision: 2568
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2568
Author:   pkhg
Date:     2011-11-02 14:55:24 +0000 (Wed, 02 Nov 2011)
Log Message:
-----------
Cleaned up and a memory is built in if one creates the same
object one after the other (because of X, deleting or Tab editing)

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

Modified: branches/geodesic_domes/gui_pkhg.py
===================================================================
--- branches/geodesic_domes/gui_pkhg.py	2011-11-02 14:53:55 UTC (rev 2567)
+++ branches/geodesic_domes/gui_pkhg.py	2011-11-02 14:55:24 UTC (rev 2568)
@@ -1,15 +1,12 @@
-#pkhg_test version created_vefm_mesh_values
+#pkhg new gui 2011-11-02
 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
-#from geodesic_domes import vefm_259 as vefm_259
 from geodesic_domes import geodesic_classes_259 as geodesic_classes_259
 import math
-from math import pi,cos, sin, sqrt
+from math import pi #,cos, sin, sqrt
 from bpy.props import EnumProperty, IntProperty, FloatProperty, StringProperty, BoolProperty
 created_vefm_mesh_values = None
 
@@ -34,71 +31,6 @@
 #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)
-bpy.types.Scene.grid_xsize = FloatProperty(name = "X size", min = 1, soft_min=0.1, soft_max=5,max = 10, default = 2.0)
-bpy.types.Scene.grid_ysize = FloatProperty(name="Y size",min = 1, soft_min=0.1, soft_max=5,max = 10, default = 1.0)
-
-#for Cylinder
-bpy.types.Scene.cylinder_uresolution = IntProperty(name = 'uresolution', min = 2, soft_min = 4, soft_max=24, max = 36, default =  12) #PKHG 23 oct needed for cylinder
-bpy.types.Scene.cylinder_vresolution = IntProperty(name = 'vresolution', min = 2, soft_max=5, max = 10, default =  4) 
-bpy.types.Scene.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
-bpy.types.Scene.cylinder_vscale = FloatProperty(name = 'height', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)    #expand and shift get factor vscale
-bpy.types.Scene.cylinder_upart = FloatProperty(name = 'upart(gap)', min = -4, soft_min = 0, soft_max = 1 ,max = 4, default =  1)  #PKHG default no u-gap
-bpy.types.Scene.cylinder_vpart = FloatProperty(name = 'vpart(gap)', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  1)  #PKHG defalut: no v-gap
-bpy.types.Scene.cylinder_uphase = FloatProperty(name = 'uphase', min = -4, soft_min = 0, soft_max = 1 ,max = 4, default =  1) 
-bpy.types.Scene.cylinder_vphase = FloatProperty(name = 'vphase', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  1) 
-bpy.types.Scene.cylinder_utwist = FloatProperty(name = 'utwist', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  0) 
-bpy.types.Scene.cylinder_vtwist = FloatProperty(name = 'vtwist', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  0) 
-bpy.types.Scene.cylinder_xscale = FloatProperty(name = 'xscale', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)  #scale in x direction
-bpy.types.Scene.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
-
-#for Parabola
-bpy.types.Scene.parabola_uresolution = IntProperty(name = 'uresolution', min = 2, soft_min = 4, soft_max = 24, max = 36, default =  12) #PKHG 23 oct needed for parabola
-bpy.types.Scene.parabola_vresolution = IntProperty(name = 'vresolution', min = 2, soft_max = 12, max = 24, default =  6) 
-bpy.types.Scene.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
-bpy.types.Scene.parabola_vscale = FloatProperty(name = 'height', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  2)    #expand and shift get factor vscale
-bpy.types.Scene.parabola_upart = FloatProperty(name = 'upart(gap)', min = -4, soft_min = 0, soft_max = 1 ,max = 4, default =  1)  #PKHG default no u-gap
-bpy.types.Scene.parabola_vpart = FloatProperty(name = 'vpart(gap)', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  1)  #PKHG defalut: no v-gap
-bpy.types.Scene.parabola_uphase = FloatProperty(name = 'uphase', min = -4, soft_min = 0, soft_max = 1 ,max = 4, default =  0) 
-bpy.types.Scene.parabola_vphase = FloatProperty(name = 'vphase', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  0) 
-bpy.types.Scene.parabola_utwist = FloatProperty(name = 'utwist', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  0) 
-bpy.types.Scene.parabola_vtwist = FloatProperty(name = 'vtwist', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  0) 
-bpy.types.Scene.parabola_xscale = FloatProperty(name = 'xscale', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)  #scale in x direction
-bpy.types.Scene.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
-
-#for torus
-bpy.types.Scene.torus_uresolution = IntProperty(name = 'uresolution', min = 2, soft_min = 4, soft_max = 24, max = 36, default =  12) #PKHG 23 oct needed for torus
-bpy.types.Scene.torus_vresolution = IntProperty(name = 'vresolution', min = 2, soft_min = 4, soft_max = 24, max = 36, default =  12) 
-bpy.types.Scene.torus_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
-bpy.types.Scene.torus_vscale = FloatProperty(name = 'big radius', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)    #expand and shift get factor vscale
-bpy.types.Scene.torus_upart = FloatProperty(name = 'upart(gap)', min = -4, soft_min = 0, soft_max = 1 ,max = 4, default =  1)  #PKHG default no u-gap
-bpy.types.Scene.torus_vpart = FloatProperty(name = 'vpart(gap)', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  1)  #PKHG defalut: no v-gap
-bpy.types.Scene.torus_uphase = FloatProperty(name = 'uphase', min = -4, soft_min = 0, soft_max = 1 ,max = 4, default =  1) 
-bpy.types.Scene.torus_vphase = FloatProperty(name = 'vphase', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  1) 
-bpy.types.Scene.torus_utwist = FloatProperty(name = 'utwist', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  0) 
-bpy.types.Scene.torus_vtwist = FloatProperty(name = 'vtwist', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  0) 
-bpy.types.Scene.torus_xscale = FloatProperty(name = 'xscale', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)  #scale in x direction
-bpy.types.Scene.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
-#usuper,vsuper,usupertwist,vsupertwist needed! ???PKHG not needed?
-
-#for sphere
-bpy.types.Scene.sphere_uresolution = IntProperty(name = 'uresolution', min = 2, soft_min = 4, soft_max=24, max = 36, default =  12) #PKHG 23 oct needed for sphere
-bpy.types.Scene.sphere_vresolution = IntProperty(name = 'vresolution', min = 2, soft_min = 4, soft_max = 24, max = 36, default =  12) 
-bpy.types.Scene.sphere_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
-bpy.types.Scene.sphere_vscale = FloatProperty(name = 'height', min = 0, soft_min = 0.1, soft_max = 4, max = 10, default =  1)    #expand and shift get factor vscale
-bpy.types.Scene.sphere_upart = FloatProperty(name = 'upart(gap)', min = -4, soft_min = 0, soft_max = 1 ,max = 4, default =  1)  #PKHG default no u-gap
-bpy.types.Scene.sphere_vpart = FloatProperty(name = 'vpart(gap)', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  1)  #PKHG defalut: no v-gap
-bpy.types.Scene.sphere_uphase = FloatProperty(name = 'uphase', min = -4, soft_min = 0, soft_max = 1 ,max = 4, default =  1) 
-bpy.types.Scene.sphere_vphase = FloatProperty(name = 'vphase', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  1) 
-bpy.types.Scene.sphere_utwist = FloatProperty(name = 'utwist', min = -4, soft_min = 0, soft_max = 1, max = 4, default =  0) 
-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",
@@ -108,7 +40,7 @@
     name="Class nr 2",
     description="Class nr 2",
     default=False)
-    
+
 bpy.types.Scene.geodesic_dual = BoolProperty(
     name="Dual",
     description="Dual object",
@@ -138,7 +70,7 @@
            ("7","Apply sform","Apply superform parameter"),
           ],
     default='0')
-    
+
 bpy.types.Scene.base_type = EnumProperty(
     name="BaseType",
     description="Choose between Tetrahedron, Octahedron, Icosahedron ",
@@ -147,6 +79,7 @@
            ("2","Icosahedron","Generate Icosahedron"),
           ],
     default='0')
+
 bpy.types.Scene.orientation = EnumProperty(
     name="Pointer",
     description="Choose what type of top ",
@@ -154,7 +87,7 @@
            ("1","EdgeUp","Edge up"),
            ("2","FaceUp","Face up"),
            ],
-    default='0')    
+    default='0')
 
 def get_chosen_type(context):
     chosen_type = context.scene.choose_type
@@ -165,22 +98,59 @@
                '4':'Torus',
                '5':'Sphere',
                '6':'Your mesh',
-               '7':'Apply sform',      
-                     }    
+               '7':'Apply sform',
+                     }
     result = posible_types[chosen_type]
     print("\n***INFO*** >>>>>chosen type =",result)
     return result
 
-
-
 class Geodesic_Domes_panel(bpy.types.Panel):
     """show in the UI"""
     bl_label = "Geodesic Domes"
     bl_region_type = "TOOLS"

@@ Diff output truncated at 10240 characters. @@


More information about the Bf-extensions-cvs mailing list