diff options
author | Mikhail Rachinskiy <mikhail.rachinskiy@gmail.com> | 2019-10-07 20:34:46 +0300 |
---|---|---|
committer | Mikhail Rachinskiy <mikhail.rachinskiy@gmail.com> | 2019-10-07 20:34:46 +0300 |
commit | eb289e8d5ab4470da206769f50e2fc813502e549 (patch) | |
tree | 069e49d4f6f88d8b1769f71ef5c87e8f819dd70d /object_print3d_utils | |
parent | 6192317056ee8196d496decf6536e456917e9c36 (diff) |
3D-Print: reorganize UI panels
Since add-on has its own tab there is no reason for using subpanels. Move Scale To tools into Transform panel. Various name changes: change top panel title to Analyze, Cleanup > Clean Up, Modify > Transform, Report > Result.
Diffstat (limited to 'object_print3d_utils')
-rw-r--r-- | object_print3d_utils/__init__.py | 3 | ||||
-rw-r--r-- | object_print3d_utils/ui.py | 30 |
2 files changed, 19 insertions, 14 deletions
diff --git a/object_print3d_utils/__init__.py b/object_print3d_utils/__init__.py index 89fe894a..9147bb08 100644 --- a/object_print3d_utils/__init__.py +++ b/object_print3d_utils/__init__.py @@ -128,8 +128,9 @@ class SceneProperties(PropertyGroup): classes = ( SceneProperties, - ui.VIEW3D_PT_print3d, + ui.VIEW3D_PT_print3d_analyze, ui.VIEW3D_PT_print3d_cleanup, + ui.VIEW3D_PT_print3d_transform, ui.VIEW3D_PT_print3d_export, operators.MESH_OT_print3d_info_volume, diff --git a/object_print3d_utils/ui.py b/object_print3d_utils/ui.py index a6d5e716..e9a7f039 100644 --- a/object_print3d_utils/ui.py +++ b/object_print3d_utils/ui.py @@ -26,12 +26,15 @@ import bmesh from . import report -class VIEW3D_PT_print3d(Panel): - bl_label = "3D-Print" +class Setup: bl_category = "3D-Print" bl_space_type = 'VIEW_3D' bl_region_type = 'UI' + +class VIEW3D_PT_print3d_analyze(Panel, Setup): + bl_label = "Analyze" + _type_to_icon = { bmesh.types.BMVert: 'VERTEXSEL', bmesh.types.BMEdge: 'EDGESEL', @@ -50,7 +53,7 @@ class VIEW3D_PT_print3d(Panel): if info: is_edit = context.edit_object is not None - layout.label(text="Report") + layout.label(text="Result") box = layout.box() col = box.column() @@ -97,19 +100,15 @@ class VIEW3D_PT_print3d(Panel): self.draw_report(context) -class VIEW3D_PT_print3d_cleanup(Panel): - bl_label = "Cleanup & Modify" - bl_space_type = 'VIEW_3D' - bl_region_type = 'UI' +class VIEW3D_PT_print3d_cleanup(Panel, Setup): + bl_label = "Clean Up" bl_options = {"DEFAULT_CLOSED"} - bl_parent_id = "VIEW3D_PT_print3d" def draw(self, context): layout = self.layout print_3d = context.scene.print_3d - layout.label(text="Cleanup") col = layout.column(align=True) col.operator("mesh.print3d_clean_isolated", text="Isolated") row = col.row(align=True) @@ -119,18 +118,23 @@ class VIEW3D_PT_print3d_cleanup(Panel): # XXX TODO # layout.operator("mesh.print3d_clean_thin", text="Wall Thickness") + +class VIEW3D_PT_print3d_transform(Panel, Setup): + bl_label = "Transform" + bl_options = {"DEFAULT_CLOSED"} + + def draw(self, context): + layout = self.layout + layout.label(text="Scale To") row = layout.row(align=True) row.operator("mesh.print3d_scale_to_volume", text="Volume") row.operator("mesh.print3d_scale_to_bounds", text="Bounds") -class VIEW3D_PT_print3d_export(Panel): +class VIEW3D_PT_print3d_export(Panel, Setup): bl_label = "Export" - bl_space_type = 'VIEW_3D' - bl_region_type = 'UI' bl_options = {"DEFAULT_CLOSED"} - bl_parent_id = "VIEW3D_PT_print3d" def draw(self, context): layout = self.layout |