From 6a1ab4747b7758017721cb191046a9db800f7894 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Tue, 19 Jul 2022 10:14:46 -0500 Subject: Geometry Nodes: Copy parameters when copying a curves data-block Previously, things like materials, symmetry, and selection options stored on `Curves` weren't copied to the result in nodes like the subdivide and resample nodes. Now they are, which fixes some unexpected behavior and allows visualization of the sculpt mode selection. In the realize instances and join nodes the behavior is the same as for meshes, the parameters are taken from the first (top) input. I also refactored some functions to return a `CurvesGeometry` by-value, which makes it the responsibility of the node to copy the parameters. That should make the algorithms more reusable in other situations. Differential Revision: https://developer.blender.org/D15408 --- source/blender/blenkernel/BKE_curves_utils.hh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/blender/blenkernel/BKE_curves_utils.hh') diff --git a/source/blender/blenkernel/BKE_curves_utils.hh b/source/blender/blenkernel/BKE_curves_utils.hh index f223e173ea9..0fbd33002e1 100644 --- a/source/blender/blenkernel/BKE_curves_utils.hh +++ b/source/blender/blenkernel/BKE_curves_utils.hh @@ -55,6 +55,13 @@ void fill_points(const CurvesGeometry &curves, fill_points(curves, curve_selection, &value, dst); } +/** + * Copy only the information on the point domain, but not the offsets or any point attributes, + * meant for operations that change the number of points but not the number of curves. + * \warning The returned curves have invalid offsets! + */ +bke::CurvesGeometry copy_only_curve_domain(const bke::CurvesGeometry &src_curves); + /** * Copy the size of every curve in #curve_ranges to the corresponding index in #counts. */ -- cgit v1.2.3