Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonioya <blendergit@gmail.com>2018-12-15 19:21:47 +0300
committerAntonioya <blendergit@gmail.com>2018-12-15 19:21:47 +0300
commit351f537fa832c50971454af304a071c096427e71 (patch)
tree3746ee812d1104dd6cdc13549ea80ee7e16b00dc /source/blender/blenkernel/intern/scene.c
parentf9917a8d431f5480d9a5d58dfcf84863911f3bf2 (diff)
GP: New Curve primitive and other primitive improvements
This commit adds support for new curve tool and adds more functionalities to the existing primitives, including new handles, editing, stroke thickness curve, noise, preview of the real stroke, etc. Thanks to @charlie for his great contribution to this improvement.
Diffstat (limited to 'source/blender/blenkernel/intern/scene.c')
-rw-r--r--source/blender/blenkernel/intern/scene.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index a070bf97317..3894d83c169 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -188,6 +188,7 @@ ToolSettings *BKE_toolsettings_copy(ToolSettings *toolsettings, const int flag)
ts->gp_interpolate.custom_ipo = curvemapping_copy(ts->gp_interpolate.custom_ipo);
/* duplicate Grease Pencil multiframe fallof */
ts->gp_sculpt.cur_falloff = curvemapping_copy(ts->gp_sculpt.cur_falloff);
+ ts->gp_sculpt.cur_primitive = curvemapping_copy(ts->gp_sculpt.cur_primitive);
return ts;
}
@@ -226,6 +227,9 @@ void BKE_toolsettings_free(ToolSettings *toolsettings)
if (toolsettings->gp_sculpt.cur_falloff) {
curvemapping_free(toolsettings->gp_sculpt.cur_falloff);
}
+ if (toolsettings->gp_sculpt.cur_primitive) {
+ curvemapping_free(toolsettings->gp_sculpt.cur_primitive);
+ }
MEM_freeN(toolsettings);
}
@@ -699,6 +703,14 @@ void BKE_scene_init(Scene *sce)
CURVE_PRESET_GAUSS,
CURVEMAP_SLOPE_POSITIVE);
+ sce->toolsettings->gp_sculpt.cur_primitive = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+ CurveMapping *gp_primitive_curve = sce->toolsettings->gp_sculpt.cur_primitive;
+ curvemapping_initialize(gp_primitive_curve);
+ curvemap_reset(gp_primitive_curve->cm,
+ &gp_primitive_curve->clipr,
+ CURVE_PRESET_BELL,
+ CURVEMAP_SLOPE_POSITIVE);
+
sce->physics_settings.gravity[0] = 0.0f;
sce->physics_settings.gravity[1] = 0.0f;
sce->physics_settings.gravity[2] = -9.81f;