Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-05-31 20:00:24 +0300
committerHans Goudey <h.goudey@me.com>2022-05-31 20:00:24 +0300
commita1830859fa98d529a2eae709b2557a91f1bbe9e7 (patch)
tree7ae959d2351cfbabe0f28a6077096b197b3911c1 /release/scripts/startup/bl_ui/space_view3d.py
parent96f20ddc1e84e0f5036ea1bdda8381f037069f77 (diff)
Curves: Add soft selection in sculpt mode
This commit adds a float selection to curve control points or curves, a sculpt tool to paint the selection, and uses the selection influence in the existing sculpt brushes. The selection is the inverse of the "mask" from mesh sculpt mode currently. That change is described in more detail here: T97903 Since some sculpt tools are really "per curve" tools, they use the average point selection of all of their points. The delete brush considers a curve selected if any of its points have a non-zero selection. There is a new option to choose the selection domain, which affects how painting the selection works. You can also turn the selection off by clicking on the active domain. Sculpt brushes can be faster when the selection is small, because finding selected curves or points is generally faster than the existing brush intersection and distance checks. The main limitation currently is that we can't see the selection in the viewport by default. For now, to see the selection one has to add a simple material to the curves object as shown in the differential revision. And one has to switch to Material Preview in the 3d view. Differential Revision: https://developer.blender.org/D14934
Diffstat (limited to 'release/scripts/startup/bl_ui/space_view3d.py')
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 1af70895be9..116dd280b5c 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -535,6 +535,11 @@ class _draw_tool_settings_context_mode:
if brush.curves_sculpt_tool == 'DELETE':
layout.prop(brush, "falloff_shape", expand=True)
+ if brush.curves_sculpt_tool == 'SELECTION_PAINT':
+ layout.prop(brush, "direction", expand=True, text="")
+ layout.prop(brush, "falloff_shape", expand=True)
+ layout.popover("VIEW3D_PT_tools_brush_falloff")
+
class VIEW3D_HT_header(Header):
bl_space_type = 'VIEW_3D'
@@ -687,6 +692,24 @@ class VIEW3D_HT_header(Header):
if object_mode == 'PARTICLE_EDIT':
row = layout.row()
row.prop(tool_settings.particle_edit, "select_mode", text="", expand=True)
+ elif object_mode == 'SCULPT_CURVES' and obj.type == 'CURVES':
+ curves = obj.data
+
+ row = layout.row(align=True)
+
+ experimental = context.preferences.experimental
+ if experimental.use_new_curves_tools:
+ # Combine the "use selection" toggle with the "set domain" operators
+ # to allow turning selection off directly.
+ domain = curves.selection_domain
+ if domain == 'POINT':
+ row.prop(curves, "use_sculpt_selection", text="", icon='CURVE_BEZCIRCLE')
+ else:
+ row.operator("curves.set_selection_domain", text="", icon='CURVE_BEZCIRCLE').domain = 'POINT'
+ if domain == 'CURVE':
+ row.prop(curves, "use_sculpt_selection", text="", icon='CURVE_PATH')
+ else:
+ row.operator("curves.set_selection_domain", text="", icon='CURVE_PATH').domain = 'CURVE'
# Grease Pencil
if obj and obj.type == 'GPENCIL' and context.gpencil_data:
@@ -939,6 +962,7 @@ class VIEW3D_MT_editor_menus(Menu):
layout.menu("VIEW3D_MT_mask")
layout.menu("VIEW3D_MT_face_sets")
if mode_string == 'SCULPT_CURVES':
+ layout.menu("VIEW3D_MT_select_sculpt_curves")
layout.menu("VIEW3D_MT_sculpt_curves")
else:
@@ -1976,6 +2000,17 @@ class VIEW3D_MT_select_edit_curves(Menu):
pass
+class VIEW3D_MT_select_sculpt_curves(Menu):
+ bl_label = "Select"
+
+ def draw(self, _context):
+ layout = self.layout
+
+ layout.operator("sculpt_curves.select_all", text="All").action = 'SELECT'
+ layout.operator("sculpt_curves.select_all", text="None").action = 'DESELECT'
+ layout.operator("sculpt_curves.select_all", text="Invert").action = 'INVERT'
+
+
class VIEW3D_MT_angle_control(Menu):
bl_label = "Angle Control"
@@ -7703,6 +7738,7 @@ classes = (
VIEW3D_MT_select_paint_mask,
VIEW3D_MT_select_paint_mask_vertex,
VIEW3D_MT_select_edit_curves,
+ VIEW3D_MT_select_sculpt_curves,
VIEW3D_MT_angle_control,
VIEW3D_MT_mesh_add,
VIEW3D_MT_curve_add,