From 7021bd527380b4d87cf48057f0039509326b03dd Mon Sep 17 00:00:00 2001 From: Antonioya Date: Mon, 25 Mar 2019 17:02:42 +0100 Subject: GPencil: Only brushes with pinned materials have materials Using GP_BRUSH_MATERIAL_PINNED to switch between active material and brush material, instead of updating all brushes on active material changes. This will allow brushes to have no material and therefore to not inflate the user count. This fix T62465. Patch contributed by @matc Reviewers: @brecht @antoniov @billreynish @mendio --- source/blender/draw/engines/gpencil/gpencil_draw_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/draw') diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c index 2710ecc5e5b..475a083ac97 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c @@ -1355,7 +1355,7 @@ void DRW_gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data, void *vedata, T float obscale = mat4_to_scale(ob->obmat); /* use the brush material */ - Material *ma = BKE_gpencil_get_material_from_brush(brush); + Material *ma = BKE_gpencil_get_material_for_brush(ob, brush); if (ma != NULL) { gp_style = ma->gp_style; } -- cgit v1.2.3