[Bf-blender-cvs] [19ea601] : Fix T39034 brush always shown even after deactivating the show cursor option after reentering a paint mode.

Antony Riakiotakis noreply at git.blender.org
Wed Mar 12 18:22:36 CET 2014


Commit: 19ea6018134ba0fd5d90ce67a2d50f2c8fc9bae6
Author: Antony Riakiotakis
Date:   Mon Mar 10 18:42:35 2014 +0200
https://developer.blender.org/rB19ea6018134ba0fd5d90ce67a2d50f2c8fc9bae6

Fix T39034 brush always shown even after deactivating the show cursor
option after reentering a paint mode.

Solution by Bastien with modifications, thanks!
Show Brush flag need not be reenabled always, but make sure it is at
least enabled once on paint initialization.

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

M	source/blender/blenkernel/intern/paint.c
M	source/blender/blenkernel/intern/scene.c
M	source/blender/editors/sculpt_paint/paint_vertex.c
M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/editors/sculpt_paint/sculpt_uv.c

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

diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index 5a38445..4d84dd5 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -308,8 +308,6 @@ void BKE_paint_init(Paint *p, const char col[3])
 
 	memcpy(p->paint_cursor_col, col, 3);
 	p->paint_cursor_col[3] = 128;
-
-	p->flags |= PAINT_SHOW_BRUSH;
 }
 
 void BKE_paint_free(Paint *paint)
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 6d62d97..110e917 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -542,6 +542,8 @@ Scene *BKE_scene_add(Main *bmain, const char *name)
 
 	sce->toolsettings->proportional_size = 1.0f;
 
+	sce->toolsettings->imapaint.paint.flags |= PAINT_SHOW_BRUSH;
+
 	sce->physics_settings.gravity[0] = 0.0f;
 	sce->physics_settings.gravity[1] = 0.0f;
 	sce->physics_settings.gravity[2] = -9.81f;
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 55296ae..12eb152 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -189,6 +189,7 @@ static VPaint *new_vpaint(int wpaint)
 	VPaint *vp = MEM_callocN(sizeof(VPaint), "VPaint");
 	
 	vp->flag = (wpaint) ? 0 : VP_SPRAY;
+	vp->paint.flags |= PAINT_SHOW_BRUSH;
 
 	return vp;
 }
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 226b1ea..d74e9c9e 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -5125,6 +5125,7 @@ static int sculpt_mode_toggle_exec(bContext *C, wmOperator *op)
 
 			/* Turn on X plane mirror symmetry by default */
 			ts->sculpt->paint.symmetry_flags |= PAINT_SYMM_X;
+			ts->sculpt->paint.flags |= PAINT_SHOW_BRUSH;
 
 			/* Make sure at least dyntopo subdivision is enabled */
 			ts->sculpt->flags |= SCULPT_DYNTOPO_SUBDIVIDE;
diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c
index 4dc2c87..da2b62b 100644
--- a/source/blender/editors/sculpt_paint/sculpt_uv.c
+++ b/source/blender/editors/sculpt_paint/sculpt_uv.c
@@ -194,6 +194,8 @@ void ED_space_image_uv_sculpt_update(wmWindowManager *wm, ToolSettings *settings
 			settings->uv_sculpt_tool = UV_SCULPT_TOOL_GRAB;
 			settings->uv_sculpt_settings = UV_SCULPT_LOCK_BORDERS | UV_SCULPT_ALL_ISLANDS;
 			settings->uv_relax_method = UV_SCULPT_TOOL_RELAX_LAPLACIAN;
+			/* Uv sculpting does not include explicit brush view control yet, always enable */
+			settings->uvsculpt->paint.flags |= PAINT_SHOW_BRUSH;
 		}
 
 		BKE_paint_init(&settings->uvsculpt->paint, PAINT_CURSOR_SCULPT);




More information about the Bf-blender-cvs mailing list