From c0016d85b2a62858229d31bd97399fbe2608f99d Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Fri, 25 Mar 2022 09:00:30 -0500 Subject: 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 --- source/blender/makesdna/DNA_curves_types.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_curves_types.h b/source/blender/makesdna/DNA_curves_types.h index f1626781fc6..97cc588e639 100644 --- a/source/blender/makesdna/DNA_curves_types.h +++ b/source/blender/makesdna/DNA_curves_types.h @@ -28,6 +28,7 @@ typedef enum CurveType { CURVE_TYPE_BEZIER = 2, CURVE_TYPE_NURBS = 3, } CurveType; +#define CURVE_TYPES_NUM 4 typedef enum HandleType { /** The handle can be moved anywhere, and doesn't influence the point's other handle. */ -- cgit v1.2.3