[Bf-blender-cvs] [d5a024c72d9] master: Tools: Add Selection tools to Texture Paint toolbar when Face Selection is enabled.
William Reynish
noreply at git.blender.org
Mon Mar 11 13:45:17 CET 2019
Commit: d5a024c72d99ea35e8fa2b3b2f6e9f268d49b9aa
Author: William Reynish
Date: Mon Mar 11 13:45:15 2019 +0100
Branches: master
https://developer.blender.org/rBd5a024c72d99ea35e8fa2b3b2f6e9f268d49b9aa
Tools: Add Selection tools to Texture Paint toolbar when Face Selection is enabled.
Consistent with the other paint modes.
===================================================================
M release/scripts/startup/bl_ui/space_toolsystem_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 5e77d9c8fb9..5940a3f70d7 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -923,6 +923,12 @@ class _defs_vertex_paint:
class _defs_texture_paint:
+ @staticmethod
+ def poll_select_mask(context):
+ ob = context.active_object
+ return (ob.type == 'MESH' and
+ (ob.data.use_paint_mask))
+
@staticmethod
def generate_from_brushes(context):
return generate_from_enum_ex(
@@ -1717,6 +1723,12 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel):
],
'PAINT_TEXTURE': [
_defs_texture_paint.generate_from_brushes,
+ None,
+ lambda context: (
+ VIEW3D_PT_tools_active._tools_select
+ if _defs_texture_paint.poll_select_mask(context)
+ else ()
+ ),
],
'PAINT_VERTEX': [
_defs_vertex_paint.generate_from_brushes,
More information about the Bf-blender-cvs
mailing list