Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-12-18 18:19:12 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-12-18 18:19:12 +0300
commitc46a9d811789706e77db3d0b92f4b943fb86f386 (patch)
treeb6ea007f13bb6cb831281594c4bea59f835544d8 /source/blender/editors/sculpt_paint/paint_stroke.c
parent1fb43dcd5a7549f98a96faa41110ca22877003e5 (diff)
parent344eff9c4804f99b633c8054b888a8667ea24ddc (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_stroke.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index dacaea6a96e..9dd51b289f4 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -233,6 +233,9 @@ static bool paint_brush_update(bContext *C,
UnifiedPaintSettings *ups = stroke->ups;
bool location_sampled = false;
bool location_success = false;
+ /* Use to perform all operations except applying the stroke,
+ * needed for operations that require cursor motion (rake). */
+ bool is_dry_run = false;
bool do_random = false;
bool do_random_mask = false;
/* XXX: Use pressure value from first brush step for brushes which don't
@@ -371,7 +374,10 @@ static bool paint_brush_update(bContext *C,
}
/* curve strokes do their own rake calculation */
else if (!(brush->flag & BRUSH_CURVE)) {
- paint_calculate_rake_rotation(ups, brush, mouse_init);
+ if (!paint_calculate_rake_rotation(ups, brush, mouse_init)) {
+ /* Not enough motion to define an angle. */
+ is_dry_run = true;
+ }
}
}
@@ -402,7 +408,7 @@ static bool paint_brush_update(bContext *C,
}
}
- return location_success;
+ return location_success && (is_dry_run == false);
}
static bool paint_stroke_use_jitter(ePaintMode mode, Brush *brush, bool invert)