[Bf-blender-cvs] [62828dee3c8] soc-2020-greasepencil-curve: GPencil: todo error threshold should be parameter

Falk David noreply at git.blender.org
Tue Jun 9 19:59:21 CEST 2020


Commit: 62828dee3c8b6efdebb8680145d73c7f9a400a1c
Author: Falk David
Date:   Tue Jun 9 19:56:56 2020 +0200
Branches: soc-2020-greasepencil-curve
https://developer.blender.org/rB62828dee3c8b6efdebb8680145d73c7f9a400a1c

GPencil: todo error threshold should be parameter

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

M	source/blender/blenkernel/intern/gpencil_curve.c

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

diff --git a/source/blender/blenkernel/intern/gpencil_curve.c b/source/blender/blenkernel/intern/gpencil_curve.c
index 1c3ae16a2e5..b8d0e3377fd 100644
--- a/source/blender/blenkernel/intern/gpencil_curve.c
+++ b/source/blender/blenkernel/intern/gpencil_curve.c
@@ -461,6 +461,9 @@ bGPDcurve *BKE_gpencil_stroke_editcurve_generate(bGPDstroke *gps)
     return NULL;
   }
 
+  /* TODO: GPXX this should be a parameter */
+  float error_threshold = 0.1f;
+
   float *points = MEM_callocN(sizeof(float) * gps->totpoints * POINT_DIM, __func__);
   for (int i = 0; i < gps->totpoints; i++) {
     bGPDspoint *pt = &gps->points[i];
@@ -476,7 +479,7 @@ bGPDcurve *BKE_gpencil_stroke_editcurve_generate(bGPDstroke *gps)
   int r = curve_fit_cubic_to_points_fl(points,
                                        gps->totpoints,
                                        POINT_DIM,
-                                       0.1f,
+                                       error_threshold,
                                        CURVE_FIT_CALC_HIGH_QUALIY,
                                        NULL,
                                        0,



More information about the Bf-blender-cvs mailing list