From 2525f9c5f31e90bcb8f2e8c84558a2bc35e3207c Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 12 Mar 2014 23:57:33 +0600 Subject: backport revisions from master for 2.70-rc2 tag This includes: 68ef679, d0ad48f, e913eab + 8d09ec6, 9630fa7, 4ce7d5c, b839fb9, 43b5f0a, 4d47e75, 89c793f, b23a439, 0a3850f de86b70, cfefc5d, 997b49a, 6919ffb, c1be7e1, 6ddd54f 7a9838b + 98abc80, 23fbc9f, 41dde55, 500088d, c2045ef c31c8fa, 7461fea, d219312, 0844451 + c05896e, ef51b69 19935f0, b977cfd, 3c3c2cd, 9ecf73f, 20f7a34, f03df4f 2de9da6, ba81fb7, a7ab389, d7cff8f7 --- source/blender/editors/sculpt_paint/paint_vertex.c | 1 + source/blender/editors/sculpt_paint/sculpt.c | 9 ++++++++- source/blender/editors/sculpt_paint/sculpt_uv.c | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/sculpt_paint') 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 5d4037a2bd3..d74e9c9e17b 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -2195,7 +2195,7 @@ static void do_layer_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode mul_v3_v3fl(val, offset, *disp); - if (ss->layer_co && (brush->flag & BRUSH_PERSISTENT)) { + if (!ss->multires && !ss->bm && ss->layer_co && (brush->flag & BRUSH_PERSISTENT)) { int index = vd.vert_indices[vd.i]; /* persistent base */ @@ -3953,6 +3953,12 @@ static void sculpt_update_cache_invariants(bContext *C, Sculpt *sd, SculptSessio } } } + + if (ss->bm) { + /* Free any remaining layer displacements from nodes. If not and topology changes + * from using another tool, then next layer toolstroke can access past disp array bounds */ + BKE_pbvh_free_layer_disp(ss->pbvh); + } } /* Make copies of the mesh vertex locations and normals for some tools */ @@ -5119,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 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