From 56917bcf731c6d3568d920a6ccbec524c25aaea1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 5 Nov 2018 15:46:08 +1100 Subject: Missing from last commit --- source/blender/editors/sculpt_paint/paint_vertex.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index c36caf5184b..22695423bda 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -274,15 +274,6 @@ bool weight_paint_poll_ignore_tool(bContext *C) return weight_paint_poll_ex(C, false); } -static VPaint *new_vpaint(void) -{ - VPaint *vp = MEM_callocN(sizeof(VPaint), "VPaint"); - - vp->paint.flags |= PAINT_SHOW_BRUSH; - - return vp; -} - uint vpaint_get_current_col(Scene *scene, VPaint *vp, bool secondary) { Brush *brush = BKE_paint_brush(&vp->paint); @@ -1082,10 +1073,7 @@ static void ed_vwpaintmode_enter_generic( const ePaintMode paint_mode = ePaintVertex; ED_mesh_color_ensure(me, NULL); - if (scene->toolsettings->vpaint == NULL) { - scene->toolsettings->vpaint = new_vpaint(); - } - + BKE_paint_ensure(scene->toolsettings, (Paint **)&scene->toolsettings->vpaint); Paint *paint = BKE_paint_get_active_from_paintmode(scene, paint_mode); paint_cursor_start_explicit(paint, wm, vertex_paint_poll); BKE_paint_init(bmain, scene, paint_mode, PAINT_CURSOR_VERTEX_PAINT); @@ -1093,10 +1081,7 @@ static void ed_vwpaintmode_enter_generic( else if (mode_flag == OB_MODE_WEIGHT_PAINT) { const ePaintMode paint_mode = ePaintWeight; - if (scene->toolsettings->wpaint == NULL) { - scene->toolsettings->wpaint = new_vpaint(); - } - + BKE_paint_ensure(scene->toolsettings, (Paint **)&scene->toolsettings->wpaint); Paint *paint = BKE_paint_get_active_from_paintmode(scene, paint_mode); paint_cursor_start_explicit(paint, wm, weight_paint_poll); BKE_paint_init(bmain, scene, paint_mode, PAINT_CURSOR_WEIGHT_PAINT); -- cgit v1.2.3