[Bf-blender-cvs] [39e83ff843c] greasepencil-object: Merge branch 'master' into greasepencil-object
Antonio Vazquez
noreply at git.blender.org
Tue Jan 21 19:00:55 CET 2020
Commit: 39e83ff843c8f64a50555becdc3ced3c23da18fc
Author: Antonio Vazquez
Date: Tue Jan 21 19:00:49 2020 +0100
Branches: greasepencil-object
https://developer.blender.org/rB39e83ff843c8f64a50555becdc3ced3c23da18fc
Merge branch 'master' into greasepencil-object
===================================================================
===================================================================
diff --cc source/blender/editors/gpencil/gpencil_sculpt_paint.c
index 7421afe4bba,690fee61005..7524ed557ea
--- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c
+++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
@@@ -1921,9 -1972,10 +1921,8 @@@ static Brush *gpsculpt_get_smooth_brush
static void gpsculpt_brush_apply_event(bContext *C, wmOperator *op, const wmEvent *event)
{
tGP_BrushEditData *gso = op->customdata;
- ToolSettings *ts = CTX_data_tool_settings(C);
- GP_Sculpt_Settings *gset = &ts->gp_sculpt;
PointerRNA itemptr;
float mouse[2];
- int tablet = 0;
mouse[0] = event->mval[0] + 1;
mouse[1] = event->mval[1] + 1;
@@@ -1935,36 -1987,28 +1934,26 @@@
RNA_boolean_set(&itemptr, "pen_flip", event->ctrl != false);
RNA_boolean_set(&itemptr, "is_start", gso->first);
- /* handle pressure sensitivity (which is supplied by tablets) */
- if (event->tablet_data) {
- const wmTabletData *wmtab = event->tablet_data;
- float pressure = wmtab->Pressure;
-
- tablet = (wmtab->Active != EVT_TABLET_NONE);
-
- /* special exception here for too high pressure values on first touch in
- * windows for some tablets: clamp the values to be sane
- */
- if (tablet && (pressure >= 0.99f)) {
- pressure = 1.0f;
- }
- RNA_float_set(&itemptr, "pressure", pressure);
- }
- else {
- RNA_float_set(&itemptr, "pressure", 1.0f);
+ /* handle pressure sensitivity (which is supplied by tablets and otherwise 1.0) */
+ float pressure = event->tablet.pressure;
+ /* special exception here for too high pressure values on first touch in
+ * windows for some tablets: clamp the values to be sane */
+ if (pressure >= 0.99f) {
+ pressure = 1.0f;
}
+ RNA_float_set(&itemptr, "pressure", pressure);
- if (!gso->is_weight_mode) {
- if (event->shift) {
- gso->gp_brush_old = gso->gp_brush;
- gso->brush_type_old = gso->brush_type;
+ if (event->shift) {
+ gso->brush_old = gso->brush;
- gso->gp_brush = &gset->brush[GP_SCULPT_TYPE_SMOOTH];
- gso->brush_type = GP_SCULPT_TYPE_SMOOTH;
+ gso->brush = gpsculpt_get_smooth_brush(gso);
+ if (gso->brush == NULL) {
+ gso->brush = gso->brush_old;
}
- else {
- if (gso->gp_brush_old != NULL) {
- gso->gp_brush = gso->gp_brush_old;
- gso->brush_type = gso->brush_type_old;
- }
+ }
+ else {
+ if (gso->brush_old != NULL) {
+ gso->brush = gso->brush_old;
}
}
More information about the Bf-blender-cvs
mailing list