From 9dd17998ca72cdc1abce8e9e9cff8b82798244e2 Mon Sep 17 00:00:00 2001 From: meta-androcto Date: Wed, 29 Jun 2016 13:37:54 +1000 Subject: discombobulator: remove panel, replace with menu item/pop up --- add_mesh_extra_objects/__init__.py | 1 + add_mesh_extra_objects/mesh_discombobulator.py | 36 +++++++++++++------------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/add_mesh_extra_objects/__init__.py b/add_mesh_extra_objects/__init__.py index 069a959c..df2531f3 100644 --- a/add_mesh_extra_objects/__init__.py +++ b/add_mesh_extra_objects/__init__.py @@ -221,6 +221,7 @@ def menu_func(self, context): self.layout.operator("mesh.primitive_round_cube_add", text="Round Cube", icon="MOD_SUBSURF") self.layout.menu("INFO_MT_mesh_math_add", text="Math Function", icon="PACKAGE") self.layout.operator("mesh.generate_geodesic_dome", text="Geodesic Dome",icon="MESH_ICOSPHERE") + self.layout.operator("discombobulate.ops", text="Discombobulator",icon="MESH_ICOSPHERE") self.layout.menu("INFO_MT_mesh_pipe_joints_add", text="Pipe Joints", icon="SNAP_PEEL_OBJECT") self.layout.menu("INFO_MT_mesh_gears_add", text="Gears", icon="SCRIPTWIN") self.layout.menu("INFO_MT_mesh_torus_add", text="Torus Objects", icon="MESH_TORUS") diff --git a/add_mesh_extra_objects/mesh_discombobulator.py b/add_mesh_extra_objects/mesh_discombobulator.py index 75f9381f..69e7a88c 100644 --- a/add_mesh_extra_objects/mesh_discombobulator.py +++ b/add_mesh_extra_objects/mesh_discombobulator.py @@ -563,31 +563,27 @@ class discombobulator(bpy.types.Operator): return {'FINISHED'} class discombob_help(bpy.types.Operator): - bl_idname = 'help.discombobulator' - bl_label = '' + bl_idname = 'help.discombobulator' + bl_label = '' - def draw(self, context): - layout = self.layout - layout.label('To use:') - layout.label('Works with Quads only not Ngons.') - layout.label('Select a face or faces') - layout.label('Press Discombobulate to create greebles') + def draw(self, context): + layout = self.layout + layout.label('To use:') + layout.label('Works with Quads only not Ngons.') + layout.label('Select a face or faces') + layout.label('Press Discombobulate to create greebles') - def execute(self, context): - return {'FINISHED'} + def execute(self, context): + return {'FINISHED'} - def invoke(self, context, event): - return context.window_manager.invoke_popup(self, width = 300) + def invoke(self, context, event): + return context.window_manager.invoke_popup(self, width = 300) -class VIEW3D_PT_tools_discombobulate(bpy.types.Panel): - bl_space_type = 'VIEW_3D' - bl_region_type = 'TOOLS' +class VIEW3D_PT_tools_discombobulate(bpy.types.Operator): + bl_idname = 'discombobulate.ops' bl_label = "Discombobulator" - bl_context = "objectmode" - bl_options = {'DEFAULT_CLOSED'} - bl_category = "Create" def draw(self, context): layout = self.layout @@ -640,7 +636,11 @@ class VIEW3D_PT_tools_discombobulate(bpy.types.Panel): row = box.row() row.prop(context.scene, "sideProtMat") row = box.row() + def execute(self, context): + return {'FINISHED'} + def invoke(self, context, event): + return context.window_manager.invoke_popup(self, width = 300) # registering and menu integration def register(): # Protusions Buttons: -- cgit v1.2.3