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:
authorWilliam Reynish <billrey@me.com>2019-12-14 20:48:18 +0300
committerWilliam Reynish <billrey@me.com>2019-12-14 20:48:18 +0300
commitfb74dcc5d69d07f641e318557f679b95e52297a0 (patch)
treeafd4a692f720b85ce0ad010009c8cb4ed8430241 /release/scripts/startup/bl_ui/space_image.py
parent16206b66a2594c286aaf2ce3983f946f1d3d39d3 (diff)
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI: - All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together. - The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa. - Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel. - UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header. - 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off. - Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke. - Display (now Cursor) panel was reorganized, settings renamed. - 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True. - Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity. - De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow. - A few more tweaks - see D5928 for the extensive list. Most of the patch is written by Demeter Dzadik, with some additions by myself Differential Revision: https://developer.blender.org/D5928 Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
Diffstat (limited to 'release/scripts/startup/bl_ui/space_image.py')
-rw-r--r--release/scripts/startup/bl_ui/space_image.py507
1 files changed, 98 insertions, 409 deletions
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index da1df5bd660..0ccef9c08c8 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -27,12 +27,18 @@ from bpy.types import (
from bl_ui.properties_paint_common import (
UnifiedPaintPanel,
brush_texture_settings,
- brush_texpaint_common,
- brush_texpaint_common_color,
- brush_texpaint_common_gradient,
- brush_texpaint_common_clone,
- brush_texpaint_common_options,
- brush_mask_texture_settings,
+ brush_basic_texpaint_settings,
+ brush_settings,
+ brush_settings_advanced,
+ draw_color_settings,
+ ClonePanel,
+ BrushSelectPanel,
+ TextureMaskPanel,
+ ColorPalettePanel,
+ StrokePanel,
+ SmoothStrokePanel,
+ FalloffPanel,
+ DisplayPanel,
)
from bl_ui.properties_grease_pencil_common import (
AnnotationDataPanel,
@@ -44,7 +50,7 @@ from bl_ui.space_toolsystem_common import (
from bpy.app.translations import pgettext_iface as iface_
-class ImagePaintPanel(UnifiedPaintPanel):
+class ImagePaintPanel:
bl_space_type = 'IMAGE_EDITOR'
bl_region_type = 'UI'
@@ -59,7 +65,7 @@ class BrushButtonsPanel(UnifiedPaintPanel):
return tool_settings.brush
-class IMAGE_PT_active_tool(ToolActivePanelHelper, Panel):
+class IMAGE_PT_active_tool(Panel, ToolActivePanelHelper):
bl_space_type = 'IMAGE_EDITOR'
bl_region_type = 'UI'
bl_category = "Tool"
@@ -181,25 +187,6 @@ class IMAGE_MT_select(Menu):
layout.operator("uv.select_overlap")
-class IMAGE_MT_brush(Menu):
- bl_label = "Brush"
-
- def draw(self, context):
- layout = self.layout
- tool_settings = context.tool_settings
- settings = tool_settings.image_paint
- brush = settings.brush
-
- ups = context.tool_settings.unified_paint_settings
- layout.prop(ups, "use_unified_size", text="Unified Size")
- layout.prop(ups, "use_unified_strength", text="Unified Strength")
- layout.prop(ups, "use_unified_color", text="Unified Color")
- layout.separator()
-
- # Brush tool.
- layout.prop_menu_enum(brush, "image_tool")
-
-
class IMAGE_MT_image(Menu):
bl_label = "Image"
@@ -569,15 +556,16 @@ class IMAGE_HT_tool_header(Header):
if tool_mode == 'PAINT':
if (tool is not None) and tool.has_datablock:
- layout.popover_group(
- space_type='IMAGE_EDITOR',
- region_type='UI',
- context=".paint_common_2d",
- category="",
- )
+ layout.popover("IMAGE_PT_paint_settings_advanced")
+ layout.popover("IMAGE_PT_paint_stroke")
+ layout.popover("IMAGE_PT_paint_curve")
+ layout.popover("IMAGE_PT_tools_brush_display")
+ layout.popover("IMAGE_PT_tools_brush_texture")
+ layout.popover("IMAGE_PT_tools_mask_texture")
elif tool_mode == 'UV':
if (tool is not None) and tool.has_datablock:
- layout.popover_group(space_type='IMAGE_EDITOR', region_type='UI', context=".uv_sculpt", category="")
+ layout.popover("IMAGE_PT_uv_sculpt_curve")
+ layout.popover("IMAGE_PT_uv_sculpt_options")
def draw_mode_settings(self, context):
layout = self.layout
@@ -601,15 +589,9 @@ class _draw_tool_settings_context_mode:
uv_sculpt = tool_settings.uv_sculpt
brush = uv_sculpt.brush
if brush:
- from bl_ui.properties_paint_common import UnifiedPaintPanel
-
- row = layout.row(align=True)
- UnifiedPaintPanel.prop_unified_size(row, context, brush, "size", slider=True)
- row.prop(brush, "use_pressure_size", text="")
-
- row = layout.row(align=True)
- UnifiedPaintPanel.prop_unified_strength(row, context, brush, "strength", slider=True)
- row.prop(brush, "use_pressure_strength", text="")
+ # NOTE: We don't draw UnifiedPaintSettings in the header to reduce clutter. D5928#136281
+ UnifiedPaintPanel.prop_unified(layout, context, brush, "size", pressure_name="use_pressure_size", slider=True)
+ UnifiedPaintPanel.prop_unified(layout, context, brush, "strength", pressure_name="use_pressure_strength", slider=True)
@staticmethod
def PAINT(context, layout, tool):
@@ -623,13 +605,6 @@ class _draw_tool_settings_context_mode:
if brush is None:
return
- from bl_ui.properties_paint_common import (
- UnifiedPaintPanel,
- brush_basic_texpaint_settings,
- )
- capabilities = brush.image_paint_capabilities
- if capabilities.has_color:
- UnifiedPaintPanel.prop_unified_color(layout, context, brush, "color", text="")
brush_basic_texpaint_settings(layout, context, brush, compact=True)
@@ -771,8 +746,6 @@ class MASK_MT_editor_menus(Menu):
layout.menu("IMAGE_MT_select")
if show_maskedit:
layout.menu("MASK_MT_select")
- if show_paint:
- layout.menu("IMAGE_MT_brush")
if ima and ima.is_dirty:
layout.menu("IMAGE_MT_image", text="Image*")
@@ -1101,11 +1074,16 @@ class IMAGE_PT_udim_tiles(Panel):
col.operator("image.tile_fill")
-class IMAGE_PT_paint(Panel, ImagePaintPanel):
- bl_label = "Brush"
+class IMAGE_PT_paint_select(Panel, ImagePaintPanel, BrushSelectPanel):
+ bl_label = "Brushes"
bl_context = ".paint_common_2d"
bl_category = "Tool"
+class IMAGE_PT_paint_settings(Panel, ImagePaintPanel):
+ bl_context = ".paint_common_2d"
+ bl_category = "Tool"
+ bl_label = "Brush Settings"
+
def draw(self, context):
layout = self.layout
@@ -1115,98 +1093,32 @@ class IMAGE_PT_paint(Panel, ImagePaintPanel):
settings = context.tool_settings.image_paint
brush = settings.brush
- col = layout.column()
- col.template_ID_preview(settings, "brush", new="brush.add", rows=2, cols=6)
-
if brush:
- brush_texpaint_common(self, context, layout, brush, settings)
+ brush_settings(layout.column(), context, brush, popover=self.is_popover)
-class IMAGE_PT_paint_color(Panel, ImagePaintPanel):
- bl_category = "Tool"
+class IMAGE_PT_paint_settings_advanced(Panel, ImagePaintPanel):
bl_context = ".paint_common_2d"
- bl_parent_id = "IMAGE_PT_paint"
- bl_label = "Color Picker"
-
- @classmethod
- def poll(cls, context):
- settings = context.tool_settings.image_paint
- brush = settings.brush
- capabilities = brush.image_paint_capabilities
-
- return capabilities.has_color
+ bl_parent_id = "IMAGE_PT_paint_settings"
+ bl_label = "Advanced"
def draw(self, context):
layout = self.layout
- settings = context.tool_settings.image_paint
- brush = settings.brush
-
- layout.prop(brush, "color_type", expand=True)
-
- if brush.color_type == 'COLOR':
- brush_texpaint_common_color(self, context, layout, brush, settings)
- elif brush.color_type == 'GRADIENT':
- brush_texpaint_common_gradient(self, context, layout, brush, settings)
-
-class IMAGE_PT_paint_swatches(Panel, ImagePaintPanel):
- bl_category = "Tool"
- bl_context = ".paint_common_2d"
- bl_parent_id = "IMAGE_PT_paint"
- bl_label = "Color Palette"
- bl_options = {'DEFAULT_CLOSED'}
+ layout.use_property_split = True
+ layout.use_property_decorate = False # No animation.
- @classmethod
- def poll(cls, context):
settings = context.tool_settings.image_paint
brush = settings.brush
- capabilities = brush.image_paint_capabilities
- return capabilities.has_color
+ brush_settings_advanced(layout.column(), context, brush, self.is_popover)
- def draw(self, context):
- layout = self.layout
- settings = context.tool_settings.image_paint
-
- layout.template_ID(settings, "palette", new="palette.new")
- if settings.palette:
- layout.template_palette(settings, "palette", color=True)
-
-class IMAGE_PT_paint_clone(Panel, ImagePaintPanel):
- bl_category = "Tool"
+class IMAGE_PT_paint_color(Panel, ImagePaintPanel):
bl_context = ".paint_common_2d"
- bl_parent_id = "IMAGE_PT_paint"
- bl_label = "Clone from Image/UV Map"
- bl_options = {'DEFAULT_CLOSED'}
-
- @classmethod
- def poll(cls, context):
- settings = context.tool_settings.image_paint
- brush = settings.brush
-
- return brush.image_tool == 'CLONE'
-
- def draw_header(self, context):
- settings = context.tool_settings.image_paint
- self.layout.prop(settings, "use_clone_layer", text="")
-
- def draw(self, context):
- layout = self.layout
- settings = context.tool_settings.image_paint
- brush = settings.brush
-
- layout.active = settings.use_clone_layer
-
- brush_texpaint_common_clone(self, context, layout, brush, settings)
-
-
-class IMAGE_PT_paint_options(Panel, ImagePaintPanel):
+ bl_parent_id = "IMAGE_PT_paint_settings"
bl_category = "Tool"
- bl_context = ".paint_common_2d"
- bl_parent_id = "IMAGE_PT_paint"
- bl_label = "Options"
- bl_options = {'DEFAULT_CLOSED'}
+ bl_label = "Color Picker"
@classmethod
def poll(cls, context):
@@ -1221,130 +1133,36 @@ class IMAGE_PT_paint_options(Panel, ImagePaintPanel):
settings = context.tool_settings.image_paint
brush = settings.brush
- layout.use_property_split = True
- layout.use_property_decorate = False # No animation.
+ draw_color_settings(context, layout, brush, color_type=True)
- brush_texpaint_common_options(self, context, layout, brush, settings)
-
-class IMAGE_PT_tools_brush_display(BrushButtonsPanel, Panel):
- bl_label = "Display"
+class IMAGE_PT_paint_swatches(Panel, ImagePaintPanel, ColorPalettePanel):
+ bl_category = "Tool"
bl_context = ".paint_common_2d"
+ bl_parent_id = "IMAGE_PT_paint_settings"
+ bl_label = "Color Palette"
bl_options = {'DEFAULT_CLOSED'}
- bl_category = "Tool"
-
- def draw(self, context):
- layout = self.layout
- layout.use_property_split = True
- layout.use_property_decorate = False
-
- tool_settings = context.tool_settings.image_paint
- brush = tool_settings.brush
- tex_slot = brush.texture_slot
- tex_slot_mask = brush.mask_texture_slot
-
- col = layout.column()
- row = col.row(align=True)
-
- sub = row.row(align=True)
- sub.prop(brush, "cursor_overlay_alpha", text="Curve Alpha")
- sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
- row.prop(
- brush, "use_cursor_overlay", text="", toggle=True,
- icon='HIDE_OFF' if brush.use_cursor_overlay else 'HIDE_ON',
- )
-
- col.active = brush.brush_capabilities.has_overlay
-
- row = col.row(align=True)
-
- sub = row.row(align=True)
- sub.prop(brush, "texture_overlay_alpha", text="Texture Alpha")
- sub.prop(brush, "use_primary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
- if tex_slot.map_mode != 'STENCIL':
- row.prop(
- brush, "use_primary_overlay", text="", toggle=True,
- icon='HIDE_OFF' if brush.use_primary_overlay else 'HIDE_ON',
- )
-
- row = col.row(align=True)
-
- sub = row.row(align=True)
- sub.prop(brush, "mask_overlay_alpha", text="Mask Texture Alpha")
- sub.prop(brush, "use_secondary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
- if tex_slot_mask.map_mode != 'STENCIL':
- row.prop(
- brush, "use_secondary_overlay", text="", toggle=True,
- icon='HIDE_OFF' if brush.use_secondary_overlay else 'HIDE_ON',
- )
-
-
-class IMAGE_PT_tools_brush_display_show_brush(BrushButtonsPanel, Panel):
- bl_context = ".paint_common_2d" # dot on purpose (access from topbar)
- bl_label = "Show Brush"
- bl_parent_id = "IMAGE_PT_tools_brush_display"
+class IMAGE_PT_paint_clone(Panel, ImagePaintPanel, ClonePanel):
bl_category = "Tool"
- bl_options = {'DEFAULT_CLOSED'}
-
- def draw_header(self, context):
- settings = context.tool_settings.image_paint
-
- self.layout.prop(settings, "show_brush", text="")
-
- def draw(self, context):
- layout = self.layout
-
- layout.use_property_split = True
- layout.use_property_decorate = False
-
- settings = context.tool_settings.image_paint
- brush = settings.brush
-
- col = layout.column()
- col.active = settings.show_brush
-
- if context.sculpt_object and context.tool_settings.sculpt:
- if brush.sculpt_capabilities.has_secondary_color:
- col.prop(brush, "cursor_color_add", text="Add")
- col.prop(brush, "cursor_color_subtract", text="Subtract")
- else:
- col.prop(brush, "cursor_color_add", text="Color")
- else:
- col.prop(brush, "cursor_color_add", text="Color")
+ bl_context = ".paint_common_2d"
+ bl_parent_id = "IMAGE_PT_paint_settings"
+ bl_label = "Clone from Image/UV Map"
-class IMAGE_PT_tools_brush_display_custom_icon(BrushButtonsPanel, Panel):
- bl_context = ".paint_common_2d" # dot on purpose (access from topbar)
- bl_label = "Custom Icon"
- bl_parent_id = "IMAGE_PT_tools_brush_display"
+class IMAGE_PT_tools_brush_display(Panel, BrushButtonsPanel, DisplayPanel):
+ bl_context = ".paint_common_2d"
+ bl_parent_id = "IMAGE_PT_paint_settings"
bl_category = "Tool"
+ bl_label = "Brush Tip"
bl_options = {'DEFAULT_CLOSED'}
- def draw_header(self, context):
- settings = context.tool_settings.image_paint
- brush = settings.brush
-
- self.layout.prop(brush, "use_custom_icon", text="")
-
- def draw(self, context):
- layout = self.layout
-
- layout.use_property_split = True
- layout.use_property_decorate = False
-
- settings = context.tool_settings.image_paint
- brush = settings.brush
-
- col = layout.column()
- col.active = brush.use_custom_icon
- col.prop(brush, "icon_filepath", text="")
-
class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, Panel):
bl_label = "Texture"
bl_context = ".paint_common_2d"
+ bl_parent_id = "IMAGE_PT_paint_settings"
bl_category = "Tool"
bl_options = {'DEFAULT_CLOSED'}
@@ -1360,135 +1178,36 @@ class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, Panel):
brush_texture_settings(col, brush, 0)
-class IMAGE_PT_tools_mask_texture(BrushButtonsPanel, Panel):
- bl_label = "Texture Mask"
+class IMAGE_PT_tools_mask_texture(Panel, BrushButtonsPanel, TextureMaskPanel):
bl_context = ".paint_common_2d"
+ bl_parent_id = "IMAGE_PT_paint_settings"
bl_category = "Tool"
- bl_options = {'DEFAULT_CLOSED'}
-
- def draw(self, context):
- layout = self.layout
-
- brush = context.tool_settings.image_paint.brush
-
- col = layout.column()
-
- col.template_ID_preview(brush, "mask_texture", new="texture.new", rows=3, cols=8)
-
- brush_mask_texture_settings(col, brush)
+ bl_label = "Texture Mask"
-class IMAGE_PT_paint_stroke(BrushButtonsPanel, Panel):
+class IMAGE_PT_paint_stroke(BrushButtonsPanel, Panel, StrokePanel):
bl_label = "Stroke"
bl_context = ".paint_common_2d"
+ bl_parent_id = "IMAGE_PT_paint_settings"
bl_category = "Tool"
bl_options = {'DEFAULT_CLOSED'}
- def draw(self, context):
- layout = self.layout
-
- tool_settings = context.tool_settings.image_paint
- brush = tool_settings.brush
-
- layout.use_property_split = True
- layout.use_property_decorate = False
-
- col = layout.column()
-
- col.prop(brush, "stroke_method")
-
- if brush.use_anchor:
- col.prop(brush, "use_edge_to_edge", text="Edge To Edge")
-
- if brush.use_airbrush:
- col.prop(brush, "rate", text="Rate", slider=True)
- if brush.use_space:
- row = col.row(align=True)
- row.prop(brush, "spacing", text="Spacing")
- row.prop(brush, "use_pressure_spacing", toggle=True, text="")
-
- if brush.use_line or brush.use_curve:
- row = col.row(align=True)
- row.prop(brush, "spacing", text="Spacing")
-
- if brush.use_curve:
- col.template_ID(brush, "paint_curve", new="paintcurve.new")
- col.operator("paintcurve.draw")
-
- row = col.row(align=True)
- if brush.use_relative_jitter:
- row.prop(brush, "jitter", slider=True)
- else:
- row.prop(brush, "jitter_absolute")
- row.prop(brush, "use_relative_jitter", icon_only=True)
- row.prop(brush, "use_pressure_jitter", toggle=True, text="")
-
- col.prop(tool_settings, "input_samples")
-
-
-class IMAGE_PT_paint_stroke_smooth_stroke(BrushButtonsPanel, Panel):
- bl_context = ".paint_common_2d" # dot on purpose (access from topbar)
- bl_label = "Smooth Stroke"
+class IMAGE_PT_paint_stroke_smooth_stroke(Panel, BrushButtonsPanel, SmoothStrokePanel):
+ bl_context = ".paint_common_2d"
+ bl_label = "Stabilize Stroke"
bl_parent_id = "IMAGE_PT_paint_stroke"
bl_category = "Tool"
bl_options = {'DEFAULT_CLOSED'}
- @classmethod
- def poll(cls, context):
- settings = context.tool_settings.image_paint
- brush = settings.brush
- if brush.brush_capabilities.has_smooth_stroke:
- return True
-
- def draw_header(self, context):
- settings = context.tool_settings.image_paint
- brush = settings.brush
-
- self.layout.prop(brush, "use_smooth_stroke", text="")
-
- def draw(self, context):
- layout = self.layout
- layout.use_property_split = True
- layout.use_property_decorate = False
-
- settings = context.tool_settings.image_paint
- brush = settings.brush
-
- col = layout.column()
- col.active = brush.use_smooth_stroke
- col.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
- col.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
-
-class IMAGE_PT_paint_curve(BrushButtonsPanel, Panel):
+class IMAGE_PT_paint_curve(BrushButtonsPanel, Panel, FalloffPanel):
bl_label = "Falloff"
bl_context = ".paint_common_2d"
+ bl_parent_id = "IMAGE_PT_paint_settings"
bl_category = "Tool"
bl_options = {'DEFAULT_CLOSED'}
- def draw(self, context):
- layout = self.layout
-
- tool_settings = context.tool_settings.image_paint
- brush = tool_settings.brush
-
- col = layout.column(align=True)
- row = col.row(align=True)
- row.prop(brush, "curve_preset", text="")
-
- if brush.curve_preset == 'CUSTOM':
- layout.template_curve_mapping(brush, "curve")
-
- col = layout.column(align=True)
- row = col.row(align=True)
- row.operator("brush.curve_preset", icon='SMOOTHCURVE', text="").shape = 'SMOOTH'
- row.operator("brush.curve_preset", icon='SPHERECURVE', text="").shape = 'ROUND'
- row.operator("brush.curve_preset", icon='ROOTCURVE', text="").shape = 'ROOT'
- row.operator("brush.curve_preset", icon='SHARPCURVE', text="").shape = 'SHARP'
- row.operator("brush.curve_preset", icon='LINCURVE', text="").shape = 'LINE'
- row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX'
-
class IMAGE_PT_tools_imagepaint_symmetry(BrushButtonsPanel, Panel):
bl_context = ".imagepaint_2d"
@@ -1507,91 +1226,61 @@ class IMAGE_PT_tools_imagepaint_symmetry(BrushButtonsPanel, Panel):
row.prop(ipaint, "tile_x", text="X", toggle=True)
row.prop(ipaint, "tile_y", text="Y", toggle=True)
+class UVSculptPanel(UnifiedPaintPanel):
+ @classmethod
+ def poll(cls, context):
+ return cls.get_brush_mode(context) == 'UV_SCULPT'
-class IMAGE_PT_uv_sculpt_brush(Panel):
- bl_space_type = 'IMAGE_EDITOR'
- bl_region_type = 'UI'
- bl_context = ".uv_sculpt" # dot on purpose (access from topbar)
+
+class IMAGE_PT_uv_sculpt_brush_select(Panel, BrushSelectPanel, ImagePaintPanel, UVSculptPanel):
+ bl_context = ".uv_sculpt"
bl_category = "Tool"
- bl_label = "Brush"
+ bl_label = "Brushes"
- @classmethod
- def poll(cls, context):
- sima = context.space_data
- # TODO(campbell): nicer way to check if we're in uv sculpt mode.
- if sima and sima.show_uvedit:
- from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
- tool = ToolSelectPanelHelper.tool_active_from_context(context)
- if tool.has_datablock:
- return True
- return False
+
+class IMAGE_PT_uv_sculpt_brush_settings(Panel, ImagePaintPanel, UVSculptPanel):
+ bl_context = ".uv_sculpt"
+ bl_category = "Tool"
+ bl_label = "Brush Settings"
def draw(self, context):
- from bl_ui.properties_paint_common import UnifiedPaintPanel
layout = self.layout
tool_settings = context.tool_settings
uvsculpt = tool_settings.uv_sculpt
- layout.template_ID(uvsculpt, "brush")
-
brush = uvsculpt.brush
- if not self.is_popover:
- if brush:
- col = layout.column()
-
- row = col.row(align=True)
- UnifiedPaintPanel.prop_unified_size(row, context, brush, "size", slider=True)
- UnifiedPaintPanel.prop_unified_size(row, context, brush, "use_pressure_size", text="")
-
- row = col.row(align=True)
- UnifiedPaintPanel.prop_unified_strength(row, context, brush, "strength", slider=True)
- UnifiedPaintPanel.prop_unified_strength(row, context, brush, "use_pressure_strength", text="")
-
- col = layout.column()
- col.prop(tool_settings, "uv_sculpt_lock_borders")
- col.prop(tool_settings, "uv_sculpt_all_islands")
+ brush_settings(layout.column(), context, brush)
if brush:
if brush.uv_sculpt_tool == 'RELAX':
- col.prop(tool_settings, "uv_relax_method")
-
- col.prop(uvsculpt, "show_brush")
+ # Although this settings is stored in the scene, it is only used by a single tool, so it doesn't make sense from a user perspective to move it to the Options panel.
+ layout.prop(tool_settings, "uv_relax_method")
-class IMAGE_PT_uv_sculpt_curve(Panel):
- bl_space_type = 'IMAGE_EDITOR'
- bl_region_type = 'UI'
+class IMAGE_PT_uv_sculpt_curve(Panel, FalloffPanel, ImagePaintPanel, UVSculptPanel):
bl_context = ".uv_sculpt" # dot on purpose (access from topbar)
+ bl_parent_id = "IMAGE_PT_uv_sculpt_brush_settings"
bl_category = "Tool"
bl_label = "Falloff"
bl_options = {'DEFAULT_CLOSED'}
- poll = IMAGE_PT_uv_sculpt_brush.poll
+class IMAGE_PT_uv_sculpt_options(Panel, ImagePaintPanel, UVSculptPanel):
+ bl_context = ".uv_sculpt" # dot on purpose (access from topbar)
+ bl_category = "Tool"
+ bl_label = "Options"
def draw(self, context):
layout = self.layout
tool_settings = context.tool_settings
uvsculpt = tool_settings.uv_sculpt
- brush = uvsculpt.brush
- if brush is not None:
- col = layout.column(align=True)
- row = col.row(align=True)
- row.prop(brush, "curve_preset", text="")
-
- if brush.curve_preset == 'CUSTOM':
- layout.template_curve_mapping(brush, "curve")
-
- row = layout.row(align=True)
- row.operator("brush.curve_preset", icon='SMOOTHCURVE', text="").shape = 'SMOOTH'
- row.operator("brush.curve_preset", icon='SPHERECURVE', text="").shape = 'ROUND'
- row.operator("brush.curve_preset", icon='ROOTCURVE', text="").shape = 'ROOT'
- row.operator("brush.curve_preset", icon='SHARPCURVE', text="").shape = 'SHARP'
- row.operator("brush.curve_preset", icon='LINCURVE', text="").shape = 'LINE'
- row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX'
+ col = layout.column()
+ col.prop(tool_settings, "uv_sculpt_lock_borders")
+ col.prop(tool_settings, "uv_sculpt_all_islands")
+ col.prop(uvsculpt, "show_brush", text="Display Cursor")
class ImageScopesPanel:
@@ -1765,7 +1454,6 @@ classes = (
IMAGE_MT_view,
IMAGE_MT_view_zoom,
IMAGE_MT_select,
- IMAGE_MT_brush,
IMAGE_MT_image,
IMAGE_MT_image_invert,
IMAGE_MT_uvs,
@@ -1797,21 +1485,22 @@ classes = (
IMAGE_PT_view_display,
IMAGE_PT_view_display_uv_edit_overlays,
IMAGE_PT_view_display_uv_edit_overlays_stretch,
- IMAGE_PT_paint,
+ IMAGE_PT_paint_select,
+ IMAGE_PT_paint_settings,
IMAGE_PT_paint_color,
IMAGE_PT_paint_swatches,
+ IMAGE_PT_paint_settings_advanced,
IMAGE_PT_paint_clone,
- IMAGE_PT_paint_options,
IMAGE_PT_tools_brush_texture,
IMAGE_PT_tools_mask_texture,
IMAGE_PT_paint_stroke,
IMAGE_PT_paint_stroke_smooth_stroke,
IMAGE_PT_paint_curve,
IMAGE_PT_tools_brush_display,
- IMAGE_PT_tools_brush_display_show_brush,
- IMAGE_PT_tools_brush_display_custom_icon,
IMAGE_PT_tools_imagepaint_symmetry,
- IMAGE_PT_uv_sculpt_brush,
+ IMAGE_PT_uv_sculpt_brush_select,
+ IMAGE_PT_uv_sculpt_brush_settings,
+ IMAGE_PT_uv_sculpt_options,
IMAGE_PT_uv_sculpt_curve,
IMAGE_PT_view_histogram,
IMAGE_PT_view_waveform,