UI: Add brush controls to contextual menus for Texture Paint, Vertex Paint, Sculpt Mode
Maniphest task: T62130
This commit is contained in:
parent
4302342287
commit
2ed0f08106
|
@ -5694,19 +5694,22 @@ class VIEW3D_PT_paint_vertex_specials(Panel):
|
|||
bl_label = "Vertex Paint Context Menu"
|
||||
|
||||
def draw(self, context):
|
||||
brush = context.tool_settings.vertex_paint.brush
|
||||
ups = context.tool_settings.unified_paint_settings
|
||||
|
||||
layout = self.layout
|
||||
# TODO: populate with useful items.
|
||||
layout.operator("paint.vertex_color_set")
|
||||
layout.operator("paint.vertex_color_smooth")
|
||||
layout.operator("paint.vertex_color_dirt")
|
||||
layout.operator("paint.vertex_color_from_weight")
|
||||
|
||||
layout.separator()
|
||||
# Size
|
||||
if ups.use_unified_size:
|
||||
layout.prop(ups, "size", slider=True)
|
||||
else:
|
||||
layout.prop(brush, "size", slider=True)
|
||||
|
||||
layout.operator("paint.vertex_color_invert", text="Invert")
|
||||
layout.operator("paint.vertex_color_levels", text="Levels")
|
||||
layout.operator("paint.vertex_color_hsv", text="Hue Saturation Value")
|
||||
layout.operator("paint.vertex_color_brightness_contrast", text="Bright/Contrast")
|
||||
# Strength
|
||||
if ups.use_unified_strength:
|
||||
layout.prop(ups, "strength")
|
||||
else:
|
||||
layout.prop(brush, "strength")
|
||||
|
||||
|
||||
class VIEW3D_PT_paint_texture_specials(Panel):
|
||||
|
@ -5716,9 +5719,22 @@ class VIEW3D_PT_paint_texture_specials(Panel):
|
|||
bl_label = "Texture Paint Context Menu"
|
||||
|
||||
def draw(self, context):
|
||||
brush = context.tool_settings.image_paint.brush
|
||||
ups = context.tool_settings.unified_paint_settings
|
||||
|
||||
layout = self.layout
|
||||
# TODO: populate with useful items.
|
||||
layout.operator("image.save_dirty")
|
||||
|
||||
# Size
|
||||
if ups.use_unified_size:
|
||||
layout.prop(ups, "size", slider=True)
|
||||
else:
|
||||
layout.prop(brush, "size", slider=True)
|
||||
|
||||
# Strength
|
||||
if ups.use_unified_strength:
|
||||
layout.prop(ups, "strength")
|
||||
else:
|
||||
layout.prop(brush, "strength")
|
||||
|
||||
|
||||
class VIEW3D_PT_paint_weight_specials(Panel):
|
||||
|
@ -5732,12 +5748,23 @@ class VIEW3D_PT_paint_weight_specials(Panel):
|
|||
capabilities = brush.weight_paint_capabilities
|
||||
ups = context.tool_settings.unified_paint_settings
|
||||
|
||||
|
||||
layout = self.layout
|
||||
|
||||
# Weight
|
||||
if capabilities.has_weight or brush.use_gradient:
|
||||
layout.prop(ups, "weight")
|
||||
layout.prop(ups, "size", slider=True)
|
||||
layout.prop(ups, "strength")
|
||||
|
||||
# Size
|
||||
if ups.use_unified_size:
|
||||
layout.prop(ups, "size", slider=True)
|
||||
else:
|
||||
layout.prop(brush, "size", slider=True)
|
||||
|
||||
# Strength
|
||||
if ups.use_unified_strength:
|
||||
layout.prop(ups, "strength")
|
||||
else:
|
||||
layout.prop(brush, "strength")
|
||||
|
||||
|
||||
class VIEW3D_PT_sculpt_specials(Panel):
|
||||
|
@ -5747,10 +5774,25 @@ class VIEW3D_PT_sculpt_specials(Panel):
|
|||
bl_label = "Sculpt Context Menu"
|
||||
|
||||
def draw(self, context):
|
||||
brush = context.tool_settings.sculpt.brush
|
||||
ups = context.tool_settings.unified_paint_settings
|
||||
|
||||
layout = self.layout
|
||||
# TODO: populate with useful items.
|
||||
layout.operator("object.shade_smooth")
|
||||
layout.operator("object.shade_flat")
|
||||
|
||||
# Direction
|
||||
layout.prop(brush, "direction", expand=True)
|
||||
|
||||
# Size
|
||||
if ups.use_unified_size:
|
||||
layout.prop(ups, "size", slider=True)
|
||||
else:
|
||||
layout.prop(brush, "size", slider=True)
|
||||
|
||||
# Strength
|
||||
if ups.use_unified_strength:
|
||||
layout.prop(ups, "strength")
|
||||
else:
|
||||
layout.prop(brush, "strength")
|
||||
|
||||
|
||||
class TOPBAR_PT_gpencil_materials(GreasePencilMaterialsPanel, Panel):
|
||||
|
|
Loading…
Reference in New Issue