|
Blender V5.0
|
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 attribute_id) |
| static GAttributeWriter | try_get_vertex_group_for_write (void *owner, const StringRef attribute_id) |
| static bool | try_delete_vertex_group (void *owner, const StringRef name) |
| static bool | foreach_vertex_group (const void *owner, FunctionRef< void(const AttributeIter &)> fn) |
| static const auto & | builtin_attributes () |
| 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) |
Definition at line 515 of file BKE_curves_utils.hh.
| using blender::bke::curves::UnselectedCallback = FunctionRef<void(IndexRange curves, IndexRange unselected_points)> |
Definition at line 517 of file BKE_curves_utils.hh.
|
static |
Definition at line 180 of file curves_attributes.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_new(), BEZIER_HANDLE_ALIGN, BEZIER_HANDLE_FREE, blender::bke::Bool, blender::bke::Curve, CURVE_TYPE_CATMULL_ROM, CURVE_TYPES_NUM, blender::bke::AttrBuiltinInfo::default_value, blender::bke::AttrBuiltinInfo::deletable, blender::bke::Float, blender::bke::Float3, blender::bke::Int32, blender::bke::Int8, NORMAL_MODE_FREE, NORMAL_MODE_MINIMUM_TWIST, NURBS_KNOT_MODE_ENDPOINT_BEZIER, NURBS_KNOT_MODE_NORMAL, blender::bke::Point, and blender::bke::AttrBuiltinInfo::validator.
Referenced by get_curves_accessor_functions().
|
static |
Definition at line 57 of file curves_attributes.cc.
References tag_curve_types_changed(), tag_material_index_changed(), tag_normals_changed(), tag_positions_changed(), tag_radii_changed(), and tag_topology_changed().
Referenced by 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 53 of file curves_utils.cc.
References blender::bke::CurvesGeometry::attributes(), blender::bke::CurvesGeometry::attributes_for_write(), blender::bke::copy_attributes(), blender::bke::Curve, blender::bke::CurvesGeometry::curves_num(), and CurvesGeometry::runtime.
Referenced by blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::convert_curves_to_nurbs(), 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, | ||
| IndexMaskMemory & | memory ) |
Definition at line 16 of file curves_utils.cc.
References blender::index_mask::IndexMask::foreach_index(), blender::IndexMask::from_initializers(), pos, and blender::index_mask::IndexMask::size().
Referenced by blender::bke::copy_point_selection_custom_knots(), blender::ed::transform::curves::createTransCurvesVerts(), and curve_type_point_selection().
| IndexMask blender::bke::curves::curve_type_point_selection | ( | const bke::CurvesGeometry & | curves, |
| CurveType | curve_type, | ||
| IndexMaskMemory & | memory ) |
Definition at line 27 of file curves_utils.cc.
References curve_to_point_selection(), and indices_for_type().
Referenced by blender::ed::greasepencil::grease_pencil_reproject_exec(), blender::ed::greasepencil::grease_pencil_snap_to_grid_exec(), init_curves_point_selection_status(), blender::ed::curves::retrieve_all_selected_points(), and blender::ed::curves::transverts_from_curves_positions_create().
Definition at line 577 of file BKE_curves.hh.
References v.
Definition at line 571 of file BKE_curves.hh.
References BLI_assert, and v.
| 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 482 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 40 of file curves_utils.cc.
References BLI_assert, blender::GMutableSpan::data(), blender::CPPType::fill_assign_n(), blender::index_mask::IndexMask::foreach_index(), blender::GPointer::get(), i, 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(), 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 83 of file curves_utils.cc.
References CURVE_TYPE_BEZIER, CURVE_TYPE_CATMULL_ROM, CURVE_TYPE_NURBS, CURVE_TYPE_POLY, indices_for_type(), mask(), and types.
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(), 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 163 of file curves_utils.cc.
References foreach_selected_point_ranges_per_curve_(), and mask().
Referenced by blender::ed::curves::calc_curves_extrusion(), blender::bke::copy_point_selection_custom_knots(), blender::ed::curves::duplicate_points(), 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 170 of file curves_utils.cc.
References foreach_selected_point_ranges_per_curve_(), and mask().
|
static |
Definition at line 117 of file curves_utils.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::Vector< T, InlineBufferCapacity, Allocator >::clear(), blender::offset_indices::OffsetIndices< T >::data(), blender::IndexRange::from_begin_end_inclusive(), if_has_data_call_callback(), mask(), and blender::offset_indices::OffsetIndices< T >::size().
Referenced by foreach_selected_point_ranges_per_curve(), and foreach_selected_point_ranges_per_curve().
|
static |
Definition at line 156 of file curves_attributes.cc.
References blender::bke::AttributeIter::accessor, blender::bke::Float, blender::bke::AttributeIter::is_builtin, blender::bke::AttributeIter::is_stopped(), LISTBASE_FOREACH_INDEX, blender::bke::Point, and reader_for_vertex_group_index().
Referenced by get_curves_accessor_functions().
| const AttributeAccessorFunctions & blender::bke::curves::get_attribute_accessor_functions | ( | ) |
Definition at line 434 of file curves_attributes.cc.
References get_curves_accessor_functions().
Referenced by blender::bke::CurveComponent::attributes(), blender::bke::CurvesGeometry::attributes(), blender::bke::CurveComponent::attributes_for_write(), and blender::bke::CurvesGeometry::attributes_for_write().
|
static |
Definition at line 296 of file curves_attributes.cc.
References blender::bke::AttributeIter::accessor, blender::bke::AttributeStorage::add(), blender::bke::attribute_init_to_data(), blender::bke::attribute_to_reader(), blender::bke::attribute_to_writer(), builtin_attributes(), changed_tags(), blender::bke::AttributeInit::Construct, blender::bke::Curve, blender::bke::Attribute::data_type(), blender::bke::AttrBuiltinInfo::default_value, blender::bke::AttrBuiltinInfo::domain, blender::bke::Attribute::domain(), ELEM, foreach_vertex_group(), blender::bke::AttributeStorage::foreach_with_stop(), get_domain_size(), blender::bke::AttributeIter::is_builtin, blender::bke::AttributeIter::is_stopped(), blender::bke::AttributeStorage::lookup(), blender::bke::Attribute::name(), name, blender::bke::Point, blender::bke::AttributeStorage::remove(), 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().
|
static |
Definition at line 79 of file curves_attributes.cc.
References blender::bke::Curve, and blender::bke::Point.
Referenced by get_curves_accessor_functions().
|
static |
Definition at line 104 of file curves_utils.cc.
References begin(), and blender::IndexRange::from_begin_end().
Referenced by foreach_selected_point_ranges_per_curve_().
| 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, | ||
| IndexMaskMemory & | memory ) |
Definition at line 65 of file curves_utils.cc.
References blender::IndexMask::from_predicate(), and types.
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::bke::CurvesGeometry::indices_for_curve_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 588 of file BKE_curves.hh.
References 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(), 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().
|
static |
Definition at line 92 of file curves_attributes.cc.
References BLI_assert, blender::VArray< T >::from_single(), blender::Span< T >::is_empty(), blender::bke::Point, and blender::bke::varray_for_deform_verts().
Referenced by foreach_vertex_group(), 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 565 of file BKE_curves.hh.
References BLI_assert.
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(), and blender::bke::segments_num_no_duplicate_edge().
|
static |
Definition at line 26 of file curves_attributes.cc.
Referenced by changed_tags().
|
static |
Definition at line 51 of file curves_attributes.cc.
Referenced by changed_tags().
|
static |
Definition at line 45 of file curves_attributes.cc.
Referenced by changed_tags().
|
static |
Definition at line 33 of file curves_attributes.cc.
Referenced by changed_tags().
|
static |
Definition at line 39 of file curves_attributes.cc.
Referenced by changed_tags().
|
static |
Definition at line 20 of file curves_attributes.cc.
Referenced by changed_tags().
|
static |
Definition at line 133 of file curves_attributes.cc.
References BKE_defgroup_listbase_name_find(), BLI_remlink(), MEM_freeN(), name, and blender::bke::remove_defgroup_index().
Referenced by get_curves_accessor_functions().
|
static |
Definition at line 103 of file curves_attributes.cc.
References BKE_defgroup_name_index(), and reader_for_vertex_group_index().
Referenced by get_curves_accessor_functions().
|
static |
Definition at line 118 of file curves_attributes.cc.
References BKE_defgroup_name_index(), blender::bke::Point, and blender::bke::varray_for_mutable_deform_verts().
Referenced by get_curves_accessor_functions().