diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2019-09-17 16:11:55 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2019-09-26 17:56:34 +0300 |
commit | a933237d68788583bb19c254f8c64b74afd4ecd1 (patch) | |
tree | af054bbb1987d5a931d6e01e36395604cfcbff00 /source/blender/editors/sculpt_paint/sculpt.c | |
parent | e5c9bf3aa28af3d1edddecb909b5a95fe029e18e (diff) |
Fix accumulate in Draw Sharp brush
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D5814
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 73461851111..4bd2fe192f1 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -5916,12 +5916,21 @@ static void sculpt_update_cache_invariants( /* Make copies of the mesh vertex locations and normals for some tools */ if (brush->flag & BRUSH_ANCHORED) { - cache->original = 1; + cache->original = true; + } + + /* Draw sharp does not need the original coordinates to produce the accumulate effect, so it + * should work the opposite way. */ + if (brush->sculpt_tool == SCULPT_TOOL_DRAW_SHARP) { + cache->original = true; } if (SCULPT_TOOL_HAS_ACCUMULATE(brush->sculpt_tool)) { if (!(brush->flag & BRUSH_ACCUMULATE)) { - cache->original = 1; + cache->original = true; + if (brush->sculpt_tool == SCULPT_TOOL_DRAW_SHARP) { + cache->original = false; + } } } @@ -6452,7 +6461,7 @@ bool sculpt_stroke_get_location(bContext *C, float out[3], const float mouse[2]) ss = ob->sculpt; cache = ss->cache; - original = (cache) ? cache->original : 0; + original = (cache) ? cache->original : false; const Brush *brush = BKE_paint_brush(BKE_paint_get_active_from_context(C)); |