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:
authorCampbell Barton <ideasman42@gmail.com>2019-01-02 06:36:56 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-01-02 06:58:32 +0300
commit46a6085c47aedaeb9838a8ce10ff488913a44d87 (patch)
tree9d6ec184743207fe503bb9dc41138361c4335c37 /release/scripts
parent939c751faa8eaaf65872aeb67216fd4e6f6f1874 (diff)
UI: de-duplicate top-bar and panel paint scripts
- Fixes missing check for unified brush in sculpt mode. - Re-orders material first in gpencil paint mode (matching color-first for other paint modes). - Avoid minor differences (missing tablet pressure options from topbar). - Don't repeat properties already displayed in the topbar when opening the brush popover.
Diffstat (limited to 'release/scripts')
-rw-r--r--release/scripts/startup/bl_ui/properties_grease_pencil_common.py28
-rw-r--r--release/scripts/startup/bl_ui/properties_paint_common.py199
-rw-r--r--release/scripts/startup/bl_ui/space_topbar.py129
-rw-r--r--release/scripts/startup/bl_ui/space_view3d_toolbar.py132
4 files changed, 262 insertions, 226 deletions
diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index 8e29e03a8f6..cefe6ca1a34 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -254,29 +254,11 @@ class GreasePencilStrokeSculptPanel:
layout.template_icon_view(settings, "sculpt_tool", show_labels=True)
- row = layout.row(align=True)
- row.prop(brush, "size", slider=True)
- sub = row.row(align=True)
- sub.enabled = tool not in {'GRAB', 'CLONE'}
- sub.prop(brush, "use_pressure_radius", text="")
-
- row = layout.row(align=True)
- row.prop(brush, "strength", slider=True)
- row.prop(brush, "use_pressure_strength", text="")
-
- layout.prop(brush, "use_falloff")
-
- layout.use_property_split = False
- if tool in {'THICKNESS', 'STRENGTH'}:
- layout.row().prop(brush, "direction", expand=True)
- elif tool == 'PINCH':
- row = layout.row(align=True)
- row.prop_enum(brush, "direction", value='ADD', text="Pinch")
- row.prop_enum(brush, "direction", value='SUBTRACT', text="Inflate")
- elif tool == 'TWIST':
- row = layout.row(align=True)
- row.prop_enum(brush, "direction", value='ADD', text="CCW")
- row.prop_enum(brush, "direction", value='SUBTRACT', text="CW")
+ if not self.is_popover:
+ from .properties_paint_common import (
+ brush_basic_gpencil_sculpt_settings,
+ )
+ brush_basic_gpencil_sculpt_settings(layout, context, brush)
class GreasePencilSculptOptionsPanel:
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index f22279a1073..32c5acdf3b7 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -199,22 +199,8 @@ def brush_texpaint_common(panel, context, layout, brush, settings, projpaint=Fal
col.separator()
- if capabilities.has_radius:
- row = col.row(align=True)
- panel.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
- panel.prop_unified_size(row, context, brush, "use_pressure_size")
-
- row = col.row(align=True)
-
- if capabilities.has_space_attenuation:
- row.prop(brush, "use_space_attenuation", toggle=True, icon_only=True)
-
- panel.prop_unified_strength(row, context, brush, "strength", text="Strength")
- panel.prop_unified_strength(row, context, brush, "use_pressure_strength")
-
- if brush.image_tool in {'DRAW', 'FILL'}:
- col.separator()
- col.prop(brush, "blend", text="Blend")
+ if not panel.is_popover:
+ brush_basic_texpaint_settings(col, context, brush)
col = layout.column()
@@ -311,6 +297,187 @@ def brush_mask_texture_settings(layout, brush):
col.prop(mask_tex_slot, "offset")
col.prop(mask_tex_slot, "scale")
+# Basic Brush Options
+#
+# Share between topbar and brush panel.
+
+def brush_basic_wpaint_settings(layout, context, brush, *, compact=False):
+ row = layout.row(align=True)
+ UnifiedPaintPanel.prop_unified_weight(row, context, brush, "weight", slider=True, text="Weight")
+
+ row = layout.row(align=True)
+ UnifiedPaintPanel.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
+ UnifiedPaintPanel.prop_unified_size(row, context, brush, "use_pressure_size")
+
+ row = layout.row(align=True)
+ UnifiedPaintPanel.prop_unified_strength(row, context, brush, "strength", text="Strength")
+ UnifiedPaintPanel.prop_unified_strength(row, context, brush, "use_pressure_strength")
+
+ layout.separator()
+ layout.prop(brush, "blend", text="" if compact else "Blend")
+
+
+def brush_basic_vpaint_settings(layout, context, brush, *, compact=False):
+ row = layout.row(align=True)
+ UnifiedPaintPanel.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
+ UnifiedPaintPanel.prop_unified_size(row, context, brush, "use_pressure_size")
+
+ row = layout.row(align=True)
+ UnifiedPaintPanel.prop_unified_strength(row, context, brush, "strength", text="Strength")
+ UnifiedPaintPanel.prop_unified_strength(row, context, brush, "use_pressure_strength")
+
+ layout.separator()
+ layout.prop(brush, "blend", text="" if compact else "Blend")
+
+
+def brush_basic_texpaint_settings(layout, context, brush, *, compact=False):
+ capabilities = brush.image_paint_capabilities
+
+ if capabilities.has_radius:
+ row = layout.row(align=True)
+ UnifiedPaintPanel.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
+ UnifiedPaintPanel.prop_unified_size(row, context, brush, "use_pressure_size")
+
+ row = layout.row(align=True)
+
+ if capabilities.has_space_attenuation:
+ row.prop(brush, "use_space_attenuation", toggle=True, icon_only=True)
+
+ UnifiedPaintPanel.prop_unified_strength(row, context, brush, "strength", text="Strength")
+ UnifiedPaintPanel.prop_unified_strength(row, context, brush, "use_pressure_strength")
+
+ if brush.image_tool in {'DRAW', 'FILL'}:
+ layout.separator()
+ layout.prop(brush, "blend", text="" if compact else "Blend")
+
+
+def brush_basic_sculpt_settings(layout, context, brush, *, compact=False):
+ tool_settings = context.tool_settings
+ capabilities = brush.sculpt_capabilities
+
+ row = layout.row(align=True)
+ ups = tool_settings.unified_paint_settings
+ if (
+ (ups.use_unified_size and ups.use_locked_size) or
+ ((not ups.use_unified_size) and brush.use_locked_size)
+ ):
+ UnifiedPaintPanel.prop_unified_size(row, context, brush, "use_locked_size", icon='LOCKED')
+ UnifiedPaintPanel.prop_unified_size(row, context, brush, "unprojected_radius", slider=True, text="Radius")
+ else:
+ UnifiedPaintPanel.prop_unified_size(row, context, brush, "use_locked_size", icon='UNLOCKED')
+ UnifiedPaintPanel.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
+
+ UnifiedPaintPanel.prop_unified_size(row, context, brush, "use_pressure_size")
+
+ # strength, use_strength_pressure, and use_strength_attenuation
+ layout.separator()
+ row = layout.row(align=True)
+
+ if capabilities.has_space_attenuation:
+ row.prop(brush, "use_space_attenuation", toggle=True, icon_only=True)
+
+ UnifiedPaintPanel.prop_unified_strength(row, context, brush, "strength", text="Strength")
+
+ if capabilities.has_strength_pressure:
+ UnifiedPaintPanel.prop_unified_strength(row, context, brush, "use_pressure_strength")
+
+ # direction
+ layout.separator()
+ layout.row().prop(brush, "direction", expand=True, **({"text": ""} if compact else {}))
+
+
+def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=False):
+ gp_settings = brush.gpencil_settings
+
+ # Brush details
+ if brush.gpencil_tool == 'ERASE':
+ row = layout.row(align=True)
+ row.prop(brush, "size", text="Radius")
+ row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
+ row.prop(gp_settings, "use_occlude_eraser", text="", icon='XRAY')
+
+ if gp_settings.eraser_mode == 'SOFT':
+ row = layout.row(align=True)
+ row.prop(gp_settings, "pen_strength", slider=True)
+ row.prop(gp_settings, "use_strength_pressure", text="", icon='STYLUS_PRESSURE')
+ row = layout.row(align=True)
+ row.prop(gp_settings, "eraser_strength_factor")
+ row = layout.row(align=True)
+ row.prop(gp_settings, "eraser_thickness_factor")
+ elif brush.gpencil_tool == 'FILL':
+ col = layout.column(align=True)
+ col.prop(gp_settings, "fill_leak", text="Leak Size")
+ col.separator()
+ col.prop(brush, "size", text="Thickness")
+ col.prop(gp_settings, "fill_simplify_level", text="Simplify")
+
+ row = layout.row(align=True)
+ row.prop(gp_settings, "fill_draw_mode", text="Boundary Draw Mode")
+ row.prop(gp_settings, "show_fill_boundary", text="", icon='GRID')
+
+ col = layout.column(align=True)
+ col.enabled = gp_settings.fill_draw_mode != 'STROKE'
+ col.prop(gp_settings, "show_fill", text="Ignore Transparent Strokes")
+ sub = col.row(align=True)
+ sub.enabled = not gp_settings.show_fill
+ sub.prop(gp_settings, "fill_threshold", text="Threshold")
+ else: # brush.gpencil_tool == 'DRAW':
+ row = layout.row(align=True)
+ row.prop(brush, "size", text="Radius")
+ row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
+ row = layout.row(align=True)
+ row.prop(gp_settings, "pen_strength", slider=True)
+ row.prop(gp_settings, "use_strength_pressure", text="", icon='STYLUS_PRESSURE')
+
+
+def brush_basic_gpencil_sculpt_settings(layout, context, brush, *, compact=False):
+ tool_settings = context.tool_settings
+ settings = tool_settings.gpencil_sculpt
+ tool = settings.sculpt_tool
+
+ row = layout.row(align=True)
+ row.prop(brush, "size", slider=True)
+ sub = row.row(align=True)
+ sub.enabled = tool not in {'GRAB', 'CLONE'}
+ sub.prop(brush, "use_pressure_radius", text="")
+
+ row = layout.row(align=True)
+ row.prop(brush, "strength", slider=True)
+ row.prop(brush, "use_pressure_strength", text="")
+
+ layout.prop(brush, "use_falloff")
+
+ if compact:
+ if tool in {'THICKNESS', 'STRENGTH', 'PINCH', 'TWIST'}:
+ row.separator()
+ row.prop(brush, "direction", expand=True, text="")
+ else:
+ use_property_split_prev = layout.use_property_split
+ layout.use_property_split = False
+ if tool in {'THICKNESS', 'STRENGTH'}:
+ layout.row().prop(brush, "direction", expand=True)
+ elif tool == 'PINCH':
+ row = layout.row(align=True)
+ row.prop_enum(brush, "direction", value='ADD', text="Pinch")
+ row.prop_enum(brush, "direction", value='SUBTRACT', text="Inflate")
+ elif tool == 'TWIST':
+ row = layout.row(align=True)
+ row.prop_enum(brush, "direction", value='ADD', text="CCW")
+ row.prop_enum(brush, "direction", value='SUBTRACT', text="CW")
+ layout.use_property_split = use_property_split_prev
+
+
+def brush_basic_gpencil_weight_settings(layout, context, brush, *, compact=False):
+ layout.prop(brush, "size", slider=True)
+
+ row = layout.row(align=True)
+ row.prop(brush, "strength", slider=True)
+ row.prop(brush, "use_pressure_strength", text="")
+
+ layout.prop(brush, "use_falloff")
+
+ layout.prop(brush, "target_weight", slider=True)
+
classes = (
VIEW3D_MT_tools_projectpaint_clone,
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index 50dc094bccf..75a6b6532e5 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -236,11 +236,10 @@ class _draw_left_context_mode:
if brush is None:
return
- from .properties_paint_common import UnifiedPaintPanel
-
- UnifiedPaintPanel.prop_unified_size(layout, context, brush, "size", slider=True, text="Radius")
- UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength", slider=True, text="Strength")
- layout.prop(brush, "direction", text="", expand=True)
+ from .properties_paint_common import (
+ brush_basic_sculpt_settings,
+ )
+ brush_basic_sculpt_settings(layout, context, brush, compact=True)
@staticmethod
def PAINT_TEXTURE(context, layout, tool):
@@ -254,12 +253,12 @@ class _draw_left_context_mode:
if brush is None:
return
- from .properties_paint_common import UnifiedPaintPanel
-
+ from .properties_paint_common import (
+ UnifiedPaintPanel,
+ brush_basic_texpaint_settings,
+ )
UnifiedPaintPanel.prop_unified_color(layout, context, brush, "color", text="")
- UnifiedPaintPanel.prop_unified_size(layout, context, brush, "size", slider=True, text="Radius")
- UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength", slider=True, text="Strength")
- layout.prop(brush, "blend", text="")
+ brush_basic_texpaint_settings(layout, context, brush, compact=True)
@staticmethod
def PAINT_VERTEX(context, layout, tool):
@@ -273,12 +272,12 @@ class _draw_left_context_mode:
if brush is None:
return
- from .properties_paint_common import UnifiedPaintPanel
-
+ from .properties_paint_common import (
+ UnifiedPaintPanel,
+ brush_basic_vpaint_settings,
+ )
UnifiedPaintPanel.prop_unified_color(layout, context, brush, "color", text="")
- UnifiedPaintPanel.prop_unified_size(layout, context, brush, "size", slider=True, text="Radius")
- UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength", slider=True, text="Strength")
- layout.prop(brush, "blend", text="")
+ brush_basic_vpaint_settings(layout, context, brush, compact=True)
@staticmethod
def PAINT_WEIGHT(context, layout, tool):
@@ -291,12 +290,8 @@ class _draw_left_context_mode:
if brush is None:
return
- from .properties_paint_common import UnifiedPaintPanel
-
- UnifiedPaintPanel.prop_unified_weight(layout, context, brush, "weight", slider=True, text="Weight")
- UnifiedPaintPanel.prop_unified_size(layout, context, brush, "size", slider=True, text="Radius")
- UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength", slider=True, text="Strength")
- layout.prop(brush, "blend", text="")
+ from .properties_paint_common import brush_basic_wpaint_settings
+ brush_basic_wpaint_settings(layout, context, brush, compact=True)
@staticmethod
def PAINT_GPENCIL(context, layout, tool):
@@ -346,49 +341,24 @@ class _draw_left_context_mode:
settings = tool_settings.gpencil_paint
row.template_ID_preview(settings, "brush", rows=3, cols=8, hide_buttons=True)
- if brush.gpencil_tool == 'ERASE':
- row = layout.row(align=True)
- row.prop(brush, "size", text="Radius")
- row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
- row.prop(gp_settings, "use_occlude_eraser", text="", icon='XRAY')
- if gp_settings.eraser_mode == 'SOFT':
- row = layout.row(align=True)
- row.prop(gp_settings, "pen_strength", slider=True)
- row.prop(gp_settings, "use_strength_pressure", text="", icon='STYLUS_PRESSURE')
- elif brush.gpencil_tool == 'FILL':
- row = layout.row()
- row.prop(gp_settings, "fill_leak", text="Leak Size")
- row.prop(brush, "size", text="Thickness")
- row.prop(gp_settings, "fill_simplify_level", text="Simplify")
-
+ if brush.gpencil_tool in {'FILL', 'DRAW'}:
draw_color_selector()
- row = layout.row(align=True)
- row.prop(gp_settings, "fill_draw_mode", text="")
- row.prop(gp_settings, "show_fill_boundary", text="", icon='GRID')
+ from .properties_paint_common import (
+ brush_basic_gpencil_paint_settings,
+ )
+ brush_basic_gpencil_paint_settings(layout, context, brush, compact=True)
- else: # brush.gpencil_tool == 'DRAW':
+ if tool.name in {"Arc", "Curve", "Line", "Box", "Circle"}:
+ settings = context.tool_settings.gpencil_sculpt
row = layout.row(align=True)
- row.prop(brush, "size", text="Radius")
- if is_paint:
- row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
- row = layout.row(align=True)
- row.prop(gp_settings, "pen_strength", slider=True)
- if is_paint:
- row.prop(gp_settings, "use_strength_pressure", text="", icon='STYLUS_PRESSURE')
-
- draw_color_selector()
-
- if tool.name in {"Arc", "Curve", "Line", "Box", "Circle"}:
- settings = context.tool_settings.gpencil_sculpt
- row = layout.row(align=True)
- row.prop(settings, "use_thickness_curve", text="", icon='CURVE_DATA')
- sub = row.row(align=True)
- sub.active = settings.use_thickness_curve
- sub.popover(
- panel="TOPBAR_PT_gpencil_primitive",
- text="Thickness Profile"
- )
+ row.prop(settings, "use_thickness_curve", text="", icon='CURVE_DATA')
+ sub = row.row(align=True)
+ sub.active = settings.use_thickness_curve
+ sub.popover(
+ panel="TOPBAR_PT_gpencil_primitive",
+ text="Thickness Profile"
+ )
@staticmethod
def SCULPT_GPENCIL(context, layout, tool):
@@ -396,22 +366,12 @@ class _draw_left_context_mode:
return
tool_settings = context.tool_settings
settings = tool_settings.gpencil_sculpt
- tool = settings.sculpt_tool
brush = settings.brush
- row = layout.row(align=True)
- row.prop(brush, "size", slider=True)
- sub = row.row(align=True)
- sub.enabled = tool not in {'GRAB', 'CLONE'}
- sub.prop(brush, "use_pressure_radius", text="")
-
- row = layout.row(align=True)
- row.prop(brush, "strength", slider=True)
- row.prop(brush, "use_pressure_strength", text="")
-
- if tool in {'THICKNESS', 'STRENGTH', 'PINCH', 'TWIST'}:
- row.separator()
- row.prop(brush, "direction", expand=True, text="")
+ from .properties_paint_common import (
+ brush_basic_gpencil_sculpt_settings,
+ )
+ brush_basic_gpencil_sculpt_settings(layout, context, brush, compact=True)
@staticmethod
def WEIGHT_GPENCIL(context, layout, tool):
@@ -421,13 +381,10 @@ class _draw_left_context_mode:
settings = tool_settings.gpencil_sculpt
brush = settings.brush
- layout.prop(brush, "size", slider=True)
-
- row = layout.row(align=True)
- row.prop(brush, "strength", slider=True)
- row.prop(brush, "use_pressure_strength", text="")
-
- layout.prop(brush, "target_weight", slider=True)
+ from .properties_paint_common import (
+ brush_basic_gpencil_weight_settings,
+ )
+ brush_basic_gpencil_weight_settings(layout, context, brush, compact=True)
@staticmethod
def PARTICLE(context, layout, tool):
@@ -492,12 +449,12 @@ class _draw_left_context_mode:
if brush is None:
return
- from .properties_paint_common import UnifiedPaintPanel
-
+ from .properties_paint_common import (
+ UnifiedPaintPanel,
+ brush_basic_texpaint_settings,
+ )
UnifiedPaintPanel.prop_unified_color(layout, context, brush, "color", text="")
- UnifiedPaintPanel.prop_unified_size(layout, context, brush, "size", slider=True, text="Radius")
- UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength", slider=True, text="Strength")
- layout.prop(brush, "blend", text="")
+ brush_basic_texpaint_settings(layout, context, brush, compact=True)
class TOPBAR_PT_gpencil_layers(Panel):
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 5d7d9f3a675..9c0e43fe0a0 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -27,9 +27,9 @@ from .properties_grease_pencil_common import (
)
from .properties_paint_common import (
UnifiedPaintPanel,
- brush_texture_settings,
- brush_texpaint_common,
brush_mask_texture_settings,
+ brush_texpaint_common,
+ brush_texture_settings,
)
from bl_operators.presets import PresetMenu
@@ -257,36 +257,18 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
# Sculpt Mode #
elif context.sculpt_object and brush:
+ from .properties_paint_common import (
+ brush_basic_sculpt_settings,
+ )
+
capabilities = brush.sculpt_capabilities
col = layout.column()
col.separator()
- row = col.row(align=True)
-
- ups = tool_settings.unified_paint_settings
- if ((ups.use_unified_size and ups.use_locked_size) or
- ((not ups.use_unified_size) and brush.use_locked_size)):
- self.prop_unified_size(row, context, brush, "use_locked_size", icon='LOCKED')
- self.prop_unified_size(row, context, brush, "unprojected_radius", slider=True, text="Radius")
- else:
- self.prop_unified_size(row, context, brush, "use_locked_size", icon='UNLOCKED')
- self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
-
- self.prop_unified_size(row, context, brush, "use_pressure_size")
-
- # strength, use_strength_pressure, and use_strength_attenuation
- col.separator()
- row = col.row(align=True)
-
- if capabilities.has_space_attenuation:
- row.prop(brush, "use_space_attenuation", toggle=True, icon_only=True)
-
- self.prop_unified_strength(row, context, brush, "strength", text="Strength")
-
- if capabilities.has_strength_pressure:
- self.prop_unified_strength(row, context, brush, "use_pressure_strength")
+ if not self.is_popover:
+ brush_basic_sculpt_settings(col, context, brush)
# auto_smooth_factor and use_inverse_smooth_pressure
if capabilities.has_auto_smooth:
@@ -350,10 +332,6 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
col.prop(brush, "use_frontface", text="Front Faces Only")
col.prop(brush, "use_projected")
- # direction
- col.separator()
- col.row().prop(brush, "direction", expand=True)
-
# use_accumulate
if capabilities.has_accumulate:
col.separator()
@@ -384,22 +362,14 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
# Weight Paint Mode #
elif context.weight_paint_object and brush:
+ from .properties_paint_common import (
+ brush_basic_wpaint_settings,
+ )
col = layout.column()
- row = col.row(align=True)
- self.prop_unified_weight(row, context, brush, "weight", slider=True, text="Weight")
-
- row = col.row(align=True)
- self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
- self.prop_unified_size(row, context, brush, "use_pressure_size")
-
- row = col.row(align=True)
- self.prop_unified_strength(row, context, brush, "strength", text="Strength")
- self.prop_unified_strength(row, context, brush, "use_pressure_strength")
-
- col.separator()
- col.prop(brush, "blend", text="Blend")
+ if not self.is_popover:
+ brush_basic_wpaint_settings(col, context, brush)
if brush.weight_tool != 'SMEAR':
col.prop(brush, "use_accumulate")
@@ -420,6 +390,10 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
# Vertex Paint Mode #
elif context.vertex_paint_object and brush:
+ from .properties_paint_common import (
+ brush_basic_vpaint_settings,
+ )
+
col = layout.column()
self.prop_unified_color_picker(col, context, brush, "color", value_slider=True)
if settings.palette:
@@ -431,16 +405,10 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
row.operator("paint.brush_colors_flip", icon='FILE_REFRESH', text="")
col.separator()
- row = col.row(align=True)
- self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
- self.prop_unified_size(row, context, brush, "use_pressure_size")
- row = col.row(align=True)
- self.prop_unified_strength(row, context, brush, "strength", text="Strength")
- self.prop_unified_strength(row, context, brush, "use_pressure_strength")
+ if not self.is_popover:
+ brush_basic_vpaint_settings(col, context, brush)
- col.separator()
- col.prop(brush, "blend", text="Blend")
col.prop(brush, "use_alpha")
if brush.vertex_tool != 'SMEAR':
@@ -1501,52 +1469,14 @@ class VIEW3D_PT_tools_grease_pencil_brush(View3DPanel, Panel):
# XXX: Items in "sub" currently show up beside the brush selector in a separate column
if brush.gpencil_tool == 'ERASE':
sub.prop(gp_settings, "use_default_eraser", text="")
+ elif brush.gpencil_tool in {'DRAW', 'FILL'}:
+ layout.row(align=True).template_ID(gp_settings, "material")
- # Brush details
- if brush.gpencil_tool == 'ERASE':
- row = layout.row(align=True)
- row.prop(brush, "size", text="Radius")
- row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
- row.prop(gp_settings, "use_occlude_eraser", text="", icon='XRAY')
-
- if gp_settings.eraser_mode == 'SOFT':
- row = layout.row(align=True)
- row.prop(gp_settings, "pen_strength", slider=True)
- row.prop(gp_settings, "use_strength_pressure", text="", icon='STYLUS_PRESSURE')
- row = layout.row(align=True)
- row.prop(gp_settings, "eraser_strength_factor")
- row = layout.row(align=True)
- row.prop(gp_settings, "eraser_thickness_factor")
- elif brush.gpencil_tool == 'FILL':
- col = layout.column(align=True)
- col.prop(gp_settings, "fill_leak", text="Leak Size")
- col.separator()
- col.prop(brush, "size", text="Thickness")
- col.prop(gp_settings, "fill_simplify_level", text="Simplify")
-
- col = layout.row(align=True)
- col.template_ID(gp_settings, "material")
-
- row = layout.row(align=True)
- row.prop(gp_settings, "fill_draw_mode", text="Boundary Draw Mode")
- row.prop(gp_settings, "show_fill_boundary", text="", icon='GRID')
-
- col = layout.column(align=True)
- col.enabled = gp_settings.fill_draw_mode != 'STROKE'
- col.prop(gp_settings, "show_fill", text="Ignore Transparent Strokes")
- sub = col.row(align=True)
- sub.enabled = not gp_settings.show_fill
- sub.prop(gp_settings, "fill_threshold", text="Threshold")
- else: # bgpsettings.tool == 'DRAW':
- row = layout.row(align=True)
- row.prop(brush, "size", text="Radius")
- row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
- row = layout.row(align=True)
- row.prop(gp_settings, "pen_strength", slider=True)
- row.prop(gp_settings, "use_strength_pressure", text="", icon='STYLUS_PRESSURE')
-
- row = layout.row(align=True)
- row.template_ID(gp_settings, "material")
+ if not self.is_popover:
+ from .properties_paint_common import (
+ brush_basic_gpencil_paint_settings,
+ )
+ brush_basic_gpencil_paint_settings(layout, context, brush, compact=True)
# Grease Pencil drawing brushes options
@@ -1830,12 +1760,12 @@ class VIEW3D_PT_tools_grease_pencil_weight_paint(View3DPanel, Panel):
layout.template_icon_view(settings, "weight_tool", show_labels=True)
col = layout.column()
- col.prop(brush, "size", slider=True)
- row = col.row(align=True)
- row.prop(brush, "strength", slider=True)
- row.prop(brush, "use_pressure_strength", text="")
- col.prop(brush, "use_falloff")
+ if not self.is_popover:
+ from .properties_paint_common import (
+ brush_basic_gpencil_weight_settings,
+ )
+ brush_basic_gpencil_weight_settings(col, context, brush)
# Grease Pencil Brush Appeareance (one for each mode)