diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2019-08-30 15:19:07 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2019-08-30 15:26:39 +0300 |
commit | d5d3dc418912863b172ef9f79f9991bb9d46bea8 (patch) | |
tree | d3aeb45c89025a1c5c0cabdf6ca4d3746115b848 /release | |
parent | 4608220c9b3c0adfdab3cd6994d29c0ced748794 (diff) |
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
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_grease_pencil_common.py | 3 |
1 files changed, 2 insertions, 1 deletions
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 9c8f62fb906..b41be13555c 100644 --- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py +++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py @@ -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 |