From 8b31f6fb2169e7163767e382adbef13587305aca Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 5 Nov 2018 15:31:25 +1100 Subject: Paint: add BKE_paint_ensure to initialize toolsettings Each mode had its own logic for initializing paint structs, move to a single function. Also remove "BKE_brush_get_gpencil_paint", entering grease pencil mode is responsible for ensuring the data is created. --- source/blender/editors/gpencil/gpencil_utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/gpencil/gpencil_utils.c') diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 5b8c11ac38c..41ea3a2138d 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -1201,7 +1201,8 @@ void ED_gpencil_add_defaults(bContext *C) /* ensure color exist */ BKE_gpencil_material_ensure(bmain, ob); - Paint *paint = BKE_brush_get_gpencil_paint(ts); + BKE_paint_ensure(ts, (Paint **)&ts->gp_paint); + Paint *paint = &ts->gp_paint->paint; /* if not exist, create a new one */ if (paint->brush == NULL) { /* create new brushes */ -- cgit v1.2.3