Blender V5.3
blender::bke::curves Namespace Reference

Namespaces

namespace  nurbs
namespace  poly
namespace  bezier
namespace  catmull_rom

Classes

struct  CurveSegment
struct  CurvePoint
class  IndexRangeCyclic

Functions

const AttributeAccessorFunctions & get_attribute_accessor_functions ()
static void tag_topology_changed (void *owner)
static void tag_curve_types_changed (void *owner)
static void tag_positions_changed (void *owner)
static void tag_radii_changed (void *owner)
static void tag_normals_changed (void *owner)
static void tag_material_index_changed (void *owner)
static const auto & changed_tags ()
static int get_domain_size (const void *owner, const AttrDomain domain)
static GAttributeReader reader_for_vertex_group_index (const CurvesGeometry &curves, const Span< MDeformVert > dverts, const int vertex_group_index)
static GAttributeReader try_get_vertex_group (const void *owner, const StringRef name)
static GAttributeWriter try_get_vertex_group_for_write (void *owner, const StringRef name)
static bool foreach_vertex_group (const void *owner, FunctionRef< void(const AttributeIter &)> fn)
static const auto & builtin_attributes ()
static const auto & array_storage_required ()
static AttributeAccessorFunctions get_curves_accessor_functions ()
static void if_has_data_call_callback (const Span< int > offset_data, const int begin, const int end, UnselectedCallback callback)
template<typename Fn>
static void foreach_selected_point_ranges_per_curve_ (const IndexMask &mask, const OffsetIndices< int > points_by_curve, const SelectedCallback selected_fn, const Fn unselected_fn)
Inline Curve Methods
int segments_num (const int points_num, const bool cyclic)
float2 encode_surface_bary_coord (const float3 &v)
float3 decode_surface_bary_coord (const float2 &v)
IndexRange per_curve_point_offsets_range (const IndexRange points, const int curve_index)

Utility Functions

using SelectedCallback
using UnselectedCallback = FunctionRef<void(IndexRange curves, IndexRange unselected_points)>
IndexMask curve_to_point_selection (OffsetIndices< int > points_by_curve, const IndexMask &curve_selection, LinearAllocator<> &memory)
IndexMask point_to_curve_selection (OffsetIndices< int > points_by_curve, const IndexMask &point_mask, LinearAllocator<> &memory)
IndexMask curve_type_point_selection (const bke::CurvesGeometry &curves, CurveType curve_type, LinearAllocator<> &memory)
void fill_points (OffsetIndices< int > points_by_curve, const IndexMask &curve_selection, GPointer value, GMutableSpan dst)
template<typename T>
void fill_points (const OffsetIndices< int > points_by_curve, const IndexMask &curve_selection, const T &value, MutableSpan< T > dst)
bke::CurvesGeometry copy_only_curve_domain (const bke::CurvesGeometry &src_curves)
IndexMask indices_for_type (const VArray< int8_t > &types, const std::array< int, CURVE_TYPES_NUM > &type_counts, const CurveType type, const IndexMask &selection, LinearAllocator<> &memory)
void foreach_curve_by_type (const VArray< int8_t > &types, const std::array< int, CURVE_TYPES_NUM > &type_counts, const IndexMask &selection, FunctionRef< void(IndexMask)> catmull_rom_fn, FunctionRef< void(IndexMask)> poly_fn, FunctionRef< void(IndexMask)> bezier_fn, FunctionRef< void(IndexMask)> nurbs_fn)
void foreach_selected_point_ranges_per_curve (const IndexMask &mask, OffsetIndices< int > points_by_curve, SelectedCallback selected_fn)
void foreach_selected_point_ranges_per_curve (const IndexMask &mask, OffsetIndices< int > points_by_curve, SelectedCallback selected_fn, UnselectedCallback unselected_fn)

Typedef Documentation

◆ SelectedCallback

Initial value:

Definition at line 522 of file BKE_curves_utils.hh.

◆ UnselectedCallback

Definition at line 524 of file BKE_curves_utils.hh.

Function Documentation

◆ array_storage_required()

const auto & blender::bke::curves::array_storage_required ( )
static

◆ builtin_attributes()

◆ changed_tags()

◆ copy_only_curve_domain()

CurvesGeometry blender::bke::curves::copy_only_curve_domain ( const bke::CurvesGeometry & src_curves)

◆ curve_to_point_selection()

◆ curve_type_point_selection()

◆ decode_surface_bary_coord()

float3 blender::bke::curves::decode_surface_bary_coord ( const float2 & v)
inline

Definition at line 586 of file BKE_curves.hh.

References decode_surface_bary_coord(), and blender::v.

Referenced by decode_surface_bary_coord().

◆ encode_surface_bary_coord()

float2 blender::bke::curves::encode_surface_bary_coord ( const float3 & v)
inline

Definition at line 580 of file BKE_curves.hh.

References blender::BLI_assert(), encode_surface_bary_coord(), and blender::v.

Referenced by encode_surface_bary_coord().

◆ fill_points() [1/2]

template<typename T>
void blender::bke::curves::fill_points ( const OffsetIndices< int > points_by_curve,
const IndexMask & curve_selection,
const T & value,
MutableSpan< T > dst )

Definition at line 489 of file BKE_curves_utils.hh.

References fill_points(), and T.

◆ fill_points() [2/2]

◆ foreach_curve_by_type()

◆ foreach_selected_point_ranges_per_curve() [1/2]

void blender::bke::curves::foreach_selected_point_ranges_per_curve ( const IndexMask & mask,
OffsetIndices< int > points_by_curve,
SelectedCallback selected_fn )

Calls callback function for each curve having selected points.

Parameters
maskselected points.
points_by_curveThe offsets of every curve into arrays on the points domain.
selected_fncallback function called for each curve with at least one point selected.

Definition at line 180 of file curves_utils.cc.

References foreach_selected_point_ranges_per_curve(), and foreach_selected_point_ranges_per_curve_().

Referenced by blender::ed::curves::calc_curves_extrusion(), blender::bke::copy_point_selection_custom_knots(), blender::ed::curves::duplicate_points(), foreach_selected_point_ranges_per_curve(), foreach_selected_point_ranges_per_curve(), blender::ed::curves::separate_points(), and blender::ed::curves::split_points().

◆ foreach_selected_point_ranges_per_curve() [2/2]

void blender::bke::curves::foreach_selected_point_ranges_per_curve ( const IndexMask & mask,
OffsetIndices< int > points_by_curve,
SelectedCallback selected_fn,
UnselectedCallback unselected_fn )

Calls callback function for each curve having selected points. Calls second callback for groups of curves with no points selected.

Parameters
maskselected points.
points_by_curveThe offsets of every curve into arrays on the points domain.
selected_fncallback function called for each curve with at least one point selected.
unselected_fncallback function called for groups of curves with no selected points.

Definition at line 187 of file curves_utils.cc.

References foreach_selected_point_ranges_per_curve(), and foreach_selected_point_ranges_per_curve_().

◆ foreach_selected_point_ranges_per_curve_()

◆ foreach_vertex_group()

◆ get_attribute_accessor_functions()

◆ get_curves_accessor_functions()

◆ get_domain_size()

int blender::bke::curves::get_domain_size ( const void * owner,
const AttrDomain domain )
static

◆ if_has_data_call_callback()

void blender::bke::curves::if_has_data_call_callback ( const Span< int > offset_data,
const int begin,
const int end,
UnselectedCallback callback )
static

◆ indices_for_type()

◆ per_curve_point_offsets_range()

◆ point_to_curve_selection()

◆ reader_for_vertex_group_index()

GAttributeReader blender::bke::curves::reader_for_vertex_group_index ( const CurvesGeometry & curves,
const Span< MDeformVert > dverts,
const int vertex_group_index )
static

◆ segments_num()

int blender::bke::curves::segments_num ( const int points_num,
const bool cyclic )
inline

The number of segments between control points, accounting for the last segment of cyclic curves. The logic is simple, but this function should be used to make intentions clearer.

Definition at line 574 of file BKE_curves.hh.

References blender::BLI_assert(), and segments_num().

Referenced by blender::bke::curves::catmull_rom::calculate_evaluated_num(), blender::draw::curve_eval_render_wire_verts_edges_len_get(), blender::bke::fill_mesh_topology(), blender::bke::curves::bezier::has_vector_handles(), segments_num(), and blender::bke::segments_num_no_duplicate_edge().

◆ tag_curve_types_changed()

void blender::bke::curves::tag_curve_types_changed ( void * owner)
static

Definition at line 29 of file curves_attributes.cc.

References tag_curve_types_changed().

Referenced by changed_tags(), and tag_curve_types_changed().

◆ tag_material_index_changed()

void blender::bke::curves::tag_material_index_changed ( void * owner)
static

Definition at line 54 of file curves_attributes.cc.

References tag_material_index_changed().

Referenced by changed_tags(), and tag_material_index_changed().

◆ tag_normals_changed()

void blender::bke::curves::tag_normals_changed ( void * owner)
static

Definition at line 48 of file curves_attributes.cc.

References tag_normals_changed().

Referenced by changed_tags(), and tag_normals_changed().

◆ tag_positions_changed()

void blender::bke::curves::tag_positions_changed ( void * owner)
static

Definition at line 36 of file curves_attributes.cc.

References tag_positions_changed().

Referenced by changed_tags(), and tag_positions_changed().

◆ tag_radii_changed()

void blender::bke::curves::tag_radii_changed ( void * owner)
static

Definition at line 42 of file curves_attributes.cc.

References tag_radii_changed().

Referenced by changed_tags(), and tag_radii_changed().

◆ tag_topology_changed()

void blender::bke::curves::tag_topology_changed ( void * owner)
static

Definition at line 23 of file curves_attributes.cc.

References tag_topology_changed().

Referenced by changed_tags(), and tag_topology_changed().

◆ try_get_vertex_group()

GAttributeReader blender::bke::curves::try_get_vertex_group ( const void * owner,
const StringRef name )
static

◆ try_get_vertex_group_for_write()

GAttributeWriter blender::bke::curves::try_get_vertex_group_for_write ( void * owner,
const StringRef name )
static