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>2015-06-10 14:32:11 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-06-10 14:32:28 +0300
commit9f911f62dcefd3ce4312bb8aa1d522cae6bbf6e9 (patch)
tree15729122676546f1b41a7b20f2255222d67ca7b9 /source/blender/blenkernel/intern/colortools.c
parent6e844da9dad5bcbc1fb747879fa2a11715223d84 (diff)
Fix T45013 negative curve falloff not working.
Was doing clamping as fix for T42984. Seems we can ommit clamping for sculpting if we make sure overlap is not zero with negative values. Control for clamping is moved to the "Use Clipping" function of curves (which is on by default), so both bugs remain squashed and advanced users can now properly utilize curves in sculpting, though not all brushes work well with negative curves.
Diffstat (limited to 'source/blender/blenkernel/intern/colortools.c')
-rw-r--r--source/blender/blenkernel/intern/colortools.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index c5f7e12c9d0..1120034e217 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -790,7 +790,17 @@ float curvemap_evaluateF(const CurveMap *cuma, float value)
float curvemapping_evaluateF(const CurveMapping *cumap, int cur, float value)
{
const CurveMap *cuma = cumap->cm + cur;
- return curvemap_evaluateF(cuma, value);
+ float val = curvemap_evaluateF(cuma, value);
+
+ /* account for clipping */
+ if (cumap->flag & CUMA_DO_CLIP) {
+ if (val < cumap->curr.ymin)
+ val = cumap->curr.ymin;
+ else if (val > cumap->curr.ymax)
+ val = cumap->curr.ymax;
+ }
+
+ return val;
}
/* vector case */