diff options
author | Antonioya <blendergit@gmail.com> | 2018-09-20 14:10:56 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-09-20 14:10:56 +0300 |
commit | 5bfcd6f303b458567870ab64fabf89713d679a78 (patch) | |
tree | ff7fabd74b3a4b771e25125cb6a86c51bc413b99 /source/blender | |
parent | b9b371625d4e5697b4e4226e222a45a7f4e7dea5 (diff) |
GP: Fix falloff curve using 2D animation template
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 1 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_defaults.c | 14 |
2 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 0a38c50640f..79d7deb7e55 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -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, diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c index 76fb42dc0b6..e6a5d20f017 100644 --- a/source/blender/blenloader/intern/versioning_defaults.c +++ b/source/blender/blenloader/intern/versioning_defaults.c @@ -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. */ |