This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/geometry/GEO_subdivide_curves.hh
Hans Goudey 6a1ab4747b 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
2022-07-19 10:16:30 -05:00

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