Sculpt: UI fixes and improvements
authorPablo Dobarro <pablodp606@gmail.com>
Thu, 26 Sep 2019 13:58:33 +0000 (15:58 +0200)
committerPablo Dobarro <pablodp606@gmail.com>
Thu, 26 Sep 2019 14:01:54 +0000 (16:01 +0200)
- Fix vertical spacing in grab brush grab active vertex option
- Move Remesher popover in the top bar to the right of Dyntopo
- Move topology automasking to the options subpanel
- Remove voxel remesher button from the topbar
- Add default shortcut to voxel remesher [Ctrl R]
- Add default shortcut to quadriflow [Ctrl Alt R]
- Add set pivot position operator to the sculpt menu

Reviewed By: billreynish

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

release/scripts/presets/keyconfig/keymap_data/blender_default.py
release/scripts/startup/bl_ui/space_view3d.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py

index 9dc23aaf22ef10afa409dd90d64d5693ba919745..c1d1d0c9915bbbc14c261dd16be31f06e11aac42 100644 (file)
@@ -3855,6 +3855,9 @@ def km_sculpt(params):
         # Dynamic topology
         ("sculpt.dynamic_topology_toggle", {"type": 'D', "value": 'PRESS', "ctrl": True}, None),
         ("sculpt.set_detail_size", {"type": 'D', "value": 'PRESS', "shift": True}, None),
+        # Remesh
+        ("object.voxel_remesh", {"type": 'R', "value": 'PRESS', "ctrl": True}, None),
+        ("object.quadriflow_remesh", {"type": 'R', "value": 'PRESS', "ctrl": True, "alt": True}, None),
         # Brush properties
         ("brush.scale_size", {"type": 'LEFT_BRACKET', "value": 'PRESS'},
          {"properties": [("scalar", 0.9)]}),
index 4a575a9ae8d2e6cda746023f92b4f82467110b65..aca8ea701ce82da5951e9bf23f3e4271603aff1a 100644 (file)
@@ -2898,6 +2898,31 @@ class VIEW3D_MT_sculpt(Menu):
 
         props = layout.operator("sculpt.dirty_mask", text='Dirty Mask')
 
+        layout.separator()
+        layout.menu("VIEW3D_MT_sculpt_set_pivot", text="Set Pivot")
+
+
+class VIEW3D_MT_sculpt_set_pivot(Menu):
+    bl_label = "Sculpt Set Pivot"
+
+    def draw(self, context):
+        layout = self.layout
+
+        props = layout.operator("sculpt.set_pivot_position", text="Pivot to Origin")
+        props.mode = 'ORIGIN'
+
+        props = layout.operator("sculpt.set_pivot_position", text="Pivot to Unmasked")
+        props.mode = 'UNMASKED'
+
+        props = layout.operator("sculpt.set_pivot_position", text="Pivot to Mask Border")
+        props.mode = 'BORDER'
+
+        props = layout.operator("sculpt.set_pivot_position", text="Pivot to Active Vertex")
+        props.mode = 'ACTIVE'
+
+        props = layout.operator("sculpt.set_pivot_position", text="Pivot to Surface Under Cursor")
+        props.mode = 'SURFACE'
+
 
 class VIEW3D_MT_particle(Menu):
     bl_label = "Particle"
@@ -6782,6 +6807,7 @@ classes = (
     VIEW3D_MT_gpencil_vertex_group,
     VIEW3D_MT_paint_weight,
     VIEW3D_MT_sculpt,
+    VIEW3D_MT_sculpt_set_pivot,
     VIEW3D_MT_particle,
     VIEW3D_MT_particle_context_menu,
     VIEW3D_MT_particle_showhide,
index 2fa9c26b7764a053f26455ea3361a7ee0831e15d..761b813d576ae025b51208890e672693dad303d3 100644 (file)
@@ -425,9 +425,6 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
                 row = col.row()
                 row.prop(brush, "elastic_deform_volume_preservation", slider=True)
 
-            col.separator()
-            row = col.row()
-            row.prop(brush, "use_automasking_topology")
 
             if brush.sculpt_tool == 'GRAB':
                 col.separator()
@@ -641,6 +638,7 @@ class VIEW3D_PT_tools_brush_options(Panel, View3DPaintPanel):
             brush_texpaint_common_options(self, context, layout, brush, settings, True)
 
         elif context.sculpt_object and brush:
+            col.prop(brush, "use_automasking_topology")
             if capabilities.has_accumulate:
                 col.prop(brush, "use_accumulate")
 
@@ -1228,15 +1226,6 @@ class VIEW3D_PT_sculpt_voxel_remesh(Panel, View3DPaintPanel):
     def poll(cls, context):
         return (context.sculpt_object and context.tool_settings.sculpt)
 
-    def draw_header(self, context):
-        is_popover = self.is_popover
-        layout = self.layout
-        layout.operator(
-            "object.voxel_remesh",
-            text="",
-            emboss=is_popover,
-        )
-
     def draw(self, context):
         layout = self.layout
         layout.use_property_split = True
@@ -2260,12 +2249,12 @@ classes = (
     VIEW3D_PT_tools_brush_display_custom_icon,
     VIEW3D_PT_sculpt_dyntopo,
     VIEW3D_PT_sculpt_dyntopo_remesh,
+    VIEW3D_PT_sculpt_voxel_remesh,
     VIEW3D_PT_sculpt_symmetry,
     VIEW3D_PT_sculpt_symmetry_for_topbar,
     VIEW3D_PT_sculpt_options,
     VIEW3D_PT_sculpt_options_unified,
     VIEW3D_PT_sculpt_options_gravity,
-    VIEW3D_PT_sculpt_voxel_remesh,
     VIEW3D_PT_tools_weightpaint_symmetry,
     VIEW3D_PT_tools_weightpaint_symmetry_for_topbar,
     VIEW3D_PT_tools_weightpaint_options,