[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2664] branches/geodesic_domes/ third_domes_panel.py: struts now shows the basicgedesic up to real activation

Peter K.H. Gragert pkhgragert at gmail.com
Sun Nov 27 10:41:37 CET 2011


Revision: 2664
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2664
Author:   pkhg
Date:     2011-11-27 09:41:36 +0000 (Sun, 27 Nov 2011)
Log Message:
-----------
struts now shows the basicgedesic up to real activation 

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

Modified: branches/geodesic_domes/third_domes_panel.py
===================================================================
--- branches/geodesic_domes/third_domes_panel.py	2011-11-27 09:40:42 UTC (rev 2663)
+++ branches/geodesic_domes/third_domes_panel.py	2011-11-27 09:41:36 UTC (rev 2664)
@@ -10,7 +10,7 @@
     breakpoint = bpy.types.bp.bp
 except:
     print("add breakpoint addon!")
-    pass    
+        
 
 #not needed 22-11 PKHG
 #def get_name_selected(value, dictionary):
@@ -260,6 +260,7 @@
     struttype= IntProperty(name="struttype", default= 0)
     struttoggle = BoolProperty(name="struttoggle", default = False )
     strutimporttoggle= BoolProperty(name="strutimporttoggle", default = False )
+#26-11 ???    strut_base_mesh = StringProperty(name = "
     strutimpmesh= StringProperty(name="strutimpmesh", default = "None")
     strutwidth= FloatProperty(name="strutwidth", min = 0.001, max = 4, default = 1 )
     swtog= BoolProperty(name="swtog", default = False )
@@ -276,7 +277,7 @@
     hubtoggle = BoolProperty(name ="hubtoggle", default = False )
     hubimporttoggle = BoolProperty(name="new import", description = "import a mesh", default = False )
     hubimpmesh = StringProperty(name="hubimpmesh",\
-                 description = "name of mesh to import",  default = "hub")
+                 description = "name of mesh to import",  default = "None")
     hubwidth = FloatProperty(name="hubwidth", min = 0.01, max = 10,\
                  default = 1 )
     hwtog = BoolProperty(name="hwtog", default = False )
@@ -449,12 +450,17 @@
 #PKHG_NOT_USDED_YET_24-11            row.prop(self, "hubtype")
             row = layout.row()            
 #25-11 not needed            row.prop(self, "hubimporttoggle")
-#            if self.hubimporttoggle:
-#                row.prop(self, "hubimpmesh")
-            row.prop(self,"hmeshname")
+            row = layout.row()
+            if self.hubimpmesh == "None":
+                row = layout.row()
+                row.label("name of a hub to use")
+            row.prop(self, "hubimpmesh")
+            row = layout.row()
             if self.hmeshname == "None":
                 row = layout.row()
                 row.label("name of mesh to be filled in!")
+
+            row.prop(self,"hmeshname")
             row = layout.row()
             row.prop(self, "hwtog")
             if self.hwtog:
@@ -467,11 +473,11 @@
             row.prop(self, "hublength")                
         elif which_mainpages == "Struts":
             row = layout.row()
-            row.prop(self, "struttype")
+#            row.prop(self, "struttype")
             row.prop(self, "struttoggle")
+#            row = layout.row()            
+#            row.prop(self, "strutimporttoggle")
             row = layout.row()            
-            row.prop(self, "strutimporttoggle")
-            row = layout.row()            
             row.prop(self, "strutimpmesh")
             row = layout.row()
             row.prop(self, "swtog")
@@ -678,11 +684,12 @@
             hublength = self.hublength
             hstog =  self.hstog
             hmeshname=  self.hmeshname
-            if not (hmeshname == "None") and hubtoggle:
+            if not (hmeshname == "None") and not (hubimpmesh == "None") and  hubtoggle:
                 try:                    
                     hub_obj = vefm_259.importmesh(hmeshname,0)
                     hub = vefm_259.hub(hub_obj, True,\
-                          hubwidth,hubheight,hublength,hwtog,hhtog,hstog,'hub')
+                            hubwidth, hubheight, hublength,\
+                              hwtog, hhtog, hstog, hubimpmesh)
                     mesh = vefm_259.mesh("test")
                     vefm_259.finalfill(hub,mesh)
                     vefm_259.vefm_add_object(mesh)
@@ -706,17 +713,19 @@
             lift = self.lift
             smeshname = self.smeshname
             if not (strutimpmesh == "None") and struttoggle:
-                try:
-                    strut_obj = vefm_259.importmesh(strutimpmesh,0)
-                    strut = vefm_259.strut(strut_obj, struttype,strutwidth,strutheight,stretch,swtog,shtog,swtog,'strut',sstog,lift)
+                names = [el.name for el in context.scene.objects]
+                if strutimpmesh in names and context.scene.objects[strutimpmesh].type == "MESH":
+                    strut = vefm_259.strut(basegeodesic, struttype,strutwidth,strutheight,stretch,swtog,shtog,swtog,strutimpmesh,sstog,lift)
                     strutmesh = vefm_259.mesh()
                     vefm_259.finalfill(strut,strutmesh)
                     vefm_259.vefm_add_object(strutmesh)
                     last_generated_object = context.active_object
+                    last_generated_object.name = smeshname
                     last_generated_object.location  = (0,0,0)
-                    
-                except:
-                    print("***ERROR*** strut nog niet ok??")
+                else:
+                    print("***ERROR*** strut obj is not a MESH")
+            else:
+                vefm_259.vefm_add_object(basegeodesic)
         elif self.mainpages == "Faces":
 #PKHG_DBG_OK            print("24-11 Faces activated")
             if self.facetoggle:



More information about the Bf-extensions-cvs mailing list