This patch introduces non linear sliders. That means, that the movement of the mouse doesn't map linearly to the value of the slider.
There are many sliders in blender, where the linear default behavior is not helpful. For example all the sliders for merge thresholds.
The important values there are spaced logarithmic. There is also one particular slider, which causes massive issues in voxel remesh (T77868).
The voxel remesh slider should now be much more tame, so nobody must fear tweaking it anymore, but this is still no absolute solution to T77868 IMO.
This patch includes:
- 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.
I decided to add the cubic mapping as well, because Krita uses it for its brush size and I figured why not.
NOTE: The scale types are available for all float sliders. For integer sliders they are only available if they use the visible value bar. Sliders with logarithmic scale and value bar must have a range > 0 while logarithmic sliders without the value bar can have a range of >= 0.
Since we don't have a float brush size in blender and we also usually need different brush sizes than Krita does, I didn't add it to the sliders here.
I did however add the behavior to the following sliders:
- Boolean Modifier > Fast > Overlap Threshold (Logarithmic)
- Remesh Modifier > Voxel > Voxel Size (Logarithmic)
- Sculpt > Dyntopo > Detail Size (Cubic)
For Developers:
To make a slider have a different scale type use following line in the rna:
RNA_def_property_ui_scale_type(prop, PROP_SCALE_LOG);
or
RNA_def_property_ui_scale_type(prop, PROP_SCALE_CUBIC);
Remember to test the precision, step size and softmin if you change the scale type of a property as it will feel very different and may need tweaking.