diff options
author | Patrick Busch <Xylvier> | 2021-03-02 22:13:36 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-03-02 22:13:36 +0300 |
commit | 3eb8307160e327f64593d218125d02289285aa17 (patch) | |
tree | 67a536f8ccc390d3936e5edef5239f27e58cbb3d /source/blender/blenkernel/intern/colortools.c | |
parent | 85421c4fab029ccb0747338715b95910e82229f9 (diff) |
Python API: Expose CurveMapping Reset View function
The Python API for the curve mapping widget offers the `update`
function, but no way to reset the view to the clipping rectangle.
This commit adds a blenkernel function for this operation,
and exposes it to the CurvMapping RNA API. This allows addons
to display a more user-friendly view of the data in this widget.
Differential Revision: https://developer.blender.org/D10561
Diffstat (limited to 'source/blender/blenkernel/intern/colortools.c')
-rw-r--r-- | source/blender/blenkernel/intern/colortools.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 3eb9fb6161d..44d9bd6b2d2 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -965,6 +965,12 @@ void BKE_curvemapping_changed_all(CurveMapping *cumap) cumap->cur = cur; } +/* Reset the view for current curve. */ +void BKE_curvemapping_reset_view(CurveMapping *cumap) +{ + cumap->curr = cumap->clipr; +} + /* table should be verified */ float BKE_curvemap_evaluateF(const CurveMapping *cumap, const CurveMap *cuma, float value) { |