GP: Ensure falloff curve is always initializated

This commit is contained in:
Antonio Vazquez 2018-09-30 15:59:10 +02:00
parent 8c3077ff94
commit 60935cb9d8
1 changed files with 11 additions and 0 deletions

View File

@ -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);
}
}
/* ******************************************************** */