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-03-11 17:01:07 +0300
committerWilliam Reynish <billrey@me.com>2019-03-11 17:01:07 +0300
commit2ed0f08106a67f28768ffb7085df8fd6c0673a57 (patch)
treeb246a937479675257d20bb41d61f55296a208281
parent4302342287b56e6b47930eec7db55625c3589327 (diff)
UI: Add brush controls to contextual menus for Texture Paint, Vertex Paint, Sculpt Mode
Maniphest task: T62130
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py78
1 files changed, 60 insertions, 18 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 292884b0ae5..a2484a39281 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -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):