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
25 lines
737 B
C++
25 lines
737 B
C++
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
#pragma once
|
|
|
|
#include "BLI_function_ref.hh"
|
|
#include "BLI_index_mask.hh"
|
|
#include "BLI_virtual_array.hh"
|
|
|
|
#include "BKE_curves.hh"
|
|
|
|
namespace blender::geometry {
|
|
|
|
/**
|
|
* Add more points along each segment, with the amount of points to add in each segment described
|
|
* by the #cuts input. The new points are equidistant in parameter space, but not in the actual
|
|
* distances.
|
|
*
|
|
* \param selection: A selection of curves to consider when subdividing.
|
|
*/
|
|
bke::CurvesGeometry subdivide_curves(const bke::CurvesGeometry &src_curves,
|
|
IndexMask selection,
|
|
const VArray<int> &cuts);
|
|
|
|
} // namespace blender::geometry
|