From a58be397e2bfbefa0324dbe861b018dd2784ee0d Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Mon, 21 Mar 2022 18:54:31 +0100 Subject: Curves: new Add brush This adds a new Add brush for the new curves object type in sculpt mode. The brush is used to insert new curves (typically hair) on the surface object. Supported features: * Add single curve exactly at the cursor position when `Add Amount` is 1. * Front faces only. * Independent interpolate shape and interpolate length settings. * Smooth and flat shading affects curve shape interpolation. * Spherical and projection brush. This also adds the `surface_triangle_index` and `surface_triangle_coordinate` attributes. Those store information about what position on the surface each added curve is attached to: * `surface_triangle_index` (`int`): Index of the internal triangle that a curve is attached to. `-1` when the curve is not attached to the surface. * `surface_triangle_coordinate` (`float2`): First two numbers of a barycentric coordinate that reference a specific position within the triangle. Ref T96444. Differential Revision: https://developer.blender.org/D14340 --- release/scripts/startup/bl_ui/space_view3d.py | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 7c4ba575f00..45b0033e133 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -492,16 +492,25 @@ class _draw_tool_settings_context_mode: header=True ) - UnifiedPaintPanel.prop_unified( - layout, - context, - brush, - "strength", - unified_name="use_unified_strength", - header=True - ) + if brush.curves_sculpt_tool not in ("ADD", "DELETE"): + UnifiedPaintPanel.prop_unified( + layout, + context, + brush, + "strength", + unified_name="use_unified_strength", + header=True + ) + + if brush.curves_sculpt_tool == "ADD": + layout.prop(brush, "use_frontface") + layout.prop(brush, "falloff_shape", expand=True) + layout.prop(brush.curves_sculpt_settings, "add_amount") + layout.prop(tool_settings.curves_sculpt, "curve_length") + layout.prop(tool_settings.curves_sculpt, "interpolate_length") + layout.prop(tool_settings.curves_sculpt, "interpolate_shape") - if brush.curves_sculpt_tool == "TEST3": + if brush.curves_sculpt_tool == "TEST1": layout.prop(tool_settings.curves_sculpt, "distance") -- cgit v1.2.3