diff options
author | Hans Goudey <h.goudey@me.com> | 2022-04-08 02:10:05 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-04-08 02:10:29 +0300 |
commit | 87a3bf33564b035e4c2400098ea4932d5dfdba5d (patch) | |
tree | 3059c7af8196bdc366ae71d399e6b62bae8c6d23 /source/blender/blenkernel/intern/curve_eval.cc | |
parent | 3214028ae822d6b9b1622589d27dd9b9746f2aa8 (diff) |
Cleanup: Define new curves normal mode in DNA
Don't include the tangent mode for now, since that
was never implemented for geometry nodes curves.
Diffstat (limited to 'source/blender/blenkernel/intern/curve_eval.cc')
-rw-r--r-- | source/blender/blenkernel/intern/curve_eval.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/curve_eval.cc b/source/blender/blenkernel/intern/curve_eval.cc index 122df12261c..9b1fd510fa8 100644 --- a/source/blender/blenkernel/intern/curve_eval.cc +++ b/source/blender/blenkernel/intern/curve_eval.cc @@ -189,18 +189,17 @@ static HandleType handle_type_from_dna_bezt(const eBezTriple_Handle dna_handle_t return BEZIER_HANDLE_AUTO; } -static Spline::NormalCalculationMode normal_mode_from_dna_curve(const int twist_mode) +static NormalMode normal_mode_from_dna_curve(const int twist_mode) { switch (twist_mode) { case CU_TWIST_Z_UP: - return Spline::NormalCalculationMode::ZUp; - case CU_TWIST_MINIMUM: - return Spline::NormalCalculationMode::Minimum; case CU_TWIST_TANGENT: - return Spline::NormalCalculationMode::Tangent; + return NORMAL_MODE_Z_UP; + case CU_TWIST_MINIMUM: + return NORMAL_MODE_MINIMUM_TWIST; } BLI_assert_unreachable(); - return Spline::NormalCalculationMode::Minimum; + return NORMAL_MODE_MINIMUM_TWIST; } static KnotsMode knots_mode_from_dna_nurb(const short flag) @@ -333,8 +332,7 @@ std::unique_ptr<CurveEval> curve_eval_from_dna_curve(const Curve &dna_curve, /* Normal mode is stored separately in each spline to facilitate combining * splines from multiple curve objects, where the value may be different. */ - const Spline::NormalCalculationMode normal_mode = normal_mode_from_dna_curve( - dna_curve.twist_mode); + const NormalMode normal_mode = normal_mode_from_dna_curve(dna_curve.twist_mode); for (SplinePtr &spline : curve->splines()) { spline->normal_mode = normal_mode; } |