|
Blender V4.5
|
#include <BKE_curves.hh>
Inherits CurvesGeometry.
Classes | |
| struct | BlendWriteData |
#CurvesGeometry Inline Methods | |
| int | points_num () const |
| int | curves_num () const |
| bool | is_empty () const |
| IndexRange | points_range () const |
| IndexRange | curves_range () const |
| OffsetIndices< int > | points_by_curve () const |
| bool | has_curve_with_type (CurveType type) const |
| bool | has_curve_with_type (Span< CurveType > types) const |
| bool | is_single_type (CurveType type) const |
| const std::array< int, CURVE_TYPES_NUM > & | curve_type_counts () const |
| bool | nurbs_has_custom_knots () const |
| int | evaluated_points_num () const |
| Span< int > | bezier_evaluated_offsets_for_curve (int curve_index) const |
| Span< float > | evaluated_lengths_for_curve (int curve_index, bool cyclic) const |
| float | evaluated_length_total_for_curve (int curve_index, bool cyclic) const |
Evaluation | |
| IndexMask | indices_for_curve_type (CurveType type, IndexMaskMemory &memory) const |
| IndexMask | indices_for_curve_type (CurveType type, const IndexMask &selection, IndexMaskMemory &memory) const |
| Array< int > | point_to_curve_map () const |
| OffsetIndices< int > | evaluated_points_by_curve () const |
| Span< float3float3 > | evaluated_positions () const |
| Span< float3float3 > | evaluated_tangents () const |
| Span< float3float3 > | evaluated_normals () const |
| void | ensure_evaluated_lengths () const |
| void | ensure_can_interpolate_to_evaluated () const |
| void | interpolate_to_evaluated (int curve_index, GSpan src, GMutableSpan dst) const |
| void | interpolate_to_evaluated (GSpan src, GMutableSpan dst) const |
Additional Inherited Members | |
| Public Attributes inherited from CurvesGeometry | |
| int * | curve_offsets |
| struct AttributeStorage | attribute_storage |
| CustomData | point_data |
| CustomData | curve_data |
| int | point_num |
| int | curve_num |
| ListBase | vertex_group_names |
| int | vertex_group_active_index |
| int | attributes_active_index |
| CurvesGeometryRuntimeHandle * | runtime |
| float * | custom_knots |
| int | custom_knot_num |
| char | _pad [4] |
A C++ class that wraps the DNA struct for better encapsulation and ease of use. It inherits directly from the struct rather than storing a pointer to avoid more complicated ownership handling.
Definition at line 152 of file BKE_curves.hh.
| CurvesGeometry::CurvesGeometry | ( | ) |
Definition at line 62 of file curves_geometry.cc.
| CurvesGeometry::CurvesGeometry | ( | int | point_num, |
| int | curve_num ) |
Create curves with the given size. Only the position attribute is created, along with the offsets.
Definition at line 64 of file curves_geometry.cc.
| CurvesGeometry::CurvesGeometry | ( | const CurvesGeometry & | other | ) |
Definition at line 100 of file curves_geometry.cc.
| CurvesGeometry::CurvesGeometry | ( | CurvesGeometry && | other | ) |
Definition at line 160 of file curves_geometry.cc.
| CurvesGeometry::~CurvesGeometry | ( | ) |
Definition at line 209 of file curves_geometry.cc.
| GVArray CurvesGeometry::adapt_domain | ( | const GVArray & | varray, |
| AttrDomain | from, | ||
| AttrDomain | to ) const |
Definition at line 1815 of file curves_geometry.cc.
|
inline |
Definition at line 486 of file BKE_curves.hh.
| AttributeAccessor CurvesGeometry::attributes | ( | ) | const |
Definition at line 1845 of file curves_geometry.cc.
| MutableAttributeAccessor CurvesGeometry::attributes_for_write | ( | ) |
Definition at line 1850 of file curves_geometry.cc.
|
inline |
Retrieve offsets into a Bezier curve's evaluated points for each control point. Stored in the same format as OffsetIndices. Call evaluated_points_by_curve() first to ensure that the evaluated offsets cache is current.
Definition at line 1033 of file BKE_curves.hh.
| void CurvesGeometry::blend_read | ( | BlendDataReader & | reader | ) |
Definition at line 1861 of file curves_geometry.cc.
| void CurvesGeometry::blend_write | ( | BlendWriter & | writer, |
| ID & | id, | ||
| const BlendWriteData & | write_data ) |
Definition at line 1928 of file curves_geometry.cc.
| void CurvesGeometry::blend_write_prepare | ( | BlendWriteData & | write_data | ) |
This function needs to be called before blend_write and before the CurvesGeometry struct is written because it can mutate the CustomData and AttributeStorage structs.
Definition at line 1902 of file curves_geometry.cc.
| std::optional< Bounds< float3float3 > > CurvesGeometry::bounds_min_max | ( | bool | use_radius = true | ) | const |
The largest and smallest position values of evaluated points.
Definition at line 1316 of file curves_geometry.cc.
| void CurvesGeometry::calculate_bezier_auto_handles | ( | ) |
Definition at line 1243 of file curves_geometry.cc.
| void CurvesGeometry::count_memory | ( | MemoryCounter & | memory | ) | const |
Definition at line 1363 of file curves_geometry.cc.
|
inline |
Return the number of curves with each type.
Definition at line 1007 of file BKE_curves.hh.
| VArray< int8_t > CurvesGeometry::curve_types | ( | ) | const |
The type (CurveType) of each curve, or potentially a single if all are the same type.
Definition at line 303 of file curves_geometry.cc.
| MutableSpan< int8_t > CurvesGeometry::curve_types_for_write | ( | ) |
Mutable access to curve types. Call tag_topology_changed and update_curve_types after changing any type. Consider using the other methods to change types below.
Definition at line 309 of file curves_geometry.cc.
|
inline |
The number of curves in the data-block.
Definition at line 968 of file BKE_curves.hh.
|
inline |
Definition at line 986 of file BKE_curves.hh.
| VArray< bool > CurvesGeometry::cyclic | ( | ) | const |
Whether the curve loops around to connect to itself, on the curve domain.
Definition at line 419 of file curves_geometry.cc.
| MutableSpan< bool > CurvesGeometry::cyclic_for_write | ( | ) |
Mutable access to curve cyclic values. Call tag_topology_changed after changes.
Definition at line 423 of file curves_geometry.cc.
| Span< MDeformVert > CurvesGeometry::deform_verts | ( | ) | const |
Vertex group data, encoded as an array of indices and weights for every vertex.
Definition at line 605 of file curves_geometry.cc.
| MutableSpan< MDeformVert > CurvesGeometry::deform_verts_for_write | ( | ) |
Definition at line 615 of file curves_geometry.cc.
| void CurvesGeometry::ensure_can_interpolate_to_evaluated | ( | ) | const |
Definition at line 1159 of file curves_geometry.cc.
| void CurvesGeometry::ensure_evaluated_lengths | ( | ) | const |
Calculates the data described by evaluated_lengths_for_curve if necessary.
Definition at line 1132 of file curves_geometry.cc.
|
inline |
Definition at line 1058 of file BKE_curves.hh.
|
inline |
Return a cache of accumulated lengths along the curve. Each item is the length of the subsequent segment (the first value is the length of the first segment rather than 0). This calculation is rather trivial, and only depends on the evaluated positions, but the results are used often, and it is necessarily single threaded per curve, so it is cached.
| cyclic | This argument is redundant with the data stored for the curve, but is passed for performance reasons to avoid looking up the attribute. |
Definition at line 1051 of file BKE_curves.hh.
Definition at line 991 of file curves_geometry.cc.
| OffsetIndices< int > CurvesGeometry::evaluated_points_by_curve | ( | ) | const |
The offsets of every curve's evaluated points.
Definition at line 691 of file curves_geometry.cc.
|
inline |
The total number of points in the evaluated poly curve. This can depend on the resolution attribute if it exists.
Definition at line 1027 of file BKE_curves.hh.
Definition at line 793 of file curves_geometry.cc.
Definition at line 872 of file curves_geometry.cc.
Set the types for the curves in the selection and call update_curve_types.
Definition at line 329 of file curves_geometry.cc.
| void CurvesGeometry::fill_curve_types | ( | CurveType | type | ) |
Set all curve types to the value and call update_curve_types.
Definition at line 314 of file curves_geometry.cc.
The positions of Bezier curve handles. Though these are really control points for the Bezier segments, they are stored in separate arrays to better reflect user expectations. Note that values may be generated automatically based on the handle types. Call tag_positions_changed after changes.
Definition at line 473 of file curves_geometry.cc.
| MutableSpan< float3float3 > CurvesGeometry::handle_positions_left_for_write | ( | ) |
Definition at line 477 of file curves_geometry.cc.
Definition at line 482 of file curves_geometry.cc.
| MutableSpan< float3float3 > CurvesGeometry::handle_positions_right_for_write | ( | ) |
Definition at line 486 of file curves_geometry.cc.
| VArray< int8_t > CurvesGeometry::handle_types_left | ( | ) | const |
Handle types for Bezier control points. Call tag_topology_changed after changes.
Definition at line 455 of file curves_geometry.cc.
| MutableSpan< int8_t > CurvesGeometry::handle_types_left_for_write | ( | ) |
Definition at line 459 of file curves_geometry.cc.
| VArray< int8_t > CurvesGeometry::handle_types_right | ( | ) | const |
Definition at line 464 of file curves_geometry.cc.
| MutableSpan< int8_t > CurvesGeometry::handle_types_right_for_write | ( | ) |
Definition at line 468 of file curves_geometry.cc.
|
inline |
Definition at line 996 of file BKE_curves.hh.
Definition at line 1001 of file BKE_curves.hh.
| IndexMask CurvesGeometry::indices_for_curve_type | ( | CurveType | type, |
| const IndexMask & | selection, | ||
| IndexMaskMemory & | memory ) const |
Definition at line 726 of file curves_geometry.cc.
| IndexMask CurvesGeometry::indices_for_curve_type | ( | CurveType | type, |
| IndexMaskMemory & | memory ) const |
All of the curve indices for curves with a specific type.
Definition at line 720 of file curves_geometry.cc.
| void CurvesGeometry::interpolate_to_evaluated | ( | GSpan | src, |
| GMutableSpan | dst ) const |
Evaluate generic data for curve control points to the standard evaluated points of the curves.
Definition at line 1106 of file curves_geometry.cc.
| void CurvesGeometry::interpolate_to_evaluated | ( | int | curve_index, |
| GSpan | src, | ||
| GMutableSpan | dst ) const |
Evaluate a generic data to the standard evaluated points of a specific curve, defined by the resolution attribute or other factors, depending on the curve type.
Definition at line 1086 of file curves_geometry.cc.
|
inline |
Return true if there are no curves in the geometry.
Definition at line 976 of file BKE_curves.hh.
|
inline |
Return true if all of the curves have the provided type.
Definition at line 991 of file BKE_curves.hh.
| std::optional< int > CurvesGeometry::material_index_max | ( | ) | const |
Get the largest material index used by the geometry or nullopt if there are none. The returned value is clamped between 0 and MAXMAT even if the stored material indices may be out of that range.
Definition at line 1349 of file curves_geometry.cc.
| VArray< int8_t > CurvesGeometry::normal_mode | ( | ) | const |
Which method to use for calculating the normals of evaluated points (NormalMode). Call tag_normals_changed after changes.
Definition at line 437 of file curves_geometry.cc.
| MutableSpan< int8_t > CurvesGeometry::normal_mode_for_write | ( | ) |
Definition at line 441 of file curves_geometry.cc.
| IndexMask CurvesGeometry::nurbs_custom_knot_curves | ( | IndexMaskMemory & | memory | ) | const |
Builds mask of NURBS curves with knot mode NURBS_KNOT_MODE_CUSTOM.
Definition at line 546 of file curves_geometry.cc.
| Span< float > CurvesGeometry::nurbs_custom_knots | ( | ) | const |
Custom knots for NURBS curves with knots mode NURBS_KNOT_MODE_CUSTOM.
Definition at line 528 of file curves_geometry.cc.
| OffsetIndices< int > CurvesGeometry::nurbs_custom_knots_by_curve | ( | ) | const |
The offsets of every curve into arrays on #CurvesGeometry::nurbs_custom_knots. Curves with knot mode other than NURBS_KNOT_MODE_CUSTOM will have zero sized IndexRange.
Definition at line 557 of file curves_geometry.cc.
| MutableSpan< float > CurvesGeometry::nurbs_custom_knots_for_write | ( | ) |
Definition at line 536 of file curves_geometry.cc.
| void CurvesGeometry::nurbs_custom_knots_resize | ( | int | knots_num | ) |
Resizes custom knots array. Used when knots number is known in advance and knot values are set together with topological data.
Definition at line 595 of file curves_geometry.cc.
| void CurvesGeometry::nurbs_custom_knots_update_size | ( | ) |
Resizes custom knots array depending on topological data. Depends on curve offsets, knot modes, orders and cyclic data. Used to resize internal knots array before writing knots.
Definition at line 581 of file curves_geometry.cc.
|
inline |
Definition at line 972 of file BKE_curves.hh.
| VArray< int8_t > CurvesGeometry::nurbs_knots_modes | ( | ) | const |
The automatic generation mode for each NURBS curve's knots vector, on the curve domain. Call tag_topology_changed after changes.
Definition at line 509 of file curves_geometry.cc.
| MutableSpan< int8_t > CurvesGeometry::nurbs_knots_modes_for_write | ( | ) |
Definition at line 513 of file curves_geometry.cc.
| VArray< int8_t > CurvesGeometry::nurbs_orders | ( | ) | const |
The order (degree plus one) of each NURBS curve, on the curve domain. Call tag_topology_changed after changes.
Definition at line 491 of file curves_geometry.cc.
| MutableSpan< int8_t > CurvesGeometry::nurbs_orders_for_write | ( | ) |
Definition at line 495 of file curves_geometry.cc.
| Span< float > CurvesGeometry::nurbs_weights | ( | ) | const |
The weight for each control point for NURBS curves. Call tag_positions_changed after changes.
Definition at line 500 of file curves_geometry.cc.
| MutableSpan< float > CurvesGeometry::nurbs_weights_for_write | ( | ) |
Definition at line 504 of file curves_geometry.cc.
| Span< int > CurvesGeometry::offsets | ( | ) | const |
The index of the first point in every curve. The size of this span is one larger than the number of curves, but the spans will be empty if there are no curves/points.
Consider using points_by_curve rather than these offsets directly.
Definition at line 402 of file curves_geometry.cc.
| MutableSpan< int > CurvesGeometry::offsets_for_write | ( | ) |
Definition at line 409 of file curves_geometry.cc.
| CurvesGeometry & CurvesGeometry::operator= | ( | const CurvesGeometry & | other | ) |
Definition at line 150 of file curves_geometry.cc.
| CurvesGeometry & CurvesGeometry::operator= | ( | CurvesGeometry && | other | ) |
Definition at line 199 of file curves_geometry.cc.
| Array< int > CurvesGeometry::point_to_curve_map | ( | ) | const |
Definition at line 734 of file curves_geometry.cc.
|
inline |
The offsets of every curve into arrays on the points domain.
Definition at line 1021 of file BKE_curves.hh.
|
inline |
The total number of control points in all curves.
Definition at line 964 of file BKE_curves.hh.
|
inline |
Definition at line 982 of file BKE_curves.hh.
Definition at line 384 of file curves_geometry.cc.
| MutableSpan< float3float3 > CurvesGeometry::positions_for_write | ( | ) |
Definition at line 388 of file curves_geometry.cc.
| VArray< float > CurvesGeometry::radius | ( | ) | const |
Definition at line 393 of file curves_geometry.cc.
| MutableSpan< float > CurvesGeometry::radius_for_write | ( | ) |
Definition at line 397 of file curves_geometry.cc.
| void CurvesGeometry::remove_attributes_based_on_types | ( | ) |
Remove any attributes that are unused based on the types in the curves.
Definition at line 1687 of file curves_geometry.cc.
| void CurvesGeometry::remove_curves | ( | const IndexMask & | curves_to_delete, |
| const AttributeFilter & | attribute_filter ) |
Definition at line 1566 of file curves_geometry.cc.
| void CurvesGeometry::remove_points | ( | const IndexMask & | points_to_delete, |
| const AttributeFilter & | attribute_filter ) |
Definition at line 1486 of file curves_geometry.cc.
| void CurvesGeometry::resize | ( | int | points_num, |
| int | curves_num ) |
Change the number of curves and/or points.
Definition at line 1171 of file curves_geometry.cc.
| VArray< int > CurvesGeometry::resolution | ( | ) | const |
How many evaluated points to create for each segment when evaluating Bezier, Catmull Rom, and NURBS curves. On the curve domain. Values must be one or greater.
Definition at line 428 of file curves_geometry.cc.
| MutableSpan< int > CurvesGeometry::resolution_for_write | ( | ) |
Mutable access to curve resolution. Call tag_topology_changed after changes.
Definition at line 432 of file curves_geometry.cc.
| void CurvesGeometry::reverse_curves | ( | const IndexMask & | curves_to_reverse | ) |
Change the direction of selected curves (switch the start and end) without changing their shape.
Definition at line 1624 of file curves_geometry.cc.
UV coordinate for each curve that encodes where the curve is attached to the surface mesh.
Definition at line 518 of file curves_geometry.cc.
| MutableSpan< float2float2 > CurvesGeometry::surface_uv_coords_for_write | ( | ) |
Definition at line 523 of file curves_geometry.cc.
| void CurvesGeometry::tag_material_index_changed | ( | ) |
Call after changing the "material_index" attribute.
Definition at line 1220 of file curves_geometry.cc.
| void CurvesGeometry::tag_normals_changed | ( | ) |
Call after changing the "tilt" or "up" attributes.
Definition at line 1212 of file curves_geometry.cc.
| void CurvesGeometry::tag_positions_changed | ( | ) |
Call after deforming the position attribute.
Definition at line 1194 of file curves_geometry.cc.
| void CurvesGeometry::tag_radii_changed | ( | ) |
Call when making manual changes to the "radius" attribute. The attribute API will also call this in #finish() calls.
Definition at line 1216 of file curves_geometry.cc.
| void CurvesGeometry::tag_topology_changed | ( | ) |
Call after any operation that changes the topology (number of points, evaluated points, or the total count).
Definition at line 1203 of file curves_geometry.cc.
| VArray< float > CurvesGeometry::tilt | ( | ) | const |
The angle used to rotate evaluated normals around the tangents after their calculation. Call tag_normals_changed after changes.
Definition at line 446 of file curves_geometry.cc.
| MutableSpan< float > CurvesGeometry::tilt_for_write | ( | ) |
Definition at line 450 of file curves_geometry.cc.
| void CurvesGeometry::transform | ( | const float4x4 & | matrix | ) |
Definition at line 1302 of file curves_geometry.cc.
Definition at line 1275 of file curves_geometry.cc.
| void CurvesGeometry::update_curve_types | ( | ) |
Update the cached count of curves of each type, necessary after curve_types_for_write.
Definition at line 379 of file curves_geometry.cc.