diff options
author | Antonioya <blendergit@gmail.com> | 2018-09-30 14:54:23 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-09-30 14:54:23 +0300 |
commit | 8c3077ff94ecd25f55c46ac9dd792c27bda4e75b (patch) | |
tree | 8349efd8183e7065bcf9abd1615b07e790e4207a /source/blender/editors/gpencil/gpencil_brush.c | |
parent | 419fd80d46ab7be516cd505d062406dca87d3b65 (diff) |
Fix T56970 GP: Sculpt mode : Grap tool doesn't work
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_brush.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_brush.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c index 216e65b9d9f..1e64a41e914 100644 --- a/source/blender/editors/gpencil/gpencil_brush.c +++ b/source/blender/editors/gpencil/gpencil_brush.c @@ -1229,6 +1229,13 @@ static bool gpsculpt_brush_init(bContext *C, wmOperator *op) gso->gpd = ED_gpencil_data_get_active(C); gso->cfra = INT_MAX; /* NOTE: So that first stroke will get handled in init_stroke() */ + /* some brushes cannot use pressure for radius */ + if ((gso->brush_type == GP_EDITBRUSH_TYPE_GRAB) || + (gso->brush_type == GP_EDITBRUSH_TYPE_CLONE)) + { + gso->brush->flag &= ~GP_EDITBRUSH_FLAG_PRESSURE_RADIUS; + } + gso->scene = scene; gso->object = ob; if (ob) { @@ -1416,7 +1423,7 @@ static bool gpsculpt_brush_do_stroke( GP_SpaceConversion *gsc = &gso->gsc; rcti *rect = &gso->brush_rect; GP_EditBrush_Data *brush = gso->brush; - const int radius = (brush->flag & GP_EDITBRUSH_FLAG_USE_PRESSURE) ? gso->brush->size * gso->pressure : gso->brush->size; + const int radius = (brush->flag & GP_EDITBRUSH_FLAG_PRESSURE_RADIUS) ? gso->brush->size * gso->pressure : gso->brush->size; bGPDspoint *pt1, *pt2; int pc1[2] = {0}; @@ -1709,7 +1716,7 @@ static void gpsculpt_brush_apply(bContext *C, wmOperator *op, PointerRNA *itempt { tGP_BrushEditData *gso = op->customdata; GP_EditBrush_Data *brush = gso->brush; - const int radius = (brush->flag & GP_EDITBRUSH_FLAG_USE_PRESSURE) ? gso->brush->size * gso->pressure : gso->brush->size; + const int radius = (brush->flag & GP_EDITBRUSH_FLAG_PRESSURE_RADIUS) ? gso->brush->size * gso->pressure : gso->brush->size; float mousef[2]; int mouse[2]; bool changed = false; |