This commit adds an option to interpolate the number of control points in new curves based on the count in neighboring existing curves. The idea is to provide a more automatic default than manually controlling the number of points in a curve, so users don't have to think about the resolution quite as much. Internally, some utilities for creating new curves are extracted to a new header file. These can be used for the various nodes and operators that create new curves. The top-bar UI will be adjusted in a separate patch, probably moving all of the settings that affect the size and shape of the new curves into a popover. Differential Revision: https://developer.blender.org/D14877
27 lines
680 B
C++
27 lines
680 B
C++
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
#pragma once
|
|
|
|
#include "BKE_curves.hh"
|
|
|
|
/** \file
|
|
* \ingroup bke
|
|
* \brief Low-level operations for curves.
|
|
*/
|
|
|
|
namespace blender::bke::curves {
|
|
|
|
/**
|
|
* Copy the size of every curve in #curve_ranges to the corresponding index in #counts.
|
|
*/
|
|
void fill_curve_counts(const bke::CurvesGeometry &curves,
|
|
Span<IndexRange> curve_ranges,
|
|
MutableSpan<int> counts);
|
|
|
|
/**
|
|
* Turn an array of sizes into the offset at each index including all previous sizes.
|
|
*/
|
|
void accumulate_counts_to_offsets(MutableSpan<int> counts_to_offsets, int start_offset = 0);
|
|
|
|
} // namespace blender::bke::curves
|