Blender Git Commit Log

Git Commits -> Revision 0447aed

Revision 0447aed by Henrik Dick (master)
May 17, 2021, 07:33 (GMT)
UI: add non-linear slider support

This patch introduces non linear sliders. That means, that the movement
of the mouse doesn't map linearly to the value of the slider.

The following changes have been made.

- Free logarithmic sliders with maximum range of (`0 <= x < inf`)
- Logarithmic sliders with correct value indication bar.
- Free cubic sliders with maximum range of (`-inf < x < inf`)
- Cubic sliders with correct value indication bar.

Cubic mapping has been added as well, because it's used for brush sizes
in other applications (Krita for e.g.).

To make a slider have a different scale type use following line in RNA:
`RNA_def_property_ui_scale_type(prop, PROP_SCALE_LOGARITHMIC);`
or:
`RNA_def_property_ui_scale_type(prop, PROP_SCALE_CUBIC);`

Test the precision, step size and soft-min if you change the scale type
of a property as it will feel very different and may need tweaking.

Ref D9074

Commit Details:

Full Hash: 0447aedb960a1dc514fee8cd99d0eee43fae86ad
Parent Commit: 4586305
Committed By: Campbell Barton
Lines Changed: +352, -50

11 Modified Paths:

/source/blender/editors/interface/interface.c (+8, -0) (Diff)
/source/blender/editors/interface/interface_handlers.c (+217, -44) (Diff)
/source/blender/editors/interface/interface_intern.h (+1, -0) (Diff)
/source/blender/editors/interface/interface_widgets.c (+29, -6) (Diff)
/source/blender/makesrna/intern/makesrna.c (+27, -0) (Diff)
/source/blender/makesrna/intern/rna_access.c (+18, -0) (Diff)
/source/blender/makesrna/intern/rna_define.c (+22, -0) (Diff)
/source/blender/makesrna/intern/rna_internal_types.h (+2, -0) (Diff)
/source/blender/makesrna/RNA_access.h (+1, -0) (Diff)
/source/blender/makesrna/RNA_define.h (+1, -0) (Diff)
/source/blender/makesrna/RNA_types.h (+26, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021