From 790cb28766813c94733637e46a6527eaf9a04a6b Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Mon, 28 Jun 2021 14:15:58 -0500 Subject: Curve: Add functions to retrieve const access to spline list While the const correctness of `ListBase` is quite limited, it's helpful to have a way to retrieve the `Nurb` list from curve object data without casting away const from the curve. --- source/blender/blenkernel/BKE_curve.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/blenkernel/BKE_curve.h') diff --git a/source/blender/blenkernel/BKE_curve.h b/source/blender/blenkernel/BKE_curve.h index 76a0468df03..c7c5f59cab2 100644 --- a/source/blender/blenkernel/BKE_curve.h +++ b/source/blender/blenkernel/BKE_curve.h @@ -121,6 +121,7 @@ void BKE_curve_material_remap(struct Curve *cu, const unsigned int *remap, unsig void BKE_curve_smooth_flag_set(struct Curve *cu, const bool use_smooth); ListBase *BKE_curve_nurbs_get(struct Curve *cu); +const ListBase *BKE_curve_nurbs_get_for_read(const struct Curve *cu); int BKE_curve_nurb_vert_index_get(const struct Nurb *nu, const void *vert); void BKE_curve_nurb_active_set(struct Curve *cu, const struct Nurb *nu); @@ -153,6 +154,7 @@ void BKE_curve_editNurb_keyIndex_delCV(struct GHash *keyindex, const void *cv); void BKE_curve_editNurb_keyIndex_free(struct GHash **keyindex); void BKE_curve_editNurb_free(struct Curve *cu); struct ListBase *BKE_curve_editNurbs_get(struct Curve *cu); +const struct ListBase *BKE_curve_editNurbs_get_for_read(const struct Curve *cu); void BKE_curve_bevelList_free(struct ListBase *bev); void BKE_curve_bevelList_make(struct Object *ob, const struct ListBase *nurbs, bool for_render); -- cgit v1.2.3