From 5aecc4b57bb54464e8cc8bcf239d42c1d78322f0 Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Mon, 17 Aug 2020 18:28:39 +0200 Subject: 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 --- source/blender/editors/sculpt_paint/paint_stroke.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'source/blender') 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) -- cgit v1.2.3