Commit: 4cbd5933f782312f05753847804d3efd1ff6de00
Author: Antonio Vazquez
Date:   Thu Nov 30 18:55:05 2017 +0100
Branches: greasepencil-object
https://developer.blender.org/rB4cbd5933f782312f05753847804d3efd1ff6de00

WIP: New Gauss bell curve preset

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

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/makesdna/DNA_color_types.h

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

diff --git a/source/blender/blenkernel/intern/colortools.c 
b/source/blender/blenkernel/intern/colortools.c
index 310255a15c1..6caa3aa0d11 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -282,6 +282,7 @@ void curvemap_reset(CurveMap *cuma, const rctf *clipr, int 
preset, int slope)
                case CURVE_PRESET_MID9: cuma->totpoint = 9; break;
                case CURVE_PRESET_ROUND: cuma->totpoint = 4; break;
                case CURVE_PRESET_ROOT: cuma->totpoint = 4; break;
+               case CURVE_PRESET_GAUSS: cuma->totpoint = 7; break;
        }
 
        cuma->curve = MEM_callocN(cuma->totpoint * sizeof(CurveMapPoint), 
"curve points");
@@ -352,6 +353,24 @@ void curvemap_reset(CurveMap *cuma, const rctf *clipr, int 
preset, int slope)
                        cuma->curve[3].x = 1;
                        cuma->curve[3].y = 0;
                        break;
+               case CURVE_PRESET_GAUSS:
+                       cuma->curve[0].x = 0;
+                       cuma->curve[0].y = 0.025f;
+                       cuma->curve[1].x = 0.16f;
+                       cuma->curve[1].y = 0.135f;
+                       cuma->curve[2].x = 0.28f;
+                       cuma->curve[2].y = 0.38f;
+                       
+                       cuma->curve[3].x = 0.50f;
+                       cuma->curve[3].y = 1.0f;
+
+                       cuma->curve[4].x = 0.72f;
+                       cuma->curve[4].y = 0.38f;
+                       cuma->curve[5].x = 0.84f;
+                       cuma->curve[5].y = 0.135f;
+                       cuma->curve[6].x = 1.0f;
+                       cuma->curve[6].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 7c7fa2b9cfa..b51db98ce16 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -871,7 +871,7 @@ void BKE_scene_init(Scene *sce)
        curvemapping_initialize(gp_falloff_curve);
        curvemap_reset(gp_falloff_curve->cm,
                &gp_falloff_curve->clipr,
-               CURVE_PRESET_ROUND,
+               CURVE_PRESET_GAUSS,
                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 f1b1dc95f77..0938cd8592a 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -898,7 +898,7 @@ void blo_do_versions_280(FileData *fd, Library 
*UNUSED(lib), Main *main)
                                        
curvemapping_initialize(gset->cur_falloff);
                                        curvemap_reset(gset->cur_falloff->cm,
                                                &gset->cur_falloff->clipr,
-                                               CURVE_PRESET_MID9,
+                                               CURVE_PRESET_GAUSS,
                                                CURVEMAP_SLOPE_POSITIVE);
                                }
                        }
diff --git a/source/blender/makesdna/DNA_color_types.h 
b/source/blender/makesdna/DNA_color_types.h
index 6f9c407c6c6..b8cccbf527b 100644
--- a/source/blender/makesdna/DNA_color_types.h
+++ b/source/blender/makesdna/DNA_color_types.h
@@ -99,6 +99,7 @@ typedef enum eCurveMappingPreset {
        CURVE_PRESET_MID9   = 4,
        CURVE_PRESET_ROUND  = 5,
        CURVE_PRESET_ROOT   = 6,
+       CURVE_PRESET_GAUSS  = 7,
 } eCurveMappingPreset;
 
 /* histogram->mode */

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to