[Bf-blender-cvs] [564b5a35495] greasepencil-object: GPencil: Remove side Mix Color panel for Texture materials
Antonio Vazquez
noreply at git.blender.org
Fri Nov 1 20:14:02 CET 2019
Commit: 564b5a3549510741c612b6f90fc2322c48585a2e
Author: Antonio Vazquez
Date: Fri Nov 1 20:06:04 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB564b5a3549510741c612b6f90fc2322c48585a2e
GPencil: Remove side Mix Color panel for Texture materials
===================================================================
M release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index d664016029e..f23b9447775 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -2036,8 +2036,22 @@ class VIEW3D_PT_tools_grease_pencil_brush_mixcolor(View3DPanel, Panel):
@classmethod
def poll(cls, context):
+ ob = context.object
brush = context.tool_settings.gpencil_paint.brush
- return brush is not None and brush.gpencil_tool == 'DRAW'
+ if ob is None or brush is None or brush.gpencil_tool != 'DRAW':
+ return False
+
+ gp_settings = brush.gpencil_settings
+ if gp_settings.use_material_pin is False:
+ if ob.active_material_index >= 0:
+ ma = ob.material_slots[ob.active_material_index].material
+ else:
+ ma = gp_settings.material
+
+ if ma and ma.grease_pencil.stroke_style == 'TEXTURE' and ma.grease_pencil.use_stroke_pattern is False:
+ return False
+
+ return True
def draw(self, context):
layout = self.layout
More information about the Bf-blender-cvs
mailing list