GP Sculpt: WheelUp/Down can be used to control brush size/strength while a sculpt stroke is in progress

This commit is contained in:
Joshua Leung 2015-12-14 01:12:42 +13:00
parent 94265057b5
commit cecdd13a2b
1 changed files with 34 additions and 0 deletions

View File

@ -1546,6 +1546,40 @@ static int gpsculpt_brush_modal(bContext *C, wmOperator *op, const wmEvent *even
gso->timerTick = false;
}
break;
/* Adjust brush settings */
/* FIXME: Step increments and modifier keys are hardcoded here! */
case WHEELUPMOUSE:
case PADPLUSKEY:
if (event->shift) {
/* increase strength */
gso->brush->strength += 0.05f;
CLAMP_MAX(gso->brush->strength, 1.0f);
}
else {
/* increase brush size */
gso->brush->size += 3;
CLAMP_MAX(gso->brush->size, 300);
}
redraw_region = true;
break;
case WHEELDOWNMOUSE:
case PADMINUS:
if (event->shift) {
/* decrease strength */
gso->brush->strength -= 0.05f;
CLAMP_MIN(gso->brush->strength, 0.0f);
}
else {
/* decrease brush size */
gso->brush->size -= 3;
CLAMP_MIN(gso->brush->size, 1);
}
redraw_region = true;
break;
/* Painting mbut release = Stop painting (back to idle) */
case LEFTMOUSE: