diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-07-14 17:59:35 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-07-14 18:06:53 +0400 |
commit | 45f0bd6eb1d15aed480fc843ed1c4acc9865abc4 (patch) | |
tree | c28344a369d83cef2977de319064a3f425bc8195 /source/blender/editors/sculpt_paint/paint_stroke.c | |
parent | 8554fa2fad63c20ff0c23894ad0b41087d149a32 (diff) |
Feature request:
Expose pressure from event system to python. This will return the tablet
pressure, if a tablet is present, or 1.0 if not.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_stroke.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_stroke.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index e87f8ca6827..b336ba77704 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -135,26 +135,6 @@ static void paint_draw_smooth_stroke(bContext *C, int x, int y, void *customdata } } -/* if this is a tablet event, return tablet pressure and set *pen_flip - * to 1 if the eraser tool is being used, 0 otherwise */ -static float event_tablet_data(const wmEvent *event, int *pen_flip) -{ - int erasor = 0; - float pressure = 1; - - if (event->tablet_data) { - wmTabletData *wmtab = event->tablet_data; - - erasor = (wmtab->Active == EVT_TABLET_ERASER); - pressure = (wmtab->Active != EVT_TABLET_NONE) ? wmtab->Pressure : 1; - } - - if (pen_flip) - (*pen_flip) = erasor; - - return pressure; -} - static bool paint_tool_require_location(Brush *brush, PaintMode mode) { switch (mode) { @@ -735,7 +715,7 @@ int paint_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event) float pressure; /* see if tablet affects event */ - pressure = event_tablet_data(event, &stroke->pen_flip); + pressure = WM_event_tablet_data(event, &stroke->pen_flip); paint_stroke_add_sample(p, stroke, event->mval[0], event->mval[1], pressure); paint_stroke_sample_average(stroke, &sample_average); |