[Bf-blender-cvs] [ae05936] PSketch: PSculpt: Eraser end of pen maps to inverse operation too
Joshua Leung
noreply at git.blender.org
Sun Jan 31 14:29:01 CET 2016
Commit: ae0593673fecc2f50daa9531bdf7cfcc11cabc27
Author: Joshua Leung
Date: Fri Jan 15 01:01:10 2016 +1300
Branches: PSketch
https://developer.blender.org/rBae0593673fecc2f50daa9531bdf7cfcc11cabc27
PSculpt: Eraser end of pen maps to inverse operation too
Just like shift, the eraser end now acts to flip which brush is getting applied.
Meanwhile, shift now acts to flip whatever the user chose + what the pen is doing.
===================================================================
M source/blender/editors/armature/pose_sculpt.c
===================================================================
diff --git a/source/blender/editors/armature/pose_sculpt.c b/source/blender/editors/armature/pose_sculpt.c
index 5e536a2..fc80dcb 100644
--- a/source/blender/editors/armature/pose_sculpt.c
+++ b/source/blender/editors/armature/pose_sculpt.c
@@ -1321,13 +1321,12 @@ static void psculpt_brush_apply_event(bContext *C, wmOperator *op, const wmEvent
PointerRNA itemptr;
float mouse[2];
- VECCOPY2D(mouse, event->mval);
-
- /* fill in stroke */
+ /* add a new entry in the stroke-elements collection */
RNA_collection_add(op->ptr, "stroke", &itemptr);
+ /* fill in current mouse coordinates */
+ VECCOPY2D(mouse, event->mval);
RNA_float_set_array(&itemptr, "mouse", mouse);
- RNA_boolean_set(&itemptr, "pen_flip", event->shift != false); // XXX hardcoded
/* handle pressure sensitivity (which is supplied by tablets) */
if (event->tablet_data) {
@@ -1342,9 +1341,16 @@ static void psculpt_brush_apply_event(bContext *C, wmOperator *op, const wmEvent
pressure = 1.0f;
}
RNA_float_set(&itemptr, "pressure", pressure);
+
+ /* "pen_flip" is meant to be attached to the eraser */
+ if (wmtab->Active == EVT_TABLET_ERASER)
+ RNA_boolean_set(&itemptr, "pen_flip", event->shift == false);
+ else
+ RNA_boolean_set(&itemptr, "pen_flip", event->shift != false);
}
else {
RNA_float_set(&itemptr, "pressure", 1.0f);
+ RNA_boolean_set(&itemptr, "pen_flip", event->shift != false);
}
/* apply */
More information about the Bf-blender-cvs
mailing list