diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-04-16 04:43:19 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-04-16 04:47:48 +0300 |
commit | 002752f021a67ff8c4e3f5c488678525b766872a (patch) | |
tree | 26461d03a7b7d04f292b88438c91830bd102b445 /source/blender/blenkernel/intern/curve.c | |
parent | 1685f5824d91a6a8651f92a03229cd6ec58742ea (diff) |
Object: only apply smooth/flat to the active object in paint modes
Also some minor improvements:
- Only run once per object data instance.
- Correction for mesh smooth flag being used on curves.
- Move curve operation into utility function.
Diffstat (limited to 'source/blender/blenkernel/intern/curve.c')
-rw-r--r-- | source/blender/blenkernel/intern/curve.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index b4a8625c0bb..76dec63903b 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -5506,6 +5506,20 @@ void BKE_curve_material_remap(Curve *cu, const unsigned int *remap, unsigned int #undef MAT_NR_REMAP } +void BKE_curve_smooth_flag_set(Curve *cu, const bool use_smooth) +{ + if (use_smooth) { + for (Nurb *nu = cu->nurb.first; nu; nu = nu->next) { + nu->flag |= CU_SMOOTH; + } + } + else { + for (Nurb *nu = cu->nurb.first; nu; nu = nu->next) { + nu->flag &= ~CU_SMOOTH; + } + } +} + void BKE_curve_rect_from_textbox(const struct Curve *cu, const struct TextBox *tb, struct rctf *r_rect) |