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:
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_paint_common.py')
-rw-r--r--release/scripts/startup/bl_ui/properties_paint_common.py40
1 files changed, 31 insertions, 9 deletions
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index 782fec91f91..f0034a3d710 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -1,6 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-or-later
-
-# <pep8 compliant>
from bpy.types import Menu
@@ -405,7 +403,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 +436,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 +782,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")
- use_frontface = True
+ 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")
elif brush.curves_sculpt_tool == 'GROW_SHRINK':
layout.prop(brush.curves_sculpt_settings, "scale_uniform")
layout.prop(brush.curves_sculpt_settings, "minimum_length")
@@ -839,7 +857,7 @@ def brush_shared_settings(layout, context, brush, popover=False):
if mode == 'SCULPT_CURVES':
size = True
strength = True
- direction = brush.curves_sculpt_tool == "GROW_SHRINK"
+ direction = brush.curves_sculpt_tool in {'GROW_SHRINK', 'SELECTION_PAINT'}
### Draw settings. ###
ups = context.scene.tool_settings.unified_paint_settings
@@ -1298,7 +1316,11 @@ def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=False)
def brush_basic_gpencil_sculpt_settings(layout, _context, brush, *, compact=False):
+ if brush is None:
+ return
gp_settings = brush.gpencil_settings
+ if gp_settings is None:
+ return
tool = brush.gpencil_sculpt_tool
row = layout.row(align=True)