diff options
author | Hans Goudey <h.goudey@me.com> | 2022-07-19 18:14:46 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-07-19 18:16:30 +0300 |
commit | 6a1ab4747b7758017721cb191046a9db800f7894 (patch) | |
tree | a3e28d26c96c2070b231bcb6c5f6a9b0409361aa /source/blender/geometry/intern/realize_instances.cc | |
parent | 9246ff373a19df24255d924979c78793f97b2834 (diff) |
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
Diffstat (limited to 'source/blender/geometry/intern/realize_instances.cc')
-rw-r--r-- | source/blender/geometry/intern/realize_instances.cc | 5 |
1 files changed, 5 insertions, 0 deletions
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<int> point_ids; if (all_curves_info.create_id_attribute) { |