[Bf-blender-cvs] [d3275178fe3] blender-v2.83-release: Fix T77082: Greasepencil error accessing material dropdown on an object without materials
Philipp Oeser
noreply at git.blender.org
Tue May 26 15:03:43 CEST 2020
Commit: d3275178fe329d91e27fd42c689de2254b946882
Author: Philipp Oeser
Date: Tue May 26 10:57:06 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rBd3275178fe329d91e27fd42c689de2254b946882
Fix T77082: Greasepencil error accessing material dropdown on an object without materials
Differential Revision: https://developer.blender.org/D7841
===================================================================
M release/scripts/startup/bl_ui/properties_grease_pencil_common.py
===================================================================
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
More information about the Bf-blender-cvs
mailing list