From 2de9da6ee9a8813704ad402c7bc4ba77b35a9267 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Mon, 10 Mar 2014 18:42:35 +0200 Subject: 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. --- source/blender/blenkernel/intern/paint.c | 2 -- source/blender/blenkernel/intern/scene.c | 2 ++ source/blender/editors/sculpt_paint/paint_vertex.c | 1 + source/blender/editors/sculpt_paint/sculpt.c | 1 + source/blender/editors/sculpt_paint/sculpt_uv.c | 2 ++ 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 5a38445ee02..4d84dd5fbb1 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 da2eda0fbee..bc83adb31d3 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 55296aeda18..12eb1524515 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 c4c800434ad..eac18533e85 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -5140,6 +5140,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 4dc2c87ca0a..da2b62bce8b 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); -- cgit v1.2.3