[Bf-blender-cvs] [389fa55b657] temp-gpencil-bezier-stroke-type: GPencil: Return true if handles were recalcualted
Falk David
noreply at git.blender.org
Mon Apr 26 08:41:35 CEST 2021
Commit: 389fa55b657246a196202ce32a1c88aefe094e63
Author: Falk David
Date: Sun Apr 25 10:12:02 2021 +0200
Branches: temp-gpencil-bezier-stroke-type
https://developer.blender.org/rB389fa55b657246a196202ce32a1c88aefe094e63
GPencil: Return true if handles were recalcualted
===================================================================
M source/blender/blenkernel/BKE_gpencil_curve.h
M source/blender/blenkernel/intern/gpencil_curve.c
===================================================================
diff --git a/source/blender/blenkernel/BKE_gpencil_curve.h b/source/blender/blenkernel/BKE_gpencil_curve.h
index 5e474849900..9afe660031c 100644
--- a/source/blender/blenkernel/BKE_gpencil_curve.h
+++ b/source/blender/blenkernel/BKE_gpencil_curve.h
@@ -70,7 +70,7 @@ void BKE_gpencil_stroke_update_geometry_from_editcurve(struct bGPDstroke *gps,
const uint resolution,
const bool is_adaptive,
const enum eGPStrokeGeoUpdateFlag flag);
-void BKE_gpencil_editcurve_recalculate_handles(struct bGPDstroke *gps);
+bool BKE_gpencil_editcurve_recalculate_handles(struct bGPDstroke *gps);
void BKE_gpencil_editcurve_subdivide(struct bGPDstroke *gps, const int cuts);
void BKE_gpencil_editcurve_simplify_adaptive(struct bGPDstroke *gps, const float threshold);
void BKE_gpencil_editcurve_simplify_fixed(struct bGPDstroke *gps, const int count);
diff --git a/source/blender/blenkernel/intern/gpencil_curve.c b/source/blender/blenkernel/intern/gpencil_curve.c
index 6cd2d4181d9..968dd3f3368 100644
--- a/source/blender/blenkernel/intern/gpencil_curve.c
+++ b/source/blender/blenkernel/intern/gpencil_curve.c
@@ -1730,16 +1730,16 @@ void BKE_gpencil_stroke_update_geometry_from_editcurve(bGPDstroke *gps,
/**
* Recalculate the handles of the edit curve of a grease pencil stroke
*/
-void BKE_gpencil_editcurve_recalculate_handles(bGPDstroke *gps)
+bool BKE_gpencil_editcurve_recalculate_handles(bGPDstroke *gps)
{
if (gps == NULL || gps->editcurve == NULL) {
- return;
+ return false;
}
bool changed = false;
bGPDcurve *gpc = gps->editcurve;
if (gpc->tot_curve_points < 2) {
- return;
+ return false;
}
if (gpc->tot_curve_points == 1) {
@@ -1785,6 +1785,8 @@ void BKE_gpencil_editcurve_recalculate_handles(bGPDstroke *gps)
changed = true;
}
+
+ return changed;
}
/* Helper: count how many new curve points must be generated. */
More information about the Bf-blender-cvs
mailing list