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:
authorAntony Riakiotakis <kalast@gmail.com>2014-12-31 15:11:42 +0300
committerAntony Riakiotakis <kalast@gmail.com>2014-12-31 15:11:54 +0300
commita3e832e68b88ff9bea5aa14fdda867a1aaf6919e (patch)
tree1706d80d2ed79ec13e2f68e4c1102628a95ea62c /source/blender/blenkernel/intern/brush.c
parentbca434de78b4069c0597697a0893bbde7702c40b (diff)
Fix T42984 detail flood fill not respecting mask values for smooth/sharp
curves. Issue here is that brush curve could return negative values. This would result in overflow of mask values. Those were not visible during real time preview because result would be clamped. We had two functions in the code, one of which allowed negatives but I don't think that we really want that, users have no control over the negative values at all anyway. Thanks to the reporter, Leon Cheung for figuring out the issue :)
Diffstat (limited to 'source/blender/blenkernel/intern/brush.c')
-rw-r--r--source/blender/blenkernel/intern/brush.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index cdbcffe0ce4..0a57dc5c945 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -964,7 +964,7 @@ void BKE_brush_randomize_texture_coordinates(UnifiedPaintSettings *ups, bool mas
}
/* Uses the brush curve control to find a strength value between 0 and 1 */
-float BKE_brush_curve_strength_clamp(Brush *br, float p, const float len)
+float BKE_brush_curve_strength(Brush *br, float p, const float len)
{
float strength;
@@ -977,17 +977,6 @@ float BKE_brush_curve_strength_clamp(Brush *br, float p, const float len)
return strength;
}
-/* same as above but can return negative values if the curve enables
- * used for sculpt only */
-float BKE_brush_curve_strength(Brush *br, float p, const float len)
-{
- if (p >= len)
- p = 1.0f;
- else
- p = p / len;
-
- return curvemapping_evaluateF(br->curve, 0, p);
-}
/* TODO: should probably be unified with BrushPainter stuff? */
unsigned int *BKE_brush_gen_texture_cache(Brush *br, int half_side, bool use_secondary)
@@ -1045,7 +1034,7 @@ struct ImBuf *BKE_brush_gen_radial_control_imbuf(Brush *br, bool secondary)
for (i = 0; i < side; ++i) {
for (j = 0; j < side; ++j) {
float magn = sqrtf(pow2f(i - half) + pow2f(j - half));
- im->rect_float[i * side + j] = BKE_brush_curve_strength_clamp(br, magn, half);
+ im->rect_float[i * side + j] = BKE_brush_curve_strength(br, magn, half);
}
}