[Bf-blender-cvs] [cecdd13] master: GP Sculpt: WheelUp/Down can be used to control brush size/strength while a sculpt stroke is in progress

Joshua Leung noreply at git.blender.org
Sun Dec 13 13:19:34 CET 2015


Commit: cecdd13a2b78c848e7bb4a5342a3536eb4ab9c40
Author: Joshua Leung
Date:   Mon Dec 14 01:12:42 2015 +1300
Branches: master
https://developer.blender.org/rBcecdd13a2b78c848e7bb4a5342a3536eb4ab9c40

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

===================================================================

M	source/blender/editors/gpencil/gpencil_brush.c

===================================================================

diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c
index 91518a5..52340c5 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -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:




More information about the Bf-blender-cvs mailing list