[Bf-blender-cvs] [97336343c48] blender2.8: UI: show brush selector in topbar
Campbell Barton
noreply at git.blender.org
Sat Nov 3 09:47:46 CET 2018
Commit: 97336343c48331e794e96977e84ba2031e75b518
Author: Campbell Barton
Date: Sat Nov 3 19:39:35 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB97336343c48331e794e96977e84ba2031e75b518
UI: show brush selector in topbar
===================================================================
M release/scripts/startup/bl_ui/space_topbar.py
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index 05221151b40..e3b2b16c3c2 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -227,7 +227,11 @@ class _draw_left_context_mode:
def SCULPT(context, layout, tool):
if (tool is None) or (not tool.has_datablock):
return
- brush = context.tool_settings.sculpt.brush
+
+ paint = context.tool_settings.sculpt
+ layout.template_ID_preview(paint, "brush", rows=3, cols=8, hide_buttons=True)
+
+ brush = paint.brush
if brush is None:
return
@@ -240,7 +244,11 @@ class _draw_left_context_mode:
def PAINT_TEXTURE(context, layout, tool):
if (tool is None) or (not tool.has_datablock):
return
- brush = context.tool_settings.image_paint.brush
+
+ paint = context.tool_settings.image_paint
+ layout.template_ID_preview(paint, "brush", rows=3, cols=8, hide_buttons=True)
+
+ brush = paint.brush
if brush is None:
return
@@ -253,7 +261,11 @@ class _draw_left_context_mode:
def PAINT_VERTEX(context, layout, tool):
if (tool is None) or (not tool.has_datablock):
return
- brush = context.tool_settings.vertex_paint.brush
+
+ paint = context.tool_settings.vertex_paint
+ layout.template_ID_preview(paint, "brush", rows=3, cols=8, hide_buttons=True)
+
+ brush = paint.brush
if brush is None:
return
@@ -266,7 +278,10 @@ class _draw_left_context_mode:
def PAINT_WEIGHT(context, layout, tool):
if (tool is None) or (not tool.has_datablock):
return
- brush = context.tool_settings.weight_paint.brush
+
+ paint = context.tool_settings.weight_paint
+ layout.template_ID_preview(paint, "brush", rows=3, cols=8, hide_buttons=True)
+ brush = paint.brush
if brush is None:
return
@@ -328,7 +343,11 @@ class _draw_left_context_mode:
def PAINT(context, layout, tool):
if (tool is None) or (not tool.has_datablock):
return
- brush = context.tool_settings.image_paint.brush
+
+ paint = context.tool_settings.image_paint
+ layout.template_ID_preview(paint, "brush", rows=3, cols=8, hide_buttons=True)
+
+ brush = paint.brush
if brush is None:
return
More information about the Bf-blender-cvs
mailing list