[Bf-blender-cvs] [47b1f9a4d36] geometry-nodes-curve-support: Splines: Cleanup, add comment
Hans Goudey
noreply at git.blender.org
Mon Apr 26 04:37:14 CEST 2021
Commit: 47b1f9a4d36c67604e2ade584594b356dfdebffd
Author: Hans Goudey
Date: Sun Apr 25 21:37:04 2021 -0500
Branches: geometry-nodes-curve-support
https://developer.blender.org/rB47b1f9a4d36c67604e2ade584594b356dfdebffd
Splines: Cleanup, add comment
===================================================================
M source/blender/blenkernel/intern/geometry_component_curve.cc
===================================================================
diff --git a/source/blender/blenkernel/intern/geometry_component_curve.cc b/source/blender/blenkernel/intern/geometry_component_curve.cc
index 67625237a01..e0938d2101b 100644
--- a/source/blender/blenkernel/intern/geometry_component_curve.cc
+++ b/source/blender/blenkernel/intern/geometry_component_curve.cc
@@ -107,7 +107,7 @@ void CurveComponent::ensure_owns_direct_data()
{
BLI_assert(this->is_mutable());
if (ownership_ != GeometryOwnershipType::Owned) {
- // curve_ = BKE_curve_copy_for_eval(curve_, false);
+ curve_ = curve_->copy();
ownership_ = GeometryOwnershipType::Owned;
}
}
@@ -212,7 +212,6 @@ static int get_spline_resolution(const SplinePtr &spline)
static void set_spline_resolution(SplinePtr &spline, const int resolution)
{
spline->set_resolution(std::max(resolution, 1));
- spline->mark_cache_invalid();
}
static GVArrayPtr make_resolution_read_attribute(const SplineGroup &curve)
@@ -267,6 +266,10 @@ static GVMutableArrayPtr make_cyclic_write_attribute(SplineGroup &curve)
curve.splines.as_mutable_span());
}
+/**
+ * \note Currently this uses an inefficient method, copying data from each spline into a single
+ * array and then passing that as the attribute. Also, currently attributes are only read-only.
+ */
class BuiltinPointAttributeProvider final : public BuiltinAttributeProvider {
using GetSplineData = void (*)(const Spline &spline, fn::GMutableSpan r_data);
using SetSplineData = void (*)(Spline &spline, fn::GSpan data);
More information about the Bf-blender-cvs
mailing list