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:
-rw-r--r--release/scripts/startup/bl_ui/properties_paint_common.py32
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py90
-rw-r--r--source/blender/makesrna/intern/rna_brush.c2
3 files changed, 96 insertions, 28 deletions
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index e3decd7fcdd..b8136f26e90 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -405,7 +405,13 @@ class FalloffPanel(BrushPanel):
if not super().poll(context):
return False
settings = cls.paint_settings(context)
- return (settings and settings.brush and settings.brush.curve)
+ if not (settings and settings.brush and settings.brush.curve):
+ return False
+ if cls.get_brush_mode(context) == 'SCULPT_CURVES':
+ brush = settings.brush
+ if brush.curves_sculpt_tool in {'ADD', 'DELETE'}:
+ return False
+ return True
def draw(self, context):
layout = self.layout
@@ -432,7 +438,13 @@ class FalloffPanel(BrushPanel):
row.operator("brush.curve_preset", icon='LINCURVE', text="").shape = 'LINE'
row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX'
- if mode in {'SCULPT', 'PAINT_VERTEX', 'PAINT_WEIGHT', 'SCULPT_CURVES'} and brush.sculpt_tool != 'POSE':
+ show_fallof_shape = False
+ if mode in {'SCULPT', 'PAINT_VERTEX', 'PAINT_WEIGHT'} and brush.sculpt_tool != 'POSE':
+ show_fallof_shape = True
+ if not show_fallof_shape and mode == 'SCULPT_CURVES' and context.space_data.type == 'PROPERTIES':
+ show_fallof_shape = True
+
+ if show_fallof_shape:
col.separator()
row = col.row(align=True)
row.use_property_split = True
@@ -772,11 +784,19 @@ def brush_settings(layout, context, brush, popover=False):
elif mode == 'SCULPT_CURVES':
if brush.curves_sculpt_tool == 'ADD':
layout.prop(brush.curves_sculpt_settings, "add_amount")
- layout.prop(brush.curves_sculpt_settings, "points_per_curve")
layout.prop(brush.curves_sculpt_settings, "curve_length")
- layout.prop(brush.curves_sculpt_settings, "interpolate_length")
- layout.prop(brush.curves_sculpt_settings, "interpolate_shape")
- layout.prop(brush.curves_sculpt_settings, "interpolate_point_count")
+ col = layout.column(heading="Interpolate", align=True)
+ col.prop(brush.curves_sculpt_settings, "interpolate_length", text="Length")
+ col.prop(brush.curves_sculpt_settings, "interpolate_shape", text="Shape")
+ col.prop(brush.curves_sculpt_settings, "interpolate_point_count", text="Point Count")
+
+ col = layout.column()
+ col.active = not brush.curves_sculpt_settings.interpolate_length
+ col.prop(brush.curves_sculpt_settings, "curve_length")
+
+ col = layout.column()
+ col.active = not brush.curves_sculpt_settings.interpolate_point_count
+ col.prop(brush.curves_sculpt_settings, "points_per_curve")
use_frontface = True
elif brush.curves_sculpt_tool == 'GROW_SHRINK':
layout.prop(brush.curves_sculpt_settings, "scale_uniform")
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 9ea120616f4..4ff62b2ca00 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -484,22 +484,22 @@ class _draw_tool_settings_context_mode:
tool_settings = context.tool_settings
paint = tool_settings.curves_sculpt
- layout.template_ID_preview(paint, "brush", rows=3, cols=8, hide_buttons=True)
brush = paint.brush
if brush is None:
return False
UnifiedPaintPanel.prop_unified(
- layout,
- context,
- brush,
- "size",
- unified_name="use_unified_size",
- text="Radius",
- slider=True,
- header=True
- )
+ layout,
+ context,
+ brush,
+ "size",
+ unified_name="use_unified_size",
+ pressure_name="use_pressure_size",
+ text="Radius",
+ slider=True,
+ header=True
+ )
if brush.curves_sculpt_tool not in {'ADD', 'DELETE'}:
UnifiedPaintPanel.prop_unified(
@@ -508,33 +508,30 @@ class _draw_tool_settings_context_mode:
brush,
"strength",
unified_name="use_unified_strength",
+ pressure_name="use_pressure_strength",
header=True
)
if brush.curves_sculpt_tool == 'COMB':
layout.prop(brush, "falloff_shape", expand=True)
- layout.prop(brush, "curve_preset")
+ layout.popover("VIEW3D_PT_tools_brush_falloff")
if brush.curves_sculpt_tool == 'ADD':
- layout.prop(brush, "use_frontface", text="Front Faces Only")
layout.prop(brush, "falloff_shape", expand=True)
layout.prop(brush.curves_sculpt_settings, "add_amount")
- layout.prop(brush.curves_sculpt_settings, "points_per_curve")
- layout.prop(brush.curves_sculpt_settings, "curve_length")
- layout.prop(brush.curves_sculpt_settings, "interpolate_length")
- layout.prop(brush.curves_sculpt_settings, "interpolate_shape")
- layout.prop(brush.curves_sculpt_settings, "interpolate_point_count")
+ layout.popover("VIEW3D_PT_curves_sculpt_add_shape", text="Curve Shape")
+ layout.prop(brush, "use_frontface", text="Front Faces Only")
+
if brush.curves_sculpt_tool == 'GROW_SHRINK':
layout.prop(brush, "direction", expand=True, text="")
layout.prop(brush, "falloff_shape", expand=True)
- layout.prop(brush.curves_sculpt_settings, "scale_uniform")
- layout.prop(brush.curves_sculpt_settings, "minimum_length")
- layout.prop(brush, "curve_preset")
+ layout.popover("VIEW3D_PT_curves_sculpt_grow_shrink_scaling", text="Scaling")
+ layout.popover("VIEW3D_PT_tools_brush_falloff")
if brush.curves_sculpt_tool == 'SNAKE_HOOK':
layout.prop(brush, "falloff_shape", expand=True)
- layout.prop(brush, "curve_preset")
+ layout.popover("VIEW3D_PT_tools_brush_falloff")
if brush.curves_sculpt_tool == 'DELETE':
layout.prop(brush, "falloff_shape", expand=True)
@@ -7617,6 +7614,55 @@ class TOPBAR_PT_gpencil_vertexcolor(GreasePencilVertexcolorPanel, Panel):
return ob and ob.type == 'GPENCIL'
+class VIEW3D_PT_curves_sculpt_add_shape(Panel):
+ # Only for popover, these are dummy values.
+ bl_space_type = 'VIEW_3D'
+ bl_region_type = 'WINDOW'
+ bl_label = "Curves Sculpt Add Curve Options"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.use_property_split = True
+ layout.use_property_decorate = False # No animation.
+
+ settings = UnifiedPaintPanel.paint_settings(context)
+ brush = settings.brush
+
+ col = layout.column(heading="Interpolate", align=True)
+ col.prop(brush.curves_sculpt_settings, "interpolate_length", text="Length")
+ col.prop(brush.curves_sculpt_settings, "interpolate_shape", text="Shape")
+ col.prop(brush.curves_sculpt_settings, "interpolate_point_count", text="Point Count")
+
+ col = layout.column()
+ col.active = not brush.curves_sculpt_settings.interpolate_length
+ col.prop(brush.curves_sculpt_settings, "curve_length", text="Length")
+
+ col = layout.column()
+ col.active = not brush.curves_sculpt_settings.interpolate_point_count
+ col.prop(brush.curves_sculpt_settings, "points_per_curve", text="Points")
+
+
+class VIEW3D_PT_curves_sculpt_grow_shrink_scaling(Panel):
+ # Only for popover, these are dummy values.
+ bl_space_type = 'VIEW_3D'
+ bl_region_type = 'WINDOW'
+ bl_label = "Curves Grow/Shrink Scaling"
+ bl_ui_units_x = 12
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.use_property_split = True
+ layout.use_property_decorate = False # No animation.
+
+ settings = UnifiedPaintPanel.paint_settings(context)
+ brush = settings.brush
+
+ layout.prop(brush.curves_sculpt_settings, "scale_uniform")
+ layout.prop(brush.curves_sculpt_settings, "minimum_length")
+
+
classes = (
VIEW3D_HT_header,
VIEW3D_HT_tool_header,
@@ -7848,6 +7894,8 @@ classes = (
TOPBAR_PT_gpencil_materials,
TOPBAR_PT_gpencil_vertexcolor,
TOPBAR_PT_annotation_layers,
+ VIEW3D_PT_curves_sculpt_add_shape,
+ VIEW3D_PT_curves_sculpt_grow_shrink_scaling,
)
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 9161fee2584..4767ef2c017 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -1951,7 +1951,7 @@ static void rna_def_curves_sculpt_options(BlenderRNA *brna)
prop = RNA_def_property(srna, "add_amount", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 1, INT32_MAX);
- RNA_def_property_ui_text(prop, "Add Amount", "Number of curves added by the Add brush");
+ RNA_def_property_ui_text(prop, "Count", "Number of curves added by the Add brush");
prop = RNA_def_property(srna, "points_per_curve", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 2, INT32_MAX);