[Bf-blender-cvs] [4cdd9bc4978] soc-2020-greasepencil-curve: GPencil: update the stroke after they are fitted to a curve
Falk David
noreply at git.blender.org
Sun Jun 14 12:16:28 CEST 2020
Commit: 4cdd9bc4978f384c605f228612639dd6db1b985c
Author: Falk David
Date: Sun Jun 14 12:16:06 2020 +0200
Branches: soc-2020-greasepencil-curve
https://developer.blender.org/rB4cdd9bc4978f384c605f228612639dd6db1b985c
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