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/GEO_set_curve_type.hh | |
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/GEO_set_curve_type.hh')
-rw-r--r-- | source/blender/geometry/GEO_set_curve_type.hh | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/source/blender/geometry/GEO_set_curve_type.hh b/source/blender/geometry/GEO_set_curve_type.hh index 6a75450006b..f38e63b1fc8 100644 --- a/source/blender/geometry/GEO_set_curve_type.hh +++ b/source/blender/geometry/GEO_set_curve_type.hh @@ -2,17 +2,10 @@ #pragma once -#include "DNA_curves_types.h" - #include "BLI_function_ref.hh" #include "BLI_index_mask.hh" -struct Curves; -class CurveComponent; - -namespace blender::bke { -class CurvesGeometry; -} +#include "BKE_curves.hh" namespace blender::geometry { @@ -27,14 +20,13 @@ namespace blender::geometry { */ bool try_curves_conversion_in_place(IndexMask selection, CurveType dst_type, - FunctionRef<Curves &()> get_writable_curves_fn); + FunctionRef<bke::CurvesGeometry &()> get_writable_curves_fn); /** * Change the types of the selected curves, potentially changing the total point count. */ -Curves *convert_curves(const CurveComponent &src_component, - const bke::CurvesGeometry &src_curves, - IndexMask selection, - CurveType dst_type); +bke::CurvesGeometry convert_curves(const bke::CurvesGeometry &src_curves, + IndexMask selection, + CurveType dst_type); } // namespace blender::geometry |