Commit: 5aecc4b57bb54464e8cc8bcf239d42c1d78322f0
Author: Pablo Dobarro
Date:   Mon Aug 17 18:28:39 2020 +0200
Branches: master
https://developer.blender.org/rB5aecc4b57bb54464e8cc8bcf239d42c1d78322f0

Fix Cloth Brush Grab deform types not working with spacing

Even the Cloth Brush grab works like a regular grab brush, it makes
sense to support spacing just in this brush in order to prevent creating
more brush steps that update the simulation. This way, it is possible to
create grab brushes that update the simulation constantly while grabbing
(using the dots stroke mode) or brushes that only update the simulation
when the cursor moves (using spacing).

Reviewed By: sergey

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

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

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

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

diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c 
b/source/blender/editors/sculpt_paint/paint_stroke.c
index 90b0f017bd6..071042e6728 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -997,7 +997,19 @@ static void stroke_done(bContext *C, wmOperator *op)
 /* Returns zero if the stroke dots should not be spaced, non-zero otherwise */
 bool paint_space_stroke_enabled(Brush *br, ePaintMode mode)
 {
-  return (br->flag & BRUSH_SPACE) && paint_supports_dynamic_size(br, mode);
+  if ((br->flag & BRUSH_SPACE) == 0) {
+    return false;
+  }
+
+  if (br->sculpt_tool == SCULPT_TOOL_CLOTH) {
+    /* The Cloth Brush is a special case for stroke spacing. Even if it has 
grab modes which do
+     * not support dynamic size, stroke spacing needs to be enabled so it is 
possible to control
+     * whether the simulation runs constantly or only when the brush moves 
when using the cloth
+     * grab brushes. */
+    return true;
+  }
+
+  return paint_supports_dynamic_size(br, mode);
 }
 
 static bool sculpt_is_grab_tool(Brush *br)

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to