diff options
author | Hans Goudey <h.goudey@me.com> | 2022-03-25 17:00:30 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-03-25 17:00:30 +0300 |
commit | c0016d85b2a62858229d31bd97399fbe2608f99d (patch) | |
tree | 9ccabf7543a5c7043d85a55f37c42c403e6b6013 /source/blender/makesdna | |
parent | 59de9ceda05c84670d27fcb526d513e30a8e29b4 (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/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_curves_types.h | 1 |
1 files changed, 1 insertions, 0 deletions
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. */ |