[Bf-blender-cvs] [ba4d07cc5c7] master: GPencil: Material panel is hidden after adding new material
Antonioya
noreply at git.blender.org
Sat Mar 9 16:50:19 CET 2019
Commit: ba4d07cc5c74e42445a59bf1e77587cbf4a83482
Author: Antonioya
Date: Sat Mar 9 16:50:10 2019 +0100
Branches: master
https://developer.blender.org/rBba4d07cc5c74e42445a59bf1e77587cbf4a83482
GPencil: Material panel is hidden after adding new material
This bug was introduced by previous Pin fix commit. Maybe it's not the best solution, but this bug is critical and need a quick fix.
This commit fix the problem, but not totally sure this is working fine with pin.
@dfelinto Could you review and adapt if required.
===================================================================
M release/scripts/startup/bl_ui/properties_material_gpencil.py
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_material_gpencil.py b/release/scripts/startup/bl_ui/properties_material_gpencil.py
index a27d2ff9b84..22fa8dee65b 100644
--- a/release/scripts/startup/bl_ui/properties_material_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_material_gpencil.py
@@ -85,13 +85,20 @@ class GPMaterialButtonsPanel:
return ma and ma.grease_pencil
-class MATERIAL_PT_gpencil_slots(GreasePencilMaterialsPanel, GPMaterialButtonsPanel, Panel):
+class MATERIAL_PT_gpencil_slots(GreasePencilMaterialsPanel, Panel):
bl_label = "Grease Pencil Material Slots"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "material"
bl_options = {'HIDE_HEADER'}
+ @classmethod
+ def poll(cls, context):
+ ob = context.object
+ ma = context.material
+
+ return (ma and ma.grease_pencil) or (ob and ob.type == 'GPENCIL')
+
# Used as parent for "Stroke" and "Fill" panels
class MATERIAL_PT_gpencil_surface(GPMaterialButtonsPanel, Panel):
More information about the Bf-blender-cvs
mailing list