Commit: ca9698b8e0d4f5748a4730bfff154a05eb8cc44c Author: Pablo Dobarro Date: Wed Aug 7 01:36:17 2019 +0200 Branches: master https://developer.blender.org/rBca9698b8e0d4f5748a4730bfff154a05eb8cc44c
Sculpt/Paint: Ignore INBETWEEN_MOUSEMOVE events on certain brush tools Some brush tools were being executed too often when using devices with high polling rates, causing performance issues. This should improve the performance of brushes that don't need those updates. Reviewed By: brecht Differential Revision: https://developer.blender.org/D5429 =================================================================== M source/blender/editors/sculpt_paint/paint_stroke.c =================================================================== diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 6144f5751f2..694dae49d30 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -233,6 +233,23 @@ static bool paint_tool_require_location(Brush *brush, ePaintMode mode) return true; } +static bool paint_tool_require_inbetween_mouse_events(Brush *brush, ePaintMode mode) +{ + switch (mode) { + case PAINT_MODE_SCULPT: + if (ELEM(brush->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_ROTATE, SCULPT_TOOL_THUMB)) { + return false; + } + else { + return true; + } + default: + break; + } + + return true; +} + /* Initialize the stroke cache variants from operator properties */ static bool paint_brush_update(bContext *C, Brush *brush, @@ -1188,6 +1205,10 @@ int paint_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event) bool redraw = false; float pressure; + if (event->type == INBETWEEN_MOUSEMOVE && !paint_tool_require_inbetween_mouse_events(br, mode)) { + return OPERATOR_RUNNING_MODAL; + } + /* see if tablet affects event. Line, anchored and drag dot strokes do not support pressure */ pressure = ((br->flag & (BRUSH_LINE | BRUSH_ANCHORED | BRUSH_DRAG_DOT)) ? 1.0f : _______________________________________________ Bf-blender-cvs mailing list [email protected] https://lists.blender.org/mailman/listinfo/bf-blender-cvs
