[Bf-extensions-cvs] [eb289e8d] master: 3D-Print: reorganize UI panels

Mikhail Rachinskiy noreply at git.blender.org
Mon Oct 7 19:35:08 CEST 2019


Commit: eb289e8d5ab4470da206769f50e2fc813502e549
Author: Mikhail Rachinskiy
Date:   Mon Oct 7 21:34:46 2019 +0400
Branches: master
https://developer.blender.org/rBAeb289e8d5ab4470da206769f50e2fc813502e549

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.

===================================================================

M	object_print3d_utils/__init__.py
M	object_print3d_utils/ui.py

===================================================================

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



More information about the Bf-extensions-cvs mailing list