diff options
-rw-r--r-- | source/blender/blenkernel/BKE_curve.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/curve.c | 20 |
2 files changed, 21 insertions, 1 deletions
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); diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 341a2b555d8..aaf61e41894 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -442,6 +442,15 @@ ListBase *BKE_curve_editNurbs_get(Curve *cu) return NULL; } +const ListBase *BKE_curve_editNurbs_get_for_read(const Curve *cu) +{ + if (cu->editnurb) { + return &cu->editnurb->nurbs; + } + + return NULL; +} + short BKE_curve_type_get(const Curve *cu) { int type = cu->type; @@ -2691,7 +2700,7 @@ void BKE_curve_bevelList_make(Object *ob, const ListBase *nurbs, const bool for_ is_editmode = 1; } - LISTBASE_FOREACH (Nurb *, nu, nurbs) { + LISTBASE_FOREACH (const Nurb *, nu, nurbs) { if (nu->hide && is_editmode) { continue; } @@ -5078,6 +5087,15 @@ ListBase *BKE_curve_nurbs_get(Curve *cu) return &cu->nurb; } +const ListBase *BKE_curve_nurbs_get_for_read(const Curve *cu) +{ + if (cu->editnurb) { + return BKE_curve_editNurbs_get_for_read(cu); + } + + return &cu->nurb; +} + void BKE_curve_nurb_active_set(Curve *cu, const Nurb *nu) { if (nu == NULL) { |