From ba4d07cc5c74e42445a59bf1e77587cbf4a83482 Mon Sep 17 00:00:00 2001 From: Antonioya Date: Sat, 9 Mar 2019 16:50:10 +0100 Subject: 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. --- release/scripts/startup/bl_ui/properties_material_gpencil.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to '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): -- cgit v1.2.3