diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-05 07:46:08 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-05 07:47:22 +0300 |
commit | 56917bcf731c6d3568d920a6ccbec524c25aaea1 (patch) | |
tree | 3406b2e3b53a7eda615b4a553e0b5951faa4657e | |
parent | 8b31f6fb2169e7163767e382adbef13587305aca (diff) |
Missing from last commit
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_vertex.c | 19 |
1 files 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); |