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/editors/sculpt_paint/paint_cursor.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/editors/sculpt_paint/paint_cursor.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_cursor.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index 286cf97c20e..1f706d2f169 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -1261,7 +1261,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused)) /* set various defaults */ const float *outline_col = brush->add_col; - const float outline_alpha = 0.5f; + const float outline_alpha = 0.7f; float translation[2] = {x, y}; float final_radius = (BKE_brush_size_get(scene, brush) * zoomx); @@ -1434,7 +1434,11 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused)) GPU_matrix_mul(cursor_trans); GPU_matrix_mul(cursor_rot); immUniformColor3fvAlpha(outline_col, outline_alpha); - imm_draw_circle_wire_3d(pos, 0, 0, rds, 40); + GPU_line_width(2.0f); + imm_draw_circle_wire_3d(pos, 0, 0, rds, 80); + GPU_line_width(1.0f); + immUniformColor3fvAlpha(outline_col, outline_alpha * 0.5f); + imm_draw_circle_wire_3d(pos, 0, 0, rds * clamp_f(brush->alpha, 0.0f, 1.0f), 80); GPU_matrix_pop(); /* Update and draw dynamic mesh preview lines */ @@ -1467,7 +1471,15 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused)) /* Draw default cursor when the mouse is not over the mesh or there are no supported * overlays active */ GPU_line_width(1.0f); - imm_draw_circle_wire_3d(pos, translation[0], translation[1], final_radius, 40); + /* Reduce alpha to increase the contrast when the cursor is over the mesh */ + immUniformColor3fvAlpha(outline_col, outline_alpha * 0.8); + imm_draw_circle_wire_3d(pos, translation[0], translation[1], final_radius, 80); + immUniformColor3fvAlpha(outline_col, outline_alpha * 0.35f); + imm_draw_circle_wire_3d(pos, + translation[0], + translation[1], + final_radius * clamp_f(brush->alpha, 0.0f, 1.0f), + 80); } } else { |