Geometry Nodes: Copy spline attributes in the curve resample node
Previously only point domain attributes were copied to the result curve.
This commit is contained in:
@@ -329,6 +329,7 @@ class CustomDataAttributes {
|
||||
~CustomDataAttributes();
|
||||
CustomDataAttributes(const CustomDataAttributes &other);
|
||||
CustomDataAttributes(CustomDataAttributes &&other);
|
||||
CustomDataAttributes &operator=(const CustomDataAttributes &other);
|
||||
|
||||
void reallocate(const int size);
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user