From d3275178fe329d91e27fd42c689de2254b946882 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Tue, 26 May 2020 10:57:06 +0200 Subject: Fix T77082: Greasepencil error accessing material dropdown on an object without materials Differential Revision: https://developer.blender.org/D7841 --- release/scripts/startup/bl_ui/properties_grease_pencil_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py index 8b02f858b65..6a94212fb81 100644 --- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py +++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py @@ -639,7 +639,7 @@ class GreasePencilMaterialsPanel: if is_view3d and brush is not None: gp_settings = brush.gpencil_settings if gp_settings.use_material_pin is False: - if ob.active_material_index >= 0: + if len(ob.material_slots) > 0 and ob.active_material_index >= 0: ma = ob.material_slots[ob.active_material_index].material else: ma = gp_settings.material -- cgit v1.2.3