From 60935cb9d8bd94098eabbf84140fe07ce810fc03 Mon Sep 17 00:00:00 2001 From: Antonioya Date: Sun, 30 Sep 2018 15:59:10 +0200 Subject: GP: Ensure falloff curve is always initializated --- source/blender/editors/gpencil/gpencil_utils.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source/blender/editors/gpencil/gpencil_utils.c') diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 9072a18eb88..eb4307b9f86 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -50,6 +50,7 @@ #include "DNA_view3d_types.h" #include "BKE_action.h" +#include "BKE_colortools.h" #include "BKE_deform.h" #include "BKE_main.h" #include "BKE_brush.h" @@ -1204,6 +1205,16 @@ void ED_gpencil_add_defaults(bContext *C) BKE_brush_gpencil_presets(C); } + /* ensure multiframe falloff curve */ + if (ts->gp_sculpt.cur_falloff == NULL) { + ts->gp_sculpt.cur_falloff = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); + CurveMapping *gp_falloff_curve = ts->gp_sculpt.cur_falloff; + curvemapping_initialize(gp_falloff_curve); + curvemap_reset(gp_falloff_curve->cm, + &gp_falloff_curve->clipr, + CURVE_PRESET_GAUSS, + CURVEMAP_SLOPE_POSITIVE); + } } /* ******************************************************** */ -- cgit v1.2.3