UI: Edit Mode Options panel cleanup
authorWilliam Reynish <billrey@me.com>
Tue, 21 May 2019 20:50:02 +0000 (22:50 +0200)
committerWilliam Reynish <billrey@me.com>
Tue, 21 May 2019 20:50:02 +0000 (22:50 +0200)
  - Move Live Unwrap to UV menu
  - Move Auto Merge Threshold into a sub-section of Auto Merge to make the relationships clearer

Differential Revision: https://developer.blender.org/D4919

Reviewers: Brecht Van Lommel, Pablo Vazquez

release/scripts/startup/bl_ui/space_view3d.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py

index 14c1666..63572c6 100644 (file)
@@ -949,9 +949,15 @@ class VIEW3D_MT_snap(Menu):
 class VIEW3D_MT_uv_map(Menu):
     bl_label = "UV Mapping"
 
-    def draw(self, _context):
+    def draw(self, context):
         layout = self.layout
 
+        tool_settings = context.tool_settings
+
+        layout.prop(tool_settings, "use_edge_path_live_unwrap")
+
+        layout.separator()
+
         layout.operator("uv.unwrap")
 
         layout.operator_context = 'INVOKE_DEFAULT'
index 2bfdc0e..2893ea7 100644 (file)
@@ -82,6 +82,7 @@ class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel):
     bl_category = "Tool"
     bl_context = ".mesh_edit"  # dot on purpose (access from topbar)
     bl_label = "Options"
+    bl_options = {'DEFAULT_CLOSED'}
 
     @classmethod
     def poll(cls, context):
@@ -94,8 +95,6 @@ class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel):
         layout.use_property_decorate = False
 
         ob = context.active_object
-
-        tool_settings = context.tool_settings
         mesh = ob.data
 
         col = layout.column(align=True)
@@ -105,10 +104,33 @@ class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel):
         row.active = ob.data.use_mirror_x
         row.prop(mesh, "use_mirror_topology")
 
-        layout.prop(tool_settings, "use_edge_path_live_unwrap")
-        layout.prop(tool_settings, "use_mesh_automerge", toggle=False)
 
-        layout.prop(tool_settings, "double_threshold")
+class VIEW3D_PT_tools_meshedit_options_automerge(View3DPanel, Panel):
+    bl_category = "Tool"
+    bl_context = ".mesh_edit"  # dot on purpose (access from topbar)
+    bl_label = "Auto Merge"
+    bl_parent_id = "VIEW3D_PT_tools_meshedit_options"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    @classmethod
+    def poll(cls, context):
+        return context.active_object
+
+    def draw_header(self, context):
+        tool_settings = context.tool_settings
+
+        self.layout.prop(tool_settings, "use_mesh_automerge", text="", toggle=False)
+
+    def draw(self, context):
+        layout = self.layout
+
+        tool_settings = context.tool_settings
+
+        layout.use_property_split = True
+        layout.use_property_decorate = False
+
+        layout.active = tool_settings.use_mesh_automerge
+        layout.prop(tool_settings, "double_threshold", text="Threshold")
 
 # ********** default tools for editmode_curve ****************
 
@@ -2071,6 +2093,7 @@ class VIEW3D_PT_gpencil_brush_presets(PresetPanel, Panel):
 
 classes = (
     VIEW3D_PT_tools_meshedit_options,
+    VIEW3D_PT_tools_meshedit_options_automerge,
     VIEW3D_PT_tools_curveedit_options_stroke,
     VIEW3D_PT_tools_armatureedit_options,
     VIEW3D_PT_tools_posemode_options,