diff options
author | Antonioya <blendergit@gmail.com> | 2019-03-09 18:50:10 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2019-03-09 18:50:10 +0300 |
commit | ba4d07cc5c74e42445a59bf1e77587cbf4a83482 (patch) | |
tree | 4197aa31c909e5252aab2ce1e2112e500efdc3f4 /release/scripts | |
parent | 9c4352001022440f0cffbc64061cd67f28d687b3 (diff) |
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.
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_material_gpencil.py | 9 |
1 files changed, 8 insertions, 1 deletions
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): |