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/geometry/intern/realize_instances.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender/geometry/intern/realize_instances.cc') diff --git a/source/blender/geometry/intern/realize_instances.cc b/source/blender/geometry/intern/realize_instances.cc index 66b856ee0c4..25bcead09b4 100644 --- a/source/blender/geometry/intern/realize_instances.cc +++ b/source/blender/geometry/intern/realize_instances.cc @@ -1238,6 +1238,11 @@ static void execute_realize_curve_tasks(const RealizeInstancesOptions &options, dst_component.replace(dst_curves_id); bke::MutableAttributeAccessor dst_attributes = dst_curves.attributes_for_write(); + /* Copy settings from the first input geometry set with curves. */ + const RealizeCurveTask &first_task = tasks.first(); + const Curves &first_curves_id = *first_task.curve_info->curves; + bke::curves_copy_parameters(first_curves_id, *dst_curves_id); + /* Prepare id attribute. */ SpanAttributeWriter point_ids; if (all_curves_info.create_id_attribute) { -- cgit v1.2.3