From a56b024964b186e3ffbc5b234184757d2113a470 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 2 Dec 2018 13:59:43 +1100 Subject: Cleanup: simplify poll function --- release/scripts/startup/bl_ui/properties_material_gpencil.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (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 b62b251163e..282f8d77515 100644 --- a/release/scripts/startup/bl_ui/properties_material_gpencil.py +++ b/release/scripts/startup/bl_ui/properties_material_gpencil.py @@ -102,14 +102,14 @@ class MATERIAL_PT_gpencil_surface(GPMaterialButtonsPanel, Panel): @classmethod def poll(cls, context): ob = context.object - if ob is None: + if not (ob and ob.type == 'GPENCIL'): return False - ma = context.object.active_material - if ma is None or ma.grease_pencil is None: + ma = ob.active_material + if not (ma and ma.grease_pencil): return False - return ob.type == 'GPENCIL' + return True def draw_header_preset(self, context): MATERIAL_PT_gpencil_material_presets.draw_panel_header(self.layout) -- cgit v1.2.3