|
Blender V4.5
|
Namespaces | |
| namespace | nurbs |
| namespace | poly |
| namespace | bezier |
| namespace | catmull_rom |
Classes | |
| struct | CurveSegment |
| struct | CurvePoint |
| class | IndexRangeCyclic |
| class | CurvesVertexGroupsAttributeProvider |
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, IndexMaskMemory &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, IndexMaskMemory &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, const OffsetIndices< int > points_by_curve, SelectedCallback selected_fn) |
| void | foreach_selected_point_ranges_per_curve (const IndexMask &mask, const OffsetIndices< int > points_by_curve, SelectedCallback selected_fn, UnselectedCallback unselected_fn) |
Definition at line 511 of file BKE_curves_utils.hh.
| using blender::bke::curves::UnselectedCallback = FunctionRef<void(IndexRange curves, IndexRange unselected_points)> |
Definition at line 513 of file BKE_curves_utils.hh.
| 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 40 of file curves_utils.cc.
References CD_MASK_ALL, CurvesGeometry::curve_data, blender::bke::CurvesGeometry::curves_num(), CustomData_init_from(), 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().
|
static |
In this function all the attribute providers for a curves component are created. Most data in this function is statically allocated, because it does not change over time.
Definition at line 158 of file curves_attributes.cc.
References BEZIER_HANDLE_ALIGN, BEZIER_HANDLE_FREE, CD_PROP_BOOL, CD_PROP_FLOAT, CD_PROP_FLOAT3, CD_PROP_INT32, CD_PROP_INT8, blender::bke::Curve, CURVE_TYPE_CATMULL_ROM, CURVE_TYPES_NUM, blender::bke::BuiltinAttributeProvider::Deletable, blender::bke::BuiltinAttributeProvider::NonDeletable, NORMAL_MODE_FREE, NORMAL_MODE_MINIMUM_TWIST, NURBS_KNOT_MODE_ENDPOINT_BEZIER, NURBS_KNOT_MODE_NORMAL, blender::bke::Point, tag_component_curve_types_changed(), tag_component_material_index_changed(), tag_component_normals_changed(), tag_component_positions_changed(), tag_component_radii_changed(), and tag_component_topology_changed().
Referenced by get_curves_accessor_functions().
| 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(), and blender::ed::transform::curves::createTransCurvesVerts().
Definition at line 572 of file BKE_curves.hh.
References v.
Definition at line 566 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 478 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 27 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 67 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, |
| const 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 147 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, |
| const 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 154 of file curves_utils.cc.
References foreach_selected_point_ranges_per_curve_(), and mask().
|
static |
Definition at line 101 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().
| const AttributeAccessorFunctions & blender::bke::curves::get_attribute_accessor_functions | ( | ) |
Definition at line 421 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 386 of file curves_attributes.cc.
References blender::bke::attribute_accessor_functions::accessor_functions_for_providers(), create_attribute_providers_for_curve(), blender::bke::Curve, ELEM, and blender::bke::Point.
Referenced by get_attribute_accessor_functions().
|
static |
Definition at line 88 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 49 of file curves_utils.cc.
References blender::IndexMask::from_predicate(), and types.
Referenced by blender::ed::transform::curves::createTransCurvesVerts(), blender::ed::transform::greasepencil::createTransGreasePencilVerts(), blender::draw::DRW_curves_batch_cache_create_requested(), foreach_curve_by_type(), and blender::bke::CurvesGeometry::indices_for_curve_type().
|
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 583 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(), and blender::geometry::subdivide_curves().
|
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 560 of file BKE_curves.hh.
References BLI_assert.
Referenced by blender::bke::curves::nurbs::calculate_basis_cache(), blender::bke::curves::catmull_rom::calculate_evaluated_num(), blender::bke::curves::nurbs::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 24 of file curves_attributes.cc.
Referenced by create_attribute_providers_for_curve().
|
static |
Definition at line 49 of file curves_attributes.cc.
Referenced by create_attribute_providers_for_curve().
|
static |
Definition at line 43 of file curves_attributes.cc.
Referenced by create_attribute_providers_for_curve().
|
static |
Definition at line 31 of file curves_attributes.cc.
Referenced by create_attribute_providers_for_curve().
|
static |
Definition at line 37 of file curves_attributes.cc.
Referenced by create_attribute_providers_for_curve().
|
static |
Definition at line 18 of file curves_attributes.cc.
Referenced by create_attribute_providers_for_curve().