Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-07-23 00:20:04 +0300
committerHans Goudey <h.goudey@me.com>2021-07-23 00:20:04 +0300
commitf76dfe8fb45c9c270c295ff76f6fd058e2b64d0d (patch)
tree8145dc1b7909082ffa4cde3bd4f7a2f86a3dfdc6 /source/blender/blenkernel/intern/geometry_component_curve.cc
parent524d172742ec22ca04f2b0c83932e2cda669837c (diff)
Cleanup: Add function to check a curve's spline types
The need for this has come up a few times.
Diffstat (limited to 'source/blender/blenkernel/intern/geometry_component_curve.cc')
-rw-r--r--source/blender/blenkernel/intern/geometry_component_curve.cc10
1 files changed, 1 insertions, 9 deletions
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 BuiltinPointAttributeProvider<flo
return {};
}
- bool curve_has_bezier_spline = false;
- for (SplinePtr &spline : curve->splines()) {
- 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<float3>::try_get_for_write(component);
}