diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2019-03-08 21:30:22 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2019-03-08 21:36:31 +0300 |
commit | 4ccaf56814a1389516dba7b2eb8fde0944dfccd8 (patch) | |
tree | 0318c455da798488bea5c0aa225fc8220f41fec5 /release/scripts/startup/bl_ui/properties_material.py | |
parent | cee7c36cbddc47fbf257a8b9fdca9c424b684c91 (diff) |
Fix T62349: Grease Pencil top material list not working
This is a fixup for my own: 92d185faebe.
I'm also fixing the poll of the EEVEE_MATERIAL_PT_context_material
which would fail when we had no context.material available.
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_material.py')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_material.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py index 07c94c90738..b05955e3598 100644 --- a/release/scripts/startup/bl_ui/properties_material.py +++ b/release/scripts/startup/bl_ui/properties_material.py @@ -87,8 +87,13 @@ class EEVEE_MATERIAL_PT_context_material(MaterialButtonsPanel, Panel): @classmethod def poll(cls, context): + ob = context.object mat = context.material - return (context.object or mat) and (context.engine in cls.COMPAT_ENGINES) and not mat.grease_pencil + + if (ob and ob.type == 'GPENCIL') or (mat and mat.grease_pencil): + return False + + return (ob or mat) and (context.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout |