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:
authorCampbell Barton <ideasman42@gmail.com>2017-12-18 06:35:15 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-12-18 06:35:15 +0300
commit076616898bff0acfc2336351ee975bd0fef944b2 (patch)
treed75210b7af56af60352c4d568141188fa188de67 /source/blender/blenkernel/intern/paint.c
parent342a322a93361adf94511bec281428cd6bf2337a (diff)
Fix T53577: Rake sculpt/paint wrong on first step
Diffstat (limited to 'source/blender/blenkernel/intern/paint.c')
-rw-r--r--source/blender/blenkernel/intern/paint.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index c1ad31a1cab..32813ffce25 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -638,8 +638,9 @@ void paint_update_brush_rake_rotation(UnifiedPaintSettings *ups, Brush *brush, f
ups->brush_rotation_sec = 0.0f;
}
-void paint_calculate_rake_rotation(UnifiedPaintSettings *ups, Brush *brush, const float mouse_pos[2])
+bool paint_calculate_rake_rotation(UnifiedPaintSettings *ups, Brush *brush, const float mouse_pos[2])
{
+ bool ok = false;
if ((brush->mtex.brush_angle_mode & MTEX_ANGLE_RAKE) || (brush->mask_mtex.brush_angle_mode & MTEX_ANGLE_RAKE)) {
const float r = RAKE_THRESHHOLD;
float rotation;
@@ -655,16 +656,20 @@ void paint_calculate_rake_rotation(UnifiedPaintSettings *ups, Brush *brush, cons
ups->last_rake_angle = rotation;
paint_update_brush_rake_rotation(ups, brush, rotation);
+ ok = true;
}
/* make sure we reset here to the last rotation to avoid accumulating
* values in case a random rotation is also added */
else {
paint_update_brush_rake_rotation(ups, brush, ups->last_rake_angle);
+ ok = false;
}
}
else {
ups->brush_rotation = ups->brush_rotation_sec = 0.0f;
+ ok = true;
}
+ return ok;
}
void BKE_sculptsession_free_deformMats(SculptSession *ss)