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>2022-03-25 17:00:30 +0300
committerHans Goudey <h.goudey@me.com>2022-03-25 17:00:30 +0300
commitc0016d85b2a62858229d31bd97399fbe2608f99d (patch)
tree9ccabf7543a5c7043d85a55f37c42c403e6b6013 /source/blender/blenkernel/BKE_curves.hh
parent59de9ceda05c84670d27fcb526d513e30a8e29b4 (diff)
Curves: Add a utility to count curves of each type
This commit adds a utility that returns an array with the number of curves of every type. One use case for this is detecting whether to remove handle or NURBS attributes when changing curve types. It's best to avoid using this when it's not necessary, but sometimes it can't really be avoided, and having a utility at least makes using an optimized version simple. In the future, this information can be cached in the curves runtime. Differential Revision: https://developer.blender.org/D14448
Diffstat (limited to 'source/blender/blenkernel/BKE_curves.hh')
-rw-r--r--source/blender/blenkernel/BKE_curves.hh2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_curves.hh b/source/blender/blenkernel/BKE_curves.hh
index 0f2ae8a02a6..96963dcbd8d 100644
--- a/source/blender/blenkernel/BKE_curves.hh
+++ b/source/blender/blenkernel/BKE_curves.hh
@@ -146,6 +146,8 @@ class CurvesGeometry : public ::CurvesGeometry {
MutableSpan<int8_t> curve_types();
bool has_curve_with_type(const CurveType type) const;
+ /** Return the number of curves with each type. */
+ std::array<int, CURVE_TYPES_NUM> count_curve_types() const;
MutableSpan<float3> positions();
Span<float3> positions() const;