diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2019-09-26 18:51:21 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2019-09-27 20:16:03 +0300 |
commit | be985bdde27f817c4caeab281ca7b666b2bd3a3c (patch) | |
tree | c4c8494b1828f16dad7804458af2eb68bb9963f7 /source/blender/blenkernel/intern/brush.c | |
parent | c372318165cd56e9c09eb5792714d9efd98ff265 (diff) |
Sculpt: Sculpt cursor UX improvements
This commit introduces the following changes:
- Invert the direction of the brush strength WM control. It was working in the opposite direction to any other control in Blender. Now dragging to the right increases the strength.
- Increase the alpha of the cursor
- Remove the font shadow of the numbers in the WM control. It was adding too much visual noise when rendered on top of the brush alpha
- Add a second circle to preview the strength in the cursor
- Increase the resolution of the cursor circles. Now they look smooth even when working with large brush sizes.
- Add a line preview to display the brush curve
- Don't offset the cursor preview when changing size and strength
Reviewed By: billreynish, brecht
Differential Revision: https://developer.blender.org/D5889
Diffstat (limited to 'source/blender/blenkernel/intern/brush.c')
-rw-r--r-- | source/blender/blenkernel/intern/brush.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index e697b548678..95d3f47c38c 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -1596,11 +1596,11 @@ unsigned int *BKE_brush_gen_texture_cache(Brush *br, int half_side, bool use_sec } /**** Radial Control ****/ -struct ImBuf *BKE_brush_gen_radial_control_imbuf(Brush *br, bool secondary) +struct ImBuf *BKE_brush_gen_radial_control_imbuf(Brush *br, bool secondary, bool display_gradient) { ImBuf *im = MEM_callocN(sizeof(ImBuf), "radial control texture"); unsigned int *texcache; - int side = 128; + int side = 512; int half = side / 2; int i, j; @@ -1609,15 +1609,17 @@ struct ImBuf *BKE_brush_gen_radial_control_imbuf(Brush *br, bool secondary) im->rect_float = MEM_callocN(sizeof(float) * side * side, "radial control rect"); im->x = im->y = side; - for (i = 0; i < side; i++) { - for (j = 0; j < side; j++) { - float magn = sqrtf(pow2f(i - half) + pow2f(j - half)); - im->rect_float[i * side + j] = BKE_brush_curve_strength_clamped(br, magn, half); + if (display_gradient || texcache) { + for (i = 0; i < side; i++) { + for (j = 0; j < side; j++) { + float magn = sqrtf(pow2f(i - half) + pow2f(j - half)); + im->rect_float[i * side + j] = BKE_brush_curve_strength_clamped(br, magn, half); + } } } - /* Modulate curve with texture */ if (texcache) { + /* Modulate curve with texture */ for (i = 0; i < side; i++) { for (j = 0; j < side; j++) { const int col = texcache[i * side + j]; @@ -1626,7 +1628,6 @@ struct ImBuf *BKE_brush_gen_radial_control_imbuf(Brush *br, bool secondary) 3.0f / 255.0f; } } - MEM_freeN(texcache); } |