From 1e7a51e7f0d4704e7f2e19f0a989becdec95f506 Mon Sep 17 00:00:00 2001 From: Brendon Murphy <meta.androcto1@gmail.com> Date: Wed, 2 May 2012 15:04:40 +0000 Subject: [PATCH] clean up menu --- add_mesh_extra_objects/__init__.py | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/add_mesh_extra_objects/__init__.py b/add_mesh_extra_objects/__init__.py index adead243c..feca76124 100644 --- a/add_mesh_extra_objects/__init__.py +++ b/add_mesh_extra_objects/__init__.py @@ -67,14 +67,9 @@ class INFO_MT_mesh_extras_add(bpy.types.Menu): layout.menu("INFO_MT_mesh_gears_add", text="Gears") layout.menu("INFO_MT_mesh_math_add", text="Math Function") layout.menu("INFO_MT_mesh_basic_add", text="Basic Objects") - layout.operator("mesh.primitive_twisted_torus_add", - text="Twisted Torus") - layout.operator("mesh.primitive_polysphere_add", - text="Polysphere") - layout.operator("mesh.primitive_supertoroid_add", - text="Supertoroid") + layout.menu("INFO_MT_mesh_torus_add", text="Torus Objects") layout.operator("mesh.primitive_steppyramid_add", - text="Pyramid") + text="Step Pyramid") class INFO_MT_mesh_gemstones_add(bpy.types.Menu): # Define the "Gemstones" menu @@ -131,6 +126,21 @@ class INFO_MT_mesh_basic_add(bpy.types.Menu): text="Star") layout.operator("mesh.primitive_trapezohedron_add", text="Trapezohedron") + layout.operator("mesh.primitive_polysphere_add", + text="Polysphere") + +class INFO_MT_mesh_torus_add(bpy.types.Menu): + # Define the "Simple Objects" menu + bl_idname = "INFO_MT_mesh_torus_add" + bl_label = "Torus Objects" + + def draw(self, context): + layout = self.layout + layout.operator_context = 'INVOKE_REGION_WIN' + layout.operator("mesh.primitive_twisted_torus_add", + text="Twisted Torus") + layout.operator("mesh.primitive_supertoroid_add", + text="Supertoroid") # Register all operators and panels -- GitLab