GP: Fix falloff curve using 2D animation template

This commit is contained in:
Antonio Vazquez 2018-09-20 13:10:56 +02:00
parent b9b371625d
commit 5bfcd6f303
2 changed files with 14 additions and 1 deletions

View File

@ -690,7 +690,6 @@ void BKE_scene_init(Scene *sce)
/* grease pencil multiframe falloff curve */
sce->toolsettings->gp_sculpt.cur_falloff = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
CurveMapping *gp_falloff_curve = sce->toolsettings->gp_sculpt.cur_falloff;
curvemapping_set_defaults(gp_falloff_curve, 1, 0.0f, 0.0f, 1.0f, 1.0f);
curvemapping_initialize(gp_falloff_curve);
curvemap_reset(gp_falloff_curve->cm,
&gp_falloff_curve->clipr,

View File

@ -39,6 +39,7 @@
#include "DNA_object_types.h"
#include "DNA_workspace_types.h"
#include "BKE_colortools.h"
#include "BKE_layer.h"
#include "BKE_main.h"
#include "BKE_node.h"
@ -101,6 +102,19 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
workspace->object_mode = OB_MODE_GPENCIL_PAINT;
}
}
/* Be sure curfalloff is initializated */
for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
ToolSettings *ts = scene->toolsettings;
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);
}
}
}
/* For all builtin templates shipped with Blender. */