diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-09-18 15:25:52 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-09-18 15:25:52 +0400 |
commit | ab518939b55810a6bf0be7a23d5f66a547299cd8 (patch) | |
tree | 026a57388126f51675b7ccc8e0b6c67e01c0b56a /source/blender/editors/sculpt_paint | |
parent | d56e23afc08f931c6c5ef59e9822f9604b9db0c8 (diff) |
- jitter for painting (image and projection painting, others can be added)
- remove falloff setting now the curve is used.
- bugfix for airbrush & tablet, with no movement it would assume 1.0 pressure.
- rna, use the use_* prefix for brush options.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index e8dd27f1bd2..0d83cef3e95 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -4443,6 +4443,7 @@ typedef struct PaintOperation { int first; int prevmouse[2]; + float prev_pressure; /* need this since we dont get tablet events for pressure change */ int brush_size_orig; double starttime; @@ -4722,8 +4723,8 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event) if(wmtab->Active == EVT_TABLET_ERASER) pop->s.blend= IMB_BLEND_ERASE_ALPHA; } - else - pressure= 1.0f; + else /* otherwise airbrush becomes 1.0 pressure instantly */ + pressure= pop->prev_pressure ? pop->prev_pressure : 1.0f; if(pop->first) { pop->prevmouse[0]= mouse[0]; @@ -4732,8 +4733,7 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event) /* special exception here for too high pressure values on first touch in windows for some tablets, then we just skip first touch .. */ - if ((pop->s.brush->flag & (BRUSH_ALPHA_PRESSURE|BRUSH_SIZE_PRESSURE| - BRUSH_SPACING_PRESSURE|BRUSH_RAD_PRESSURE)) && tablet && (pressure >= 0.99f)) + if ((pop->s.brush->flag & (BRUSH_ALPHA_PRESSURE|BRUSH_SIZE_PRESSURE|BRUSH_SPACING_PRESSURE)) && tablet && (pressure >= 0.99f)) return; } @@ -4748,6 +4748,8 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event) /* apply */ paint_apply(C, op, &itemptr); + + pop->prev_pressure= pressure; } static int paint_invoke(bContext *C, wmOperator *op, wmEvent *event) |