[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [1904] trunk/py/scripts/addons/ add_mesh_extra_objects/__init__.py: Added sub menus as per original scripts .

Brendon Murphy meta.androcto1 at gmail.com
Sun May 8 03:58:10 CEST 2011


Revision: 1904
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=1904
Author:   meta-androcto
Date:     2011-05-08 01:58:09 +0000 (Sun, 08 May 2011)
Log Message:
-----------
Added sub menus as per original scripts.
rearranged layout so everything is cleaner.

Modified Paths:
--------------
    trunk/py/scripts/addons/add_mesh_extra_objects/__init__.py

Modified: trunk/py/scripts/addons/add_mesh_extra_objects/__init__.py
===================================================================
--- trunk/py/scripts/addons/add_mesh_extra_objects/__init__.py	2011-05-07 18:58:04 UTC (rev 1903)
+++ trunk/py/scripts/addons/add_mesh_extra_objects/__init__.py	2011-05-08 01:58:09 UTC (rev 1904)
@@ -57,6 +57,11 @@
     def draw(self, context):
         layout = self.layout
         layout.operator_context = 'INVOKE_REGION_WIN'
+        layout.menu("INFO_MT_mesh_gemstones_add", text="Gemstones")
+        layout.menu("INFO_MT_mesh_gears_add", text="Gears")
+        layout.menu("INFO_MT_mesh_math_add", text="Math Function")
+        layout.operator("mesh.primitive_twisted_torus_add",
+            text="Twisted Torus")
         layout.operator("mesh.primitive_sqorus_add",
             text="Sqorus")
         layout.operator("mesh.primitive_wedge_add")
@@ -64,16 +69,42 @@
             text="Star")
         layout.operator("mesh.primitive_trapezohedron_add",
             text="Trapezohedron")
-        layout.operator("mesh.primitive_twisted_torus_add",
-            text="Twisted Torus")
+
+class INFO_MT_mesh_gemstones_add(bpy.types.Menu):
+    # Define the "Gemstones" menu
+    bl_idname = "INFO_MT_mesh_gemstones_add"
+    bl_label = "Gemstones"
+
+    def draw(self, context):
+        layout = self.layout
+        layout.operator_context = 'INVOKE_REGION_WIN'
         layout.operator("mesh.primitive_diamond_add",
             text="Diamond")
         layout.operator("mesh.primitive_gem_add",
             text="Gem")
+
+			
+class INFO_MT_mesh_gears_add(bpy.types.Menu):
+    # Define the "Gears" menu
+    bl_idname = "INFO_MT_mesh_gears_add"
+    bl_label = "Gears"
+
+    def draw(self, context):
+        layout = self.layout
+        layout.operator_context = 'INVOKE_REGION_WIN'
         layout.operator("mesh.primitive_gear",
             text="Gear")
         layout.operator("mesh.primitive_worm_gear",
             text="Worm")
+
+class INFO_MT_mesh_math_add(bpy.types.Menu):
+    # Define the "Math Function" menu
+    bl_idname = "INFO_MT_mesh_math_add"
+    bl_label = "Math Functions"
+
+    def draw(self, context):
+        layout = self.layout
+        layout.operator_context = 'INVOKE_REGION_WIN'
         layout.operator("mesh.primitive_z_function_surface",
             text="Z Math Surface")
         layout.operator("mesh.primitive_xyz_function_surface",



More information about the Bf-extensions-cvs mailing list