diff options
author | Hans Goudey <h.goudey@me.com> | 2022-03-11 20:34:03 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-03-11 20:34:03 +0300 |
commit | 22807d2075b0bcc7b5ae655ba43b08a4e44b002b (patch) | |
tree | 190043a64dfd78722804a40bd9b3ad835b851e16 /source/blender/makesdna | |
parent | 3b28c785d4e438428af3aa513d56f5fd394498e4 (diff) |
Curves: Move constructor/assignment
Add the ability to move `CurvesGeometry` without copying its attributes
and data. The benefit is more intuitive management of the data-block
copying, and less overhead for copying in some cases. The "moved-from"
source is left in an empty but valid state. A test file is added to test
the move constructor.
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_curves_types.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_curves_types.h b/source/blender/makesdna/DNA_curves_types.h index 98d2aa4b295..d3e69315265 100644 --- a/source/blender/makesdna/DNA_curves_types.h +++ b/source/blender/makesdna/DNA_curves_types.h @@ -69,7 +69,8 @@ typedef struct CurvesGeometry { /** * The start index of each curve in the point data. The size of each curve can be calculated by * subtracting the offset from the next offset. That is valid even for the last curve because - * this array is allocated with a length one larger than the number of splines. + * this array is allocated with a length one larger than the number of splines. This is allowed + * to be null when there are no curves. * * \note This is *not* stored in #CustomData because its size is one larger than #curve_data. */ @@ -77,6 +78,7 @@ typedef struct CurvesGeometry { /** * All attributes stored on control points (#ATTR_DOMAIN_POINT). + * This might not contain a layer for positions if there are no points. */ CustomData point_data; |