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/nodes/geometry/nodes/node_geo_join_geometry.cc
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/nodes/geometry/nodes/node_geo_join_geometry.cc')
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc b/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc
index 915ebc1e1f2..adfd924f185 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_join_geometry.cc
@@ -337,6 +337,14 @@ static void join_curve_components(MutableSpan<GeometrySet> src_geometry_sets, Ge
}
}
+ /* For now, remove all custom attributes, since they might have different types,
+ * or an attribute might not exist on all splines. */
+ dst_curve->attributes.reallocate(dst_curve->splines().size());
+ CustomData_reset(&dst_curve->attributes.data);
+ for (SplinePtr &spline : dst_curve->splines()) {
+ CustomData_reset(&spline->attributes.data);
+ }
+
dst_component.replace(dst_curve);
}