[Bf-blender-cvs] [01c52179e52] greasepencil-edit-curve: GPencil: update the stroke after they are fitted to a curve

Falk David noreply at git.blender.org
Sun Jun 14 12:39:19 CEST 2020


Commit: 01c52179e523845b42cc2cbe00c53e8945dd082d
Author: Falk David
Date:   Sun Jun 14 12:16:06 2020 +0200
Branches: greasepencil-edit-curve
https://developer.blender.org/rB01c52179e523845b42cc2cbe00c53e8945dd082d

GPencil: update the stroke after they are fitted to a curve

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

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 17800708282..366cc91cabc 100644
--- a/source/blender/blenkernel/intern/gpencil_curve.c
+++ b/source/blender/blenkernel/intern/gpencil_curve.c
@@ -571,6 +571,7 @@ void BKE_gpencil_selected_strokes_editcurve_update(bGPdata *gpd)
           BKE_gpencil_stroke_editcurve_update(gps);
           if (gps->editcurve != NULL) {
             gps->editcurve->resolution = gpd->editcurve_resolution;
+            BKE_gpencil_stroke_update_geometry_from_editcurve(gps);
           }
         }
       }
@@ -630,6 +631,7 @@ void BKE_gpencil_stroke_update_geometry_from_editcurve(bGPDstroke *gps)
     bGPDcurve_point *cpt_curr = &curve_point_array[i];
     bGPDcurve_point *cpt_next = &curve_point_array[i + 1];
 
+    /* sample points on all 3 axis between two curve points */
     for (uint axis = 0; axis < 3; axis++) {
       BKE_curve_forward_diff_bezier(cpt_curr->bezt.vec[1][axis],
                                     cpt_curr->bezt.vec[2][axis],
@@ -640,6 +642,7 @@ void BKE_gpencil_stroke_update_geometry_from_editcurve(bGPDstroke *gps)
                                     stride);
     }
 
+    /* interpolate other attributes */
     gp_interpolate_fl_from_to(cpt_curr->pressure,
                               cpt_next->pressure,
                               POINTER_OFFSET(points_offset, sizeof(float) * 3),



More information about the Bf-blender-cvs mailing list