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>2021-05-19 20:22:09 +0300
committerHans Goudey <h.goudey@me.com>2021-05-19 20:22:09 +0300
commit627f3571271e5f1a416314fb73f8e3c613271db3 (patch)
tree913e453295db56a9099262e6e3b30b8fdb90335c /source/blender/blenkernel/BKE_spline.hh
parent192a3f1a05d00f1f10f32861c098b66f78cff3e4 (diff)
Geometry Nodes: Support for dynamic attributes on curve splines
With this patch you will be able to add and remove attributes from curve data inside of geometry nodes. The following is currently implemented: * Adding attributes with any data type to splines or spline points. * Support for working with multiple splines at the same time. * Interaction with the three builtin point attributes. * Resampling attributes in the resample node. The following is not implemented in this patch: * Joining attributes when joining splines with the join geometry node. * Domain interpolation between spline and point domains. * More efficient ways to call attribute operations once per spline. Differential Revision: https://developer.blender.org/D11251
Diffstat (limited to 'source/blender/blenkernel/BKE_spline.hh')
-rw-r--r--source/blender/blenkernel/BKE_spline.hh14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_spline.hh b/source/blender/blenkernel/BKE_spline.hh
index c3386d12b02..9e5552082af 100644
--- a/source/blender/blenkernel/BKE_spline.hh
+++ b/source/blender/blenkernel/BKE_spline.hh
@@ -28,6 +28,7 @@
#include "BLI_float4x4.hh"
#include "BLI_vector.hh"
+#include "BKE_attribute_access.hh"
#include "BKE_attribute_math.hh"
struct Curve;
@@ -74,6 +75,8 @@ class Spline {
/* Only #Zup is supported at the moment. */
NormalCalculationMode normal_mode;
+ blender::bke::CustomDataAttributes attributes;
+
protected:
Type type_;
bool is_cyclic_ = false;
@@ -99,7 +102,10 @@ class Spline {
{
}
Spline(Spline &other)
- : normal_mode(other.normal_mode), type_(other.type_), is_cyclic_(other.is_cyclic_)
+ : normal_mode(other.normal_mode),
+ attributes(other.attributes),
+ type_(other.type_),
+ is_cyclic_(other.is_cyclic_)
{
}
@@ -482,8 +488,10 @@ class CurveEval {
blender::Vector<SplinePtr> splines_;
public:
+ blender::bke::CustomDataAttributes attributes;
+
CurveEval() = default;
- CurveEval(const CurveEval &other)
+ CurveEval(const CurveEval &other) : attributes(other.attributes)
{
for (const SplinePtr &spline : other.splines()) {
this->add_spline(spline->copy());
@@ -502,6 +510,8 @@ class CurveEval {
blender::Array<int> control_point_offsets() const;
blender::Array<int> evaluated_point_offsets() const;
+
+ void assert_valid_point_attributes() const;
};
std::unique_ptr<CurveEval> curve_eval_from_dna_curve(const Curve &curve);