[Bf-blender-cvs] [a933237d687] master: Fix accumulate in Draw Sharp brush

Pablo Dobarro noreply at git.blender.org
Thu Sep 26 16:54:42 CEST 2019


Commit: a933237d68788583bb19c254f8c64b74afd4ecd1
Author: Pablo Dobarro
Date:   Tue Sep 17 15:11:55 2019 +0200
Branches: master
https://developer.blender.org/rBa933237d68788583bb19c254f8c64b74afd4ecd1

Fix accumulate in Draw Sharp brush

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D5814

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

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

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

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



More information about the Bf-blender-cvs mailing list