[Bf-blender-cvs] [77205258734] blender2.8: UI: add texture paint brushes to toolbar

Campbell Barton noreply at git.blender.org
Mon Apr 30 16:53:07 CEST 2018


Commit: 77205258734f7787671d1ff81f7e77f4fe0b3a82
Author: Campbell Barton
Date:   Mon Apr 30 16:43:13 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB77205258734f7787671d1ff81f7e77f4fe0b3a82

UI: add texture paint brushes to toolbar

===================================================================

M	release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M	release/scripts/startup/bl_ui/space_topbar.py
M	release/scripts/startup/bl_ui/space_view3d_toolbar.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 8aba8daa5f5..2235b03c20e 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -568,6 +568,26 @@ class _defs_vertex_paint:
         )
 
 
+class _defs_texture_paint:
+
+    @staticmethod
+    def generate_from_brushes(context):
+        return generate_from_brushes_ex(
+            context,
+            icon_prefix="brush.paint_texture.",
+            brush_test_attr="use_paint_image",
+            brush_category_attr="image_tool",
+            brush_category_layout=(
+                ('DRAW',),
+                ('SOFTEN',),
+                ('SMEAR',),
+                ('CLONE',),
+                ('FILL',),
+                ('MASK',),
+            )
+        )
+
+
 class _defs_weight_paint:
 
     @staticmethod
@@ -747,6 +767,9 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel):
         'SCULPT': [
             _defs_sculpt.generate_from_brushes,
         ],
+        'PAINT_TEXTURE': [
+            _defs_texture_paint.generate_from_brushes,
+        ],
         'PAINT_VERTEX': [
             _defs_vertex_paint.generate_from_brushes,
         ],
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index 458dc571bbb..04e06ee833b 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -154,6 +154,7 @@ class TOPBAR_HT_lower_bar(Header):
             layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".weightpaint", category="")
         elif mode == 'PAINT_TEXTURE':
             layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context="", category="")
+            layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".imagepaint", category="")
 
         elif mode == 'EDIT_ARMATURE':
             layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".armature_edit", category="")
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 5e39be27021..158f032d009 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -197,6 +197,7 @@ class View3DPaintPanel(UnifiedPaintPanel):
 
 class VIEW3D_PT_imapaint_tools_missing(Panel, View3DPaintPanel):
     bl_category = "Tools"
+    bl_context = ".imagepaint" # dot on purpose (access from topbar)
     bl_label = "Missing Data"
 
     @classmethod
@@ -530,7 +531,7 @@ class VIEW3D_MT_tools_projectpaint_uvlayer(Menu):
 
 
 class VIEW3D_PT_slots_projectpaint(View3DPanel, Panel):
-    bl_context = "imagepaint"
+    bl_context = ".imagepaint" # dot on purpose (access from topbar)
     bl_label = "Slots"
     bl_category = "Slots"
 
@@ -591,7 +592,7 @@ class VIEW3D_PT_slots_projectpaint(View3DPanel, Panel):
 
 
 class VIEW3D_PT_stencil_projectpaint(View3DPanel, Panel):
-    bl_context = "imagepaint"
+    bl_context = ".imagepaint" # dot on purpose (access from topbar)
     bl_label = "Mask"
     bl_category = "Slots"
 
@@ -725,7 +726,7 @@ class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel):
 
 class VIEW3D_PT_tools_mask_texture(Panel, View3DPaintPanel):
     bl_category = "Tools"
-    bl_context = "imagepaint"
+    bl_context = ".imagepaint" # dot on purpose (access from topbar)
     bl_label = "Texture Mask"
     bl_options = {'DEFAULT_CLOSED'}
 
@@ -1126,7 +1127,7 @@ class VIEW3D_PT_tools_vertexpaint_symmetry(Panel, View3DPaintPanel):
 
 class VIEW3D_PT_tools_imagepaint_external(Panel, View3DPaintPanel):
     bl_category = "Tools"
-    bl_context = "imagepaint"
+    bl_context = ".imagepaint" # dot on purpose (access from topbar)
     bl_label = "External"
     bl_options = {'DEFAULT_CLOSED'}
 
@@ -1148,7 +1149,7 @@ class VIEW3D_PT_tools_imagepaint_external(Panel, View3DPaintPanel):
 
 class VIEW3D_PT_tools_imagepaint_symmetry(Panel, View3DPaintPanel):
     bl_category = "Tools"
-    bl_context = "imagepaint"
+    bl_context = ".imagepaint" # dot on purpose (access from topbar)
     bl_label = "Symmetry"
     bl_options = {'DEFAULT_CLOSED'}
 
@@ -1167,7 +1168,7 @@ class VIEW3D_PT_tools_imagepaint_symmetry(Panel, View3DPaintPanel):
 
 class VIEW3D_PT_tools_projectpaint(View3DPaintPanel, Panel):
     bl_category = "Options"
-    bl_context = "imagepaint"
+    bl_context = ".imagepaint" # dot on purpose (access from topbar)
     bl_label = "Project Paint"
 
     @classmethod



More information about the Bf-blender-cvs mailing list