diff options
-rw-r--r-- | source/blender/blenkernel/BKE_attribute_access.hh | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/attribute_access.cc | 10 | ||||
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc | 2 |
3 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_attribute_access.hh b/source/blender/blenkernel/BKE_attribute_access.hh index 381a03d29d7..c3f7dbd4bd9 100644 --- a/source/blender/blenkernel/BKE_attribute_access.hh +++ b/source/blender/blenkernel/BKE_attribute_access.hh @@ -329,6 +329,7 @@ class CustomDataAttributes { ~CustomDataAttributes(); CustomDataAttributes(const CustomDataAttributes &other); CustomDataAttributes(CustomDataAttributes &&other); + CustomDataAttributes &operator=(const CustomDataAttributes &other); void reallocate(const int size); diff --git a/source/blender/blenkernel/intern/attribute_access.cc b/source/blender/blenkernel/intern/attribute_access.cc index f2ad873b10e..8bbb3014dac 100644 --- a/source/blender/blenkernel/intern/attribute_access.cc +++ b/source/blender/blenkernel/intern/attribute_access.cc @@ -617,6 +617,16 @@ CustomDataAttributes::CustomDataAttributes(CustomDataAttributes &&other) CustomData_reset(&other.data); } +CustomDataAttributes &CustomDataAttributes::operator=(const CustomDataAttributes &other) +{ + if (this != &other) { + CustomData_copy(&other.data, &data, CD_MASK_ALL, CD_DUPLICATE, other.size_); + size_ = other.size_; + } + + return *this; +} + std::optional<GSpan> CustomDataAttributes::get_for_read(const StringRef name) const { BLI_assert(size_ != 0); diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc index 9d0820eb0b0..e879ec624c0 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_resample.cc @@ -153,7 +153,7 @@ static std::unique_ptr<CurveEval> resample_curve(const CurveEval &input_curve, } } - output_curve->attributes.reallocate(output_curve->splines().size()); + output_curve->attributes = input_curve.attributes; return output_curve; } |