|
Blender V5.3
|
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) |
Definition at line 522 of file BKE_curves_utils.hh.
| using blender::bke::curves::UnselectedCallback = FunctionRef<void(IndexRange curves, IndexRange unselected_points)> |
Definition at line 524 of file BKE_curves_utils.hh.
|
static |
Definition at line 272 of file curves_attributes.cc.
References array_storage_required().
Referenced by array_storage_required(), and get_curves_accessor_functions().
|
static |
Definition at line 158 of file curves_attributes.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new(), blender::BEZIER_HANDLE_ALIGN, blender::BEZIER_HANDLE_FREE, blender::bke::Bool, builtin_attributes(), blender::bke::Curve, blender::CURVE_TYPE_CATMULL_ROM, blender::CURVE_TYPE_NURBS, blender::bke::AttrBuiltinInfo::default_value, blender::bke::Float, blender::bke::Float3, blender::bke::Int32, blender::bke::Int8, blender::NORMAL_MODE_FREE, blender::NORMAL_MODE_MINIMUM_TWIST, blender::NURBS_KNOT_MODE_ENDPOINT_BEZIER, blender::NURBS_KNOT_MODE_NORMAL, blender::bke::Point, position, and blender::bke::AttrBuiltinInfo::validator.
Referenced by builtin_attributes(), and get_curves_accessor_functions().
|
static |
Definition at line 60 of file curves_attributes.cc.
References changed_tags(), tag_curve_types_changed(), tag_material_index_changed(), tag_normals_changed(), tag_positions_changed(), tag_radii_changed(), and tag_topology_changed().
Referenced by changed_tags(), and get_curves_accessor_functions().
| CurvesGeometry blender::bke::curves::copy_only_curve_domain | ( | const bke::CurvesGeometry & | src_curves | ) |
Create new curves with the same number of curves as the input, but no points. Copy all curve domain attributes to the new curves, except the offsets encoding the size of each curve.
Used for operations that change the number of points but not the number of curves, allowing creation of the new offsets directly inside the new array.
Definition at line 71 of file curves_utils.cc.
References blender::bke::CurvesGeometry::attributes(), blender::bke::CurvesGeometry::attributes_for_write(), blender::bke::copy_attributes(), copy_only_curve_domain(), blender::bke::Curve, blender::bke::CurvesGeometry::curves_num(), blender::CurvesGeometry::runtime, and blender::bke::CurvesGeometryRuntime::type_counts.
Referenced by blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::convert_curves_to_nurbs(), copy_only_curve_domain(), blender::ed::greasepencil::curves_merge_by_distance(), blender::geometry::extend_curves(), blender::ed::curves::extrude_curves(), blender::geometry::fillet_curves(), blender::geometry::fit_poly_to_bezier_curves(), blender::geometry::resample_to_count(), blender::geometry::resample_to_evaluated(), blender::geometry::resample_to_length(), blender::geometry::resample_to_uniform(), blender::ed::curves::resize_curves(), blender::geometry::subdivide_curves(), and blender::geometry::trim_curves().
| IndexMask blender::bke::curves::curve_to_point_selection | ( | OffsetIndices< int > | points_by_curve, |
| const IndexMask & | curve_selection, | ||
| LinearAllocator<> & | memory ) |
Definition at line 32 of file curves_utils.cc.
References curve_to_point_selection(), blender::index_mask::IndexMask::foreach_index(), blender::IndexMask::from_initializers(), blender::exec_mode::grain_size(), and blender::index_mask::IndexMask::size().
Referenced by blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_nurbs(), blender::bke::copy_point_selection_custom_knots(), blender::ed::transform::curves::createTransCurvesVerts(), curve_to_point_selection(), curve_type_point_selection(), blender::draw::grease_pencil_cache_add_nurbs(), blender::draw::grease_pencil_edit_batch_ensure(), blender::draw::grease_pencil_weight_batch_ensure(), and blender::bke::greasepencil::selected_mask_to_fills().
| IndexMask blender::bke::curves::curve_type_point_selection | ( | const bke::CurvesGeometry & | curves, |
| CurveType | curve_type, | ||
| LinearAllocator<> & | memory ) |
Definition at line 43 of file curves_utils.cc.
References curve_to_point_selection(), curve_type_point_selection(), and indices_for_type().
Referenced by blender::bke::CurvesGeometry::calculate_bezier_aligned_handles(), curve_type_point_selection(), blender::ed::transform::gizmo_3d_foreach_selected(), blender::ed::greasepencil::grease_pencil_reproject_exec(), blender::ed::greasepencil::grease_pencil_snap_to_grid_exec(), blender::init_curves_point_selection_status(), blender::ed::curves::retrieve_all_selected_points(), and blender::ed::curves::transverts_curves_selection().
Definition at line 586 of file BKE_curves.hh.
References decode_surface_bary_coord(), and blender::v.
Referenced by decode_surface_bary_coord().
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().
| 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.
| void blender::bke::curves::fill_points | ( | OffsetIndices< int > | points_by_curve, |
| const IndexMask & | curve_selection, | ||
| GPointer | value, | ||
| GMutableSpan | dst ) |
Definition at line 56 of file curves_utils.cc.
References blender::BLI_assert(), blender::GMutableSpan::data(), blender::CPPType::fill_assign_n(), fill_points(), blender::index_mask::IndexMask::foreach_index(), blender::GPointer::get(), blender::exec_mode::grain_size(), blender::IndexRange::size(), blender::GMutableSpan::slice(), blender::GMutableSpan::type(), and blender::GPointer::type().
Referenced by blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_nurbs(), blender::geometry::copy_or_defaults_for_unselected_curves(), blender::bke::CurvesGeometry::evaluated_positions(), blender::geometry::fill_nurbs_data(), fill_points(), fill_points(), blender::ed::greasepencil::grease_pencil_set_uniform_opacity_exec(), blender::ed::greasepencil::grease_pencil_set_uniform_thickness_exec(), and blender::geometry::simplify_curve_attribute().
| void blender::bke::curves::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 ) |
Definition at line 100 of file curves_utils.cc.
References blender::CURVE_TYPE_BEZIER, blender::CURVE_TYPE_CATMULL_ROM, blender::CURVE_TYPE_NURBS, blender::CURVE_TYPE_POLY, foreach_curve_by_type(), and indices_for_type().
Referenced by blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::convert_curves_to_nurbs(), blender::bke::curve_legacy_to_curves(), blender::bke::CurvesGeometry::evaluated_positions(), foreach_curve_by_type(), blender::geometry::subdivide_curves(), and blender::geometry::trim_curves().
| 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.
| mask | selected points. |
| points_by_curve | The offsets of every curve into arrays on the points domain. |
| selected_fn | callback 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().
| 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.
| mask | selected points. |
| points_by_curve | The offsets of every curve into arrays on the points domain. |
| selected_fn | callback function called for each curve with at least one point selected. |
| unselected_fn | callback 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_().
|
static |
Definition at line 134 of file curves_utils.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::Vector< T, InlineBufferCapacity, Allocator >::clear(), blender::offset_indices::OffsetIndices< T >::data(), foreach_selected_point_ranges_per_curve_(), blender::IndexRange::from_begin_end_inclusive(), if_has_data_call_callback(), and blender::offset_indices::OffsetIndices< T >::size().
Referenced by foreach_selected_point_ranges_per_curve(), foreach_selected_point_ranges_per_curve(), and foreach_selected_point_ranges_per_curve_().
|
static |
Definition at line 134 of file curves_attributes.cc.
References blender::bke::AttributeIter::accessor, blender::bke::Float, foreach_vertex_group(), blender::bke::AttributeIter::is_builtin, blender::bke::AttributeIter::is_stopped(), blender::bke::Point, and reader_for_vertex_group_index().
Referenced by foreach_vertex_group(), and get_curves_accessor_functions().
| const AttributeAccessorFunctions & blender::bke::curves::get_attribute_accessor_functions | ( | ) |
Definition at line 466 of file curves_attributes.cc.
References get_attribute_accessor_functions(), and get_curves_accessor_functions().
Referenced by blender::bke::CurveComponent::attributes(), blender::bke::CurvesGeometry::attributes(), blender::bke::CurveComponent::attributes_for_write(), blender::bke::CurvesGeometry::attributes_for_write(), and get_attribute_accessor_functions().
|
static |
Definition at line 279 of file curves_attributes.cc.
References blender::bke::AttributeIter::accessor, array_storage_required(), blender::bke::Attribute::assign_data(), blender::bke::attribute_init_to_data(), blender::bke::attribute_to_reader(), blender::bke::attribute_to_writer(), blender::BKE_defgroup_name_index(), builtin_attributes(), changed_tags(), blender::bke::AttributeInit::Construct, blender::bke::Curve, blender::data, blender::bke::Attribute::data_type(), blender::bke::AttrBuiltinInfo::default_value, blender::bke::AttrBuiltinInfo::domain, blender::bke::Attribute::domain(), ELEM, blender::bke::Float, foreach_vertex_group(), get_curves_accessor_functions(), get_domain_size(), blender::bke::AttributeIter::is_builtin, blender::bke::AttributeIter::is_stopped(), blender::bke::Point, blender::bke::rename_attributes(), storage, blender::bke::AttributeIter::storage_type, blender::bke::try_delete_vertex_group(), try_get_vertex_group(), try_get_vertex_group_for_write(), blender::bke::AttrBuiltinInfo::type, and blender::bke::AttrBuiltinInfo::validator.
Referenced by get_attribute_accessor_functions(), and get_curves_accessor_functions().
|
static |
Definition at line 82 of file curves_attributes.cc.
References blender::bke::Curve, get_domain_size(), and blender::bke::Point.
Referenced by get_curves_accessor_functions(), and get_domain_size().
|
static |
Definition at line 121 of file curves_utils.cc.
References blender::begin(), blender::IndexRange::from_begin_end(), and if_has_data_call_callback().
Referenced by foreach_selected_point_ranges_per_curve_(), and if_has_data_call_callback().
| IndexMask blender::bke::curves::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 ) |
Definition at line 83 of file curves_utils.cc.
References blender::IndexMask::from_predicate(), blender::VArrayCommon< T >::get_internal_single(), blender::VArrayCommon< T >::get_internal_span(), blender::IndexMask::IndexMask(), indices_for_type(), blender::VArrayCommon< T >::is_single(), and blender::VArrayCommon< T >::size().
Referenced by blender::ed::transform::curves::createTransCurvesVerts(), blender::ed::transform::greasepencil::createTransGreasePencilVerts(), curve_type_point_selection(), blender::draw::DRW_curves_batch_cache_create_requested(), foreach_curve_by_type(), blender::draw::grease_pencil_get_editable_selected_nurbs_curves(), blender::draw::grease_pencil_get_visible_nurbs_curves(), blender::bke::CurvesGeometry::indices_for_curve_type(), indices_for_type(), and blender::ed::greasepencil::retrieve_visible_bezier_strokes().
|
inline |
Return a range used to retrieve values from an array of values stored per point, but with an extra element at the end of each curve. This is useful for offsets within curves, where it is convenient to store the first 0 and have the last offset be the total result curve size, using the same rules as OffsetIndices.
Definition at line 597 of file BKE_curves.hh.
References per_curve_point_offsets_range(), blender::IndexRange::size(), and blender::IndexRange::start().
Referenced by blender::bke::CurvesGeometry::bezier_evaluated_offsets_for_curve(), blender::bke::calculate_evaluated_offsets(), blender::geometry::calculate_result_offsets(), blender::geometry::calculate_result_offsets(), blender::geometry::duplicate_fillet_point_data(), blender::bke::evaluate_generic_data_for_curve(), blender::bke::CurvesGeometry::evaluated_positions(), blender::geometry::fillet_curves(), per_curve_point_offsets_range(), blender::geometry::subdivide_attribute_catmull_rom(), blender::geometry::subdivide_attribute_linear(), blender::geometry::subdivide_curves(), blender::draw::test_draw_curves_interpolate_attributes(), and blender::draw::test_draw_curves_interpolate_position().
| IndexMask blender::bke::curves::point_to_curve_selection | ( | OffsetIndices< int > | points_by_curve, |
| const IndexMask & | point_mask, | ||
| LinearAllocator<> & | memory ) |
Create a mask for all curves that have at least one point in the point mask.
Definition at line 18 of file curves_utils.cc.
References blender::IndexMask::from_predicate(), blender::offset_indices::OffsetIndices< T >::index_range(), point_to_curve_selection(), blender::index_mask::IndexMask::to_bits(), and blender::offset_indices::OffsetIndices< T >::total_size().
Referenced by blender::ed::greasepencil::apply_mask_as_segment_selection(), point_to_curve_selection(), and blender::bke::greasepencil::selected_mask_to_fills().
|
static |
Definition at line 95 of file curves_attributes.cc.
References blender::BLI_assert(), blender::VArray< T >::from_single(), blender::Span< T >::is_empty(), blender::bke::Point, reader_for_vertex_group_index(), and blender::bke::varray_for_deform_verts().
Referenced by foreach_vertex_group(), reader_for_vertex_group_index(), and try_get_vertex_group().
|
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().
|
static |
Definition at line 29 of file curves_attributes.cc.
References tag_curve_types_changed().
Referenced by changed_tags(), and tag_curve_types_changed().
|
static |
Definition at line 54 of file curves_attributes.cc.
References tag_material_index_changed().
Referenced by changed_tags(), and tag_material_index_changed().
|
static |
Definition at line 48 of file curves_attributes.cc.
References tag_normals_changed().
Referenced by changed_tags(), and tag_normals_changed().
|
static |
Definition at line 36 of file curves_attributes.cc.
References tag_positions_changed().
Referenced by changed_tags(), and tag_positions_changed().
|
static |
Definition at line 42 of file curves_attributes.cc.
References tag_radii_changed().
Referenced by changed_tags(), and tag_radii_changed().
|
static |
Definition at line 23 of file curves_attributes.cc.
References tag_topology_changed().
Referenced by changed_tags(), and tag_topology_changed().
|
static |
Definition at line 106 of file curves_attributes.cc.
References blender::BKE_defgroup_name_index(), reader_for_vertex_group_index(), and try_get_vertex_group().
Referenced by get_curves_accessor_functions(), and try_get_vertex_group().
|
static |
Definition at line 120 of file curves_attributes.cc.
References blender::BKE_defgroup_name_index(), blender::bke::Point, try_get_vertex_group_for_write(), and blender::bke::varray_for_mutable_deform_verts().
Referenced by get_curves_accessor_functions(), and try_get_vertex_group_for_write().