From f76dfe8fb45c9c270c295ff76f6fd058e2b64d0d Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Thu, 22 Jul 2021 17:20:04 -0400 Subject: Cleanup: Add function to check a curve's spline types The need for this has come up a few times. --- source/blender/blenkernel/intern/geometry_component_curve.cc | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'source/blender/blenkernel/intern/geometry_component_curve.cc') diff --git a/source/blender/blenkernel/intern/geometry_component_curve.cc b/source/blender/blenkernel/intern/geometry_component_curve.cc index b5c49dbb8b2..0b6ba966974 100644 --- a/source/blender/blenkernel/intern/geometry_component_curve.cc +++ b/source/blender/blenkernel/intern/geometry_component_curve.cc @@ -854,17 +854,9 @@ class PositionAttributeProvider final : public BuiltinPointAttributeProvidersplines()) { - if (spline->type() == Spline::Type::Bezier) { - curve_has_bezier_spline = true; - break; - } - } - /* Use the regular position virtual array when there aren't any Bezier splines * to avoid the overhead of checking the spline type for every point. */ - if (!curve_has_bezier_spline) { + if (!curve->has_spline_with_type(Spline::Type::Bezier)) { return BuiltinPointAttributeProvider::try_get_for_write(component); } -- cgit v1.2.3