[Bf-blender-cvs] [56917bcf731] blender2.8: Missing from last commit

Campbell Barton noreply at git.blender.org
Mon Nov 5 05:47:51 CET 2018


Commit: 56917bcf731c6d3568d920a6ccbec524c25aaea1
Author: Campbell Barton
Date:   Mon Nov 5 15:46:08 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB56917bcf731c6d3568d920a6ccbec524c25aaea1

Missing from last commit

===================================================================

M	source/blender/editors/sculpt_paint/paint_vertex.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list