[Bf-blender-cvs] [5bfcd6f303b] blender2.8: GP: Fix falloff curve using 2D animation template

Antonioya noreply at git.blender.org
Thu Sep 20 13:20:59 CEST 2018


Commit: 5bfcd6f303b458567870ab64fabf89713d679a78
Author: Antonioya
Date:   Thu Sep 20 13:10:56 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB5bfcd6f303b458567870ab64fabf89713d679a78

GP: Fix falloff curve using 2D animation template

===================================================================

M	source/blender/blenkernel/intern/scene.c
M	source/blender/blenloader/intern/versioning_defaults.c

===================================================================

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. */



More information about the Bf-blender-cvs mailing list