diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2013-04-16 19:02:41 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2013-04-16 19:02:41 +0400 |
commit | 53c9507c2878b38176c841c4a2172ea7f543aaba (patch) | |
tree | 72ed3397704e272a4a5cc9a60701e21347609b3d /source/blender/blenkernel/intern | |
parent | ea0ad013d35984cba06cd8318fd42cc39c74c37f (diff) |
Option to hide overlay during a stroke. To enable, press the brush icon
next to the overlay alpha.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/brush.c | 11 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/paint.c | 18 |
2 files changed, 26 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index 053c5ca9eed..dd74df2b4ae 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -274,6 +274,11 @@ void BKE_brush_debug_print_state(Brush *br) else if (!(br->flag & _f) && (def.flag & _f)) \ printf("br->flag &= ~" #_f ";\n") +#define BR_TEST_FLAG_OVERLAY(_f) \ + if ((br->overlay_flags & _f) && !(def.overlay_flags & _f)) \ + printf("br->overlay_flags |= " #_f ";\n"); \ + else if (!(br->overlay_flags & _f) && (def.overlay_flags & _f)) \ + printf("br->overlay_flags &= ~" #_f ";\n") /* print out any non-default brush state */ BR_TEST(normal_weight, f); @@ -301,7 +306,6 @@ void BKE_brush_debug_print_state(Brush *br) BR_TEST_FLAG(BRUSH_SPACE_ATTEN); BR_TEST_FLAG(BRUSH_ADAPTIVE_SPACE); BR_TEST_FLAG(BRUSH_LOCK_SIZE); - BR_TEST_FLAG(BRUSH_TEXTURE_OVERLAY); BR_TEST_FLAG(BRUSH_EDGE_TO_EDGE); BR_TEST_FLAG(BRUSH_RESTORE_MESH); BR_TEST_FLAG(BRUSH_INVERSE_SMOOTH_PRESSURE); @@ -310,6 +314,11 @@ void BKE_brush_debug_print_state(Brush *br) BR_TEST_FLAG(BRUSH_FRONTFACE); BR_TEST_FLAG(BRUSH_CUSTOM_ICON); + BR_TEST_FLAG_OVERLAY(BRUSH_OVERLAY_CURSOR); + BR_TEST_FLAG_OVERLAY(BRUSH_OVERLAY_PRIMARY); + BR_TEST_FLAG_OVERLAY(BRUSH_OVERLAY_SECONDARY); + BR_TEST_FLAG_OVERLAY(BRUSH_OVERLAY_OVERRIDE_ON_STROKE); + BR_TEST(jitter, f); BR_TEST(spacing, d); BR_TEST(smooth_stroke_radius, d); diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 402aebdfed4..59bfb987a19 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -57,7 +57,7 @@ const char PAINT_CURSOR_VERTEX_PAINT[3] = {255, 255, 255}; const char PAINT_CURSOR_WEIGHT_PAINT[3] = {200, 200, 255}; const char PAINT_CURSOR_TEXTURE_PAINT[3] = {255, 255, 255}; -static int overlay_flags = 0; +static OverlayControlFlags overlay_flags = 0; void BKE_paint_invalidate_overlay_tex (Scene *scene, const Tex *tex) { @@ -89,11 +89,25 @@ void BKE_paint_invalidate_overlay_all(void) PAINT_INVALID_OVERLAY_CURVE); } -int BKE_paint_get_overlay_flags(void) +OverlayControlFlags BKE_paint_get_overlay_flags(void) { return overlay_flags; } +void BKE_paint_set_overlay_override(bool flag) +{ + if (flag) + overlay_flags |= PAINT_OVERLAY_OVERRIDE; + else + overlay_flags &= ~PAINT_OVERLAY_OVERRIDE; +} + +bool BKE_paint_get_overlay_override(void) +{ + return ((overlay_flags & PAINT_OVERLAY_OVERRIDE) != 0 ); +} + + void BKE_paint_reset_overlay_invalid(void) { overlay_flags &= ~(PAINT_INVALID_OVERLAY_TEXTURE_PRIMARY | |