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-11 20:34:03 +0300
committerHans Goudey <h.goudey@me.com>2022-03-11 20:34:03 +0300
commit22807d2075b0bcc7b5ae655ba43b08a4e44b002b (patch)
tree190043a64dfd78722804a40bd9b3ad835b851e16 /source/blender/makesdna
parent3b28c785d4e438428af3aa513d56f5fd394498e4 (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.h4
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;