diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-12-02 05:59:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-12-02 06:02:03 +0300 |
commit | a56b024964b186e3ffbc5b234184757d2113a470 (patch) | |
tree | 1e38292ebbfa3120e05605904c3ff737160d2ad8 | |
parent | 28b83b34d4edbb314665e3d0ddf87144c6903408 (diff) |
Cleanup: simplify poll function
-rw-r--r-- | release/scripts/startup/bl_ui/properties_material_gpencil.py | 8 |
1 files changed, 4 insertions, 4 deletions
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) |