GPencil: Use default material when slot material is empty

When a material slot is empty, the default material is used.

The default color used is Gray to get a good contrast in dense scenes with dark and white background.

Reviewers: brecht, dfelinto, mendio, pepeland

Differential Revision: https://developer.blender.org/D5625
This commit is contained in:
2019-08-30 14:19:07 +02:00
parent 4608220c9b
commit d5d3dc4189
15 changed files with 129 additions and 49 deletions

View File

@@ -892,7 +892,8 @@ class GreasePencilMaterialsPanel:
if is_view3d and brush is not None:
gp_settings = brush.gpencil_settings
if gp_settings.use_material_pin is False:
ma = ob.material_slots[ob.active_material_index].material
if ob.active_material_index > 0:
ma = ob.material_slots[ob.active_material_index].material
else:
ma = gp_settings.material