Commit: 45fe039c14e87595c49451fff7fbae5cfbc3bf95
Author: Antonioya
Date:   Fri Dec 7 13:17:32 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB45fe039c14e87595c49451fff7fbae5cfbc3bf95

GP: Change default primitive curve

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

M       source/blender/blenkernel/intern/colortools.c
M       source/blender/blenkernel/intern/scene.c
M       source/blender/blenloader/intern/versioning_280.c
M       source/blender/blenloader/intern/versioning_defaults.c
M       source/blender/makesdna/DNA_color_types.h

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

diff --git a/source/blender/blenkernel/intern/colortools.c 
b/source/blender/blenkernel/intern/colortools.c
index 60a7653cd1a..0e4e3dfddf0 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -283,6 +283,7 @@ void curvemap_reset(CurveMap *cuma, const rctf *clipr, int 
preset, int slope)
                case CURVE_PRESET_ROUND: cuma->totpoint = 4; break;
                case CURVE_PRESET_ROOT: cuma->totpoint = 4; break;
                case CURVE_PRESET_GAUSS: cuma->totpoint = 7; break;
+               case CURVE_PRESET_BELL: cuma->totpoint = 3; break;
        }
 
        cuma->curve = MEM_callocN(cuma->totpoint * sizeof(CurveMapPoint), 
"curve points");
@@ -371,6 +372,16 @@ void curvemap_reset(CurveMap *cuma, const rctf *clipr, int 
preset, int slope)
                        cuma->curve[6].x = 1.0f;
                        cuma->curve[6].y = 0.025f;
                        break;
+               case CURVE_PRESET_BELL:
+                       cuma->curve[0].x = 0;
+                       cuma->curve[0].y = 0.025f;
+
+                       cuma->curve[1].x = 0.50f;
+                       cuma->curve[1].y = 1.0f;
+
+                       cuma->curve[2].x = 1.0f;
+                       cuma->curve[2].y = 0.025f;
+                       break;
        }
 
        /* mirror curve in x direction to have positive slope
diff --git a/source/blender/blenkernel/intern/scene.c 
b/source/blender/blenkernel/intern/scene.c
index 4c00ebe2bb3..74a2b5bcc48 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -708,7 +708,7 @@ void BKE_scene_init(Scene *sce)
        curvemapping_initialize(gp_primitive_curve);
        curvemap_reset(gp_primitive_curve->cm,
                &gp_primitive_curve->clipr,
-               CURVE_PRESET_GAUSS,
+               CURVE_PRESET_BELL,
                CURVEMAP_SLOPE_POSITIVE);
 
        sce->physics_settings.gravity[0] = 0.0f;
diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index a9359a5ff3b..62bd917bdec 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -2500,7 +2500,7 @@ void blo_do_versions_280(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
                                        
curvemapping_initialize(gset->cur_primitive);
                                        curvemap_reset(gset->cur_primitive->cm,
                                                &gset->cur_primitive->clipr,
-                                               CURVE_PRESET_GAUSS,
+                                               CURVE_PRESET_BELL,
                                                CURVEMAP_SLOPE_POSITIVE);
                                }
                        }
diff --git a/source/blender/blenloader/intern/versioning_defaults.c 
b/source/blender/blenloader/intern/versioning_defaults.c
index ec956872599..aafc4623997 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -192,7 +192,7 @@ void BLO_update_defaults_startup_blend(Main *bmain, const 
char *app_template)
                                curvemapping_initialize(gp_primitive_curve);
                                curvemap_reset(gp_primitive_curve->cm,
                                        &gp_primitive_curve->clipr,
-                                       CURVE_PRESET_GAUSS,
+                                       CURVE_PRESET_BELL,
                                        CURVEMAP_SLOPE_POSITIVE);
                        }
                }
diff --git a/source/blender/makesdna/DNA_color_types.h 
b/source/blender/makesdna/DNA_color_types.h
index 01f0b06c178..bf205729a72 100644
--- a/source/blender/makesdna/DNA_color_types.h
+++ b/source/blender/makesdna/DNA_color_types.h
@@ -103,6 +103,7 @@ typedef enum eCurveMappingPreset {
        CURVE_PRESET_ROUND  = 5,
        CURVE_PRESET_ROOT   = 6,
        CURVE_PRESET_GAUSS  = 7,
+       CURVE_PRESET_BELL   = 8,
 } eCurveMappingPreset;
 
 /* CurveMapping->tone */

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to