diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2019-05-06 14:03:23 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2019-05-06 14:44:22 +0300 |
commit | e9160eae95032d1be5c224ce450d6f7699767094 (patch) | |
tree | bb1719c04204a535a7ff53a26655a650fbec4f1f /source | |
parent | d7ffb5cb0b9b44ffe4f005a8f9c89527d092cfef (diff) |
Fix T64164: Resetting a curvemap could result in a mirrored curve
A template_curve_mapping with brush=True was always resetting the curve
to a positive slope (descending from left to right).
Behaviour is now changed so that specifying "use_negative_slope" is
taken into account as well.
Also use this for:
- paint "cavity_curve"
- gpencil "curve_sensitivity" / "curve_strength" / "curve_jitter" /
"interpolation_curve"
Reviewers: brecht
Maniphest Tasks: T64164
Differential Revision: https://developer.blender.org/D4809
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index e96141eaa05..40c85217bb3 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -4042,6 +4042,11 @@ static uiBlock *curvemap_brush_tools_func(bContext *C, ARegion *ar, void *cumap_ return curvemap_tools_func(C, ar, cumap_v, false, UICURVE_FUNC_RESET_NEG); } +static uiBlock *curvemap_brush_tools_negslope_func(bContext *C, ARegion *ar, void *cumap_v) +{ + return curvemap_tools_func(C, ar, cumap_v, false, UICURVE_FUNC_RESET_POS); +} + static void curvemap_buttons_redraw(bContext *C, void *UNUSED(arg1), void *UNUSED(arg2)) { ED_region_tag_redraw(CTX_wm_region(C)); @@ -4217,7 +4222,19 @@ static void curvemap_buttons_layout(uiLayout *layout, TIP_("Zoom out")); UI_but_func_set(bt, curvemap_buttons_zoom_out, cumap, NULL); - if (brush) { + if (brush && neg_slope) { + bt = uiDefIconBlockBut(block, + curvemap_brush_tools_negslope_func, + cumap, + 0, + ICON_DOWNARROW_HLT, + 0, + 0, + dx, + dx, + TIP_("Tools")); + } + else if (brush) { bt = uiDefIconBlockBut(block, curvemap_brush_tools_func, cumap, |