Blender V5.0
blender::ed::curves Namespace Reference

Namespaces

namespace  convert_to_particle_system
namespace  convert_from_particle_system
namespace  snap_curves_to_surface
namespace  set_selection_domain
namespace  split
namespace  surface_set
namespace  curves_delete
namespace  curves_duplicate
namespace  clear_tilt
namespace  cyclic_toggle
namespace  curve_type_set
namespace  switch_direction
namespace  subdivide
namespace  add_circle
namespace  add_bezier
namespace  set_handle_type
namespace  pen_tool
namespace  undo
namespace  tests

Classes

struct  StrokeElem
struct  CurveDrawData
struct  ClosestCurveDataBlock
struct  FindClosestData
class  CurvesGeometry

Typedefs

using SelectionRangeFn

Functions

static bool has_surface_deformation_node (const bNodeTree &ntree)
static bool has_surface_deformation_node (const Object &curves_ob)
void ensure_surface_deformation_node_exists (bContext &C, Object &curves_ob)
bke::CurvesGeometry primitive_random_sphere (const int curves_size, const int points_per_curve)
static bool active_attribute_poll (bContext *C)
static IndexMask retrieve_selected_elements (const Curves &curves_id, const bke::AttrDomain domain, IndexMaskMemory &memory)
static void validate_value (const bke::AttributeAccessor attributes, const StringRef name, const CPPType &type, void *buffer)
static wmOperatorStatus set_attribute_exec (bContext *C, wmOperator *op)
static wmOperatorStatus set_attribute_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static void set_attribute_ui (bContext *C, wmOperator *op)
Vector< MutableSpan< float3 > > get_curves_positions_for_write (bke::CurvesGeometry &curves)
Vector< Span< float3 > > get_curves_positions (const bke::CurvesGeometry &curves)
void transverts_from_curves_positions_create (bke::CurvesGeometry &curves, TransVertStore *tvs, const bool skip_handles)
float(* point_normals_array_create (const Curves *curves_id))[3]
static void curve_draw_stroke_3d (const bContext *, ARegion *, void *arg)
static void curve_draw_event_add (wmOperator *op, const wmEvent *event)
static void curve_draw_event_add_first (wmOperator *op, const wmEvent *event)
static void curve_draw_exit (wmOperator *op)
static bool curve_draw_init (bContext *C, wmOperator *op, bool is_invoke)
static void create_Bezier (bke::CurvesGeometry &curves, bke::MutableAttributeAccessor &attributes, const CurveDrawData *cdd, const int curve_index, const bool is_cyclic, const uint cubic_spline_len, const int dims, const int radius_index, const float radius_max, const float *cubic_spline, const uint *corners_index, const uint corners_index_len)
static void create_NURBS (bke::CurvesGeometry &curves, bke::MutableAttributeAccessor &attributes, const CurveDrawData *cdd, const int curve_index, const bool is_cyclic, const uint cubic_spline_len, const int dims, const int radius_index, const float radius_max, const float *cubic_spline)
static wmOperatorStatus curves_draw_exec (bContext *C, wmOperator *op)
static wmOperatorStatus curves_draw_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static void curve_draw_cancel (bContext *, wmOperator *op)
static void curve_draw_exec_precalc (wmOperator *op)
static wmOperatorStatus curves_draw_modal (bContext *C, wmOperator *op, const wmEvent *event)
static void curve_offsets_from_selection (const Span< IndexRange > selected_points, const IndexRange points, const int curve, const bool cyclic, Vector< int > &r_new_curve_offsets, Vector< bool > &r_new_cyclic, Vector< IndexRange > &r_src_ranges, Vector< int > &r_dst_offsets, Vector< int > &r_dst_to_src_curve)
static void append_point_knots (const Span< IndexRange > src_ranges, const OffsetIndices< int > dst_offsets, const Span< int > dst_to_src_curve, const bke::CurvesGeometry &src_curves, bke::CurvesGeometry &curves)
static void append_curve_knots (const IndexMask &mask, bke::CurvesGeometry &curves)
static void invert_ranges (const IndexRange universe, const Span< IndexRange > ranges, Array< IndexRange > &inverted)
static IndexRange extend_range (const IndexRange range, const IndexRange universe)
static void extend_range_by_1_within_bounds (const IndexRange universe, const bool cyclic, const Span< IndexRange > ranges, Vector< IndexRange > &extended_ranges)
static bke::CurvesGeometry copy_data_to_geometry (const bke::CurvesGeometry &src_curves, const Span< int > dst_to_src_curve, const Span< int > offsets, const Span< bool > cyclic, const Span< IndexRange > src_ranges, const OffsetIndices< int > dst_offsets)
static Span< int > compress_intervals (const OffsetIndices< int > intervals_by_curve, MutableSpan< int > intervals)
static void calc_curves_extrusion (const IndexMask &selection, const OffsetIndices< int > points_by_curve, MutableSpan< int > copy_intervals, MutableSpan< int > curves_intervals_offsets, MutableSpan< bool > is_first_selected)
static void calc_new_offsets (const Span< int > old_offsets, const Span< int > curves_intervals_offsets, MutableSpan< int > new_offsets)
static IndexRange shift_end_by (const IndexRange &range, const int n)
static float clamp_to_zero (const float value)
static void extrude_knots (const bke::CurvesGeometry &curves, const OffsetIndices< int > intervals_by_curve, const OffsetIndices< int > copy_intervals, const Span< bool > is_first_selected, bke::CurvesGeometry &dst_curves)
static bke::CurvesGeometry extrude_curves (const bke::CurvesGeometry &curves, const IndexMask &extruded_points)
static wmOperatorStatus curves_extrude_exec (bContext *C, wmOperator *)
bool object_has_editable_curves (const Main &bmain, const Object &object)
VectorSet< Curves * > get_unique_editable_curves (const bContext &C)
static bool curves_poll_impl (bContext *C, const bool check_editable, const bool check_surface, const bool check_edit_mode)
static bool editable_curves_point_domain_poll (bContext *C)
static void CURVES_OT_convert_to_particle_system (wmOperatorType *ot)
static void CURVES_OT_convert_from_particle_system (wmOperatorType *ot)
static void CURVES_OT_snap_curves_to_surface (wmOperatorType *ot)
static void CURVES_OT_set_selection_domain (wmOperatorType *ot)
static bool has_anything_selected (const Span< Curves * > curves_ids)
static wmOperatorStatus select_all_exec (bContext *C, wmOperator *op)
static void CURVES_OT_select_all (wmOperatorType *ot)
static wmOperatorStatus select_random_exec (bContext *C, wmOperator *op)
static void select_random_ui (bContext *, wmOperator *op)
static void CURVES_OT_select_random (wmOperatorType *ot)
static wmOperatorStatus select_ends_exec (bContext *C, wmOperator *op)
static void select_ends_ui (bContext *, wmOperator *op)
static void CURVES_OT_select_ends (wmOperatorType *ot)
static wmOperatorStatus select_linked_exec (bContext *C, wmOperator *)
static void CURVES_OT_select_linked (wmOperatorType *ot)
static wmOperatorStatus select_more_exec (bContext *C, wmOperator *)
static void CURVES_OT_select_more (wmOperatorType *ot)
static wmOperatorStatus select_less_exec (bContext *C, wmOperator *)
static void CURVES_OT_select_less (wmOperatorType *ot)
static void CURVES_OT_split (wmOperatorType *ot)
static void CURVES_OT_surface_set (wmOperatorType *ot)
static void CURVES_OT_delete (wmOperatorType *ot)
static void CURVES_OT_duplicate (wmOperatorType *ot)
static void CURVES_OT_tilt_clear (wmOperatorType *ot)
static void CURVES_OT_cyclic_toggle (wmOperatorType *ot)
static void CURVES_OT_curve_type_set (wmOperatorType *ot)
static void CURVES_OT_switch_direction (wmOperatorType *ot)
static void CURVES_OT_subdivide (wmOperatorType *ot)
static void append_primitive_curve (bContext *C, Curves &curves_id, CurvesGeometry new_curves, wmOperator &op)
static void CURVES_OT_add_circle (wmOperatorType *ot)
static void CURVES_OT_add_bezier (wmOperatorType *ot)
static void CURVES_OT_handle_type_set (wmOperatorType *ot)
void operatortypes_curves ()
void operatormacros_curves ()
void keymap_curves (wmKeyConfig *keyconf)
static void CURVES_OT_pen (wmOperatorType *ot)
void ED_operatortypes_curves_pen ()
void ED_curves_pentool_modal_keymap (wmKeyConfig *keyconf)
Span< StringRefget_curves_selection_attribute_names (const bke::CurvesGeometry &curves)
Span< StringRefget_curves_all_selection_attribute_names ()
Span< StringRefget_curves_bezier_selection_attribute_names (const bke::CurvesGeometry &curves)
void remove_selection_attributes (bke::MutableAttributeAccessor &attributes, Span< StringRef > selection_attribute_names)
std::optional< Span< float3 > > get_selection_attribute_positions (const bke::CurvesGeometry &curves, const bke::crazyspace::GeometryDeformation &deformation, const StringRef attribute_name)
static Vector< bke::GSpanAttributeWriterinit_selection_writers (bke::CurvesGeometry &curves, bke::AttrDomain selection_domain)
static void finish_attribute_writers (MutableSpan< bke::GSpanAttributeWriter > attribute_writers)
static bke::GSpanAttributeWriterselection_attribute_writer_by_name (MutableSpan< bke::GSpanAttributeWriter > selections, StringRef attribute_name)
static void init_selectable_foreach (const bke::CurvesGeometry &curves, const bke::crazyspace::GeometryDeformation &deformation, eHandleDisplay handle_display, Span< StringRef > &r_bezier_attribute_names, Span< float3 > &r_positions, std::optional< std::array< Span< float3 >, 2 > > &r_bezier_handle_positions, IndexMaskMemory &r_memory, IndexMask &r_bezier_curves)
void foreach_selectable_point_range (const bke::CurvesGeometry &curves, const bke::crazyspace::GeometryDeformation &deformation, eHandleDisplay handle_display, SelectionRangeFn range_consumer)
void foreach_selectable_curve_range (const bke::CurvesGeometry &curves, const bke::crazyspace::GeometryDeformation &deformation, eHandleDisplay handle_display, SelectionRangeFn range_consumer)
static void invert_selection (MutableSpan< float > selection, const IndexMask &mask)
static void invert_selection (GMutableSpan selection, const IndexMask &mask)
static void invert_selection (GMutableSpan selection)
static FindClosestData closer_elem (const FindClosestData &a, const FindClosestData &b)
static std::optional< FindClosestDatafind_closest_point_to_screen_co (const ARegion *region, const Span< float3 > positions, const float4x4 &projection, const IndexMask &points_mask, const float2 mouse_pos, const float radius, const FindClosestData &initial_closest)
static std::optional< FindClosestDatafind_closest_curve_to_screen_co (const ARegion *region, const OffsetIndices< int > points_by_curve, const Span< float3 > positions, const VArray< bool > &cyclic, const float4x4 &projection, const IndexMask &curves_mask, const float2 mouse_pos, float radius, const FindClosestData &initial_closest)
template<typename PointSelectFn, typename LineSelectFn>
IndexMask select_mask_from_predicates (const bke::CurvesGeometry &curves, const IndexMask &mask, const bke::AttrDomain selection_domain, IndexMaskMemory &memory, PointSelectFn &&point_predicate, LineSelectFn &&line_predicate)
void undosys_type_register (UndoType *ut)
static ClosestCurveDataBlock find_closest_curve (const Depsgraph &depsgraph, const ViewContext &vc, const Span< Base * > bases, const int2 &mval)
static bool select_linked_pick (bContext &C, const int2 &mval, const SelectPick_Params &params)
static wmOperatorStatus select_linked_pick_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus separate_exec (bContext *C, wmOperator *)
Operators
void CURVES_OT_attribute_set (wmOperatorType *ot)
void CURVES_OT_draw (wmOperatorType *ot)
void CURVES_OT_extrude (wmOperatorType *ot)
void CURVES_OT_select_linked_pick (wmOperatorType *ot)
void CURVES_OT_separate (wmOperatorType *ot)
Operator/Stroke Conversion
static void curve_draw_stroke_to_operator_elem (wmOperator *op, const StrokeElem *selem)
static void curve_draw_stroke_from_operator_elem (wmOperator *op, PointerRNA *itemptr)
static void curve_draw_stroke_to_operator (wmOperator *op)
static void curve_draw_stroke_from_operator (wmOperator *op)
Mask Functions
IndexMask curve_mask_from_points (const bke::CurvesGeometry &curves, const IndexMask &point_mask, const GrainSize grain_size, IndexMaskMemory &memory)
IndexMask end_points (const bke::CurvesGeometry &curves, const IndexMask &curves_mask, const int amount_start, const int amount_end, const bool inverted, IndexMaskMemory &memory)
IndexMask end_points (const bke::CurvesGeometry &curves, const int amount_start, const int amount_end, const bool inverted, IndexMaskMemory &memory)
Poll Functions
bool editable_curves_in_edit_mode_poll (bContext *C)
bool editable_curves_with_surface_poll (bContext *C)
bool curves_with_surface_poll (bContext *C)
bool editable_curves_poll (bContext *C)
bool curves_poll (bContext *C)
Selection

Selection on curves can be stored on either attribute domain: either per-curve or per-point. It can be stored with a float or boolean data-type. The boolean data-type is faster, smaller, and corresponds better to edit-mode selections, but the float data type is useful for soft selection (like masking) in sculpt mode.

The attribute API is used to do the necessary type and domain conversions when necessary, and can handle most interaction with the selection attribute, but these functions implement some helpful utilities on top of that.

IndexMask retrieve_selected_curves (const bke::CurvesGeometry &curves, IndexMaskMemory &memory)
IndexMask retrieve_selected_curves (const Curves &curves_id, IndexMaskMemory &memory)
IndexMask retrieve_selected_points (const bke::CurvesGeometry &curves, IndexMaskMemory &memory)
IndexMask retrieve_all_selected_points (const bke::CurvesGeometry &curves, const int handle_display, IndexMaskMemory &memory)
IndexMask retrieve_selected_points (const bke::CurvesGeometry &curves, StringRef attribute_name, const IndexMask &bezier_points, IndexMaskMemory &memory)
IndexMask retrieve_selected_points (const Curves &curves_id, IndexMaskMemory &memory)
void foreach_selection_attribute_writer (bke::CurvesGeometry &curves, bke::AttrDomain selection_domain, blender::FunctionRef< void(bke::GSpanAttributeWriter &selection)> fn)
bke::GSpanAttributeWriter ensure_selection_attribute (bke::CurvesGeometry &curves, bke::AttrDomain selection_domain, bke::AttrType create_type, StringRef attribute_name)
void fill_selection_false (GMutableSpan selection)
void fill_selection_true (GMutableSpan selection)
void fill_selection (GMutableSpan selection, bool value)
void fill_selection_false (GMutableSpan selection, const IndexMask &mask)
void fill_selection_true (GMutableSpan selection, const IndexMask &mask)
bool has_anything_selected (const VArray< bool > &varray, const IndexRange range_to_check)
bool has_anything_selected (const VArray< bool > &varray, const IndexMask &indices_to_check)
bool has_anything_selected (const bke::CurvesGeometry &curves)
bool has_anything_selected (const bke::CurvesGeometry &curves, bke::AttrDomain selection_domain)
bool has_anything_selected (const bke::CurvesGeometry &curves, bke::AttrDomain selection_domain, const IndexMask &mask)
bool has_anything_selected (const GSpan selection)
void select_all (bke::CurvesGeometry &curves, const IndexMask &mask, const bke::AttrDomain selection_domain, int action)
void select_all (bke::CurvesGeometry &curves, const bke::AttrDomain selection_domain, int action)
void select_linked (bke::CurvesGeometry &curves, const IndexMask &curves_mask)
void select_linked (bke::CurvesGeometry &curves)
void select_alternate (bke::CurvesGeometry &curves, const IndexMask &curves_mask, const bool deselect_ends)
void select_alternate (bke::CurvesGeometry &curves, const bool deselect_ends)
void select_adjacent (bke::CurvesGeometry &curves, const IndexMask &curves_mask, const bool deselect)
void select_adjacent (bke::CurvesGeometry &curves, const bool deselect)
void apply_selection_operation_at_index (GMutableSpan selection, const int index, const eSelectOp sel_op)
std::optional< FindClosestDataclosest_elem_find_screen_space (const ViewContext &vc, const OffsetIndices< int > points_by_curve, const Span< float3 > positions, const VArray< bool > &cyclic, const float4x4 &projection, const IndexMask &mask, const bke::AttrDomain domain, const int2 coord, const FindClosestData &initial_closest)
bool select_box (const ViewContext &vc, bke::CurvesGeometry &curves, const bke::crazyspace::GeometryDeformation &deformation, const float4x4 &projection, const IndexMask &selection_mask, const IndexMask &bezier_mask, const bke::AttrDomain selection_domain, const rcti &rect, const eSelectOp sel_op)
bool select_lasso (const ViewContext &vc, bke::CurvesGeometry &curves, const bke::crazyspace::GeometryDeformation &deformation, const float4x4 &projection, const IndexMask &selection_mask, const IndexMask &bezier_mask, const bke::AttrDomain selection_domain, const Span< int2 > lasso_coords, const eSelectOp sel_op)
bool select_circle (const ViewContext &vc, bke::CurvesGeometry &curves, const bke::crazyspace::GeometryDeformation &deformation, const float4x4 &projection, const IndexMask &selection_mask, const IndexMask &bezier_mask, const bke::AttrDomain selection_domain, const int2 coord, const float radius, const eSelectOp sel_op)
IndexMask select_adjacent_mask (const bke::CurvesGeometry &curves, const IndexMask &curves_mask, const StringRef attribute_name, const bool deselect, IndexMaskMemory &memory)
IndexMask select_adjacent_mask (const bke::CurvesGeometry &curves, const StringRef attribute_name, const bool deselect, IndexMaskMemory &memory)
IndexMask select_box_mask (const ViewContext &vc, const bke::CurvesGeometry &curves, const bke::crazyspace::GeometryDeformation &deformation, const float4x4 &projection, const IndexMask &selection_mask, const IndexMask &bezier_mask, const bke::AttrDomain selection_domain, const StringRef attribute_name, const rcti &rect, IndexMaskMemory &memory)
IndexMask select_lasso_mask (const ViewContext &vc, const bke::CurvesGeometry &curves, const bke::crazyspace::GeometryDeformation &deformation, const float4x4 &projection, const IndexMask &selection_mask, const IndexMask &bezier_mask, const bke::AttrDomain selection_domain, const StringRef attribute_name, const Span< int2 > lasso_coords, IndexMaskMemory &memory)
IndexMask select_circle_mask (const ViewContext &vc, const bke::CurvesGeometry &curves, const bke::crazyspace::GeometryDeformation &deformation, const float4x4 &projection, const IndexMask &selection_mask, const IndexMask &bezier_mask, const bke::AttrDomain selection_domain, const StringRef attribute_name, const int2 coord, const float radius, IndexMaskMemory &memory)

StrokeElem / #RNA_OperatorStrokeElement Conversion Functions

enum  CurveDrawState { CURVE_DRAW_IDLE = 0 , CURVE_DRAW_PAINTING = 1 }
static float stroke_elem_radius_from_pressure (const CurveDrawData *cdd, const float pressure)
static float stroke_elem_radius (const CurveDrawData *cdd, const StrokeElem *selem)
static void stroke_elem_pressure_set (const CurveDrawData *cdd, StrokeElem *selem, float pressure)
static void stroke_elem_interp (StrokeElem *selem_out, const StrokeElem *selem_a, const StrokeElem *selem_b, float t)
static bool stroke_elem_project (const CurveDrawData *cdd, const int mval_i[2], const float mval_fl[2], float surface_offset, const float radius, float r_location_world[3], float r_normal_world[3])
static bool stroke_elem_project_fallback (const CurveDrawData *cdd, const int mval_i[2], const float mval_fl[2], const float surface_offset, const float radius, const float location_fallback_depth[3], float r_location_world[3], float r_location_local[3], float r_normal_world[3], float r_normal_local[3])
static bool stroke_elem_project_fallback_elem (const CurveDrawData *cdd, const float location_fallback_depth[3], StrokeElem *selem)

Editing

enum class  SetHandleType : uint8_t {
  Free = 0 , Auto = 1 , Vector = 2 , Align = 3 ,
  Toggle = 4
}
const EnumPropertyItem rna_enum_set_handle_type_items []
bool remove_selection (bke::CurvesGeometry &curves, const bke::AttrDomain selection_domain)
void duplicate_points (bke::CurvesGeometry &curves, const IndexMask &mask)
void duplicate_curves (bke::CurvesGeometry &curves, const IndexMask &mask)
bke::CurvesGeometry split_points (const bke::CurvesGeometry &curves, const IndexMask &points_to_split)
void separate_points (const bke::CurvesGeometry &curves, const IndexMask &points_to_separate, bke::CurvesGeometry &separated, bke::CurvesGeometry &retained)
void add_curves (bke::CurvesGeometry &curves, const Span< int > new_sizes)
void resize_curves (bke::CurvesGeometry &curves, const IndexMask &curves_to_resize, const Span< int > new_sizes)
void reorder_curves (bke::CurvesGeometry &curves, const Span< int > old_by_new_indices_map)
wmOperatorStatus join_objects_exec (bContext *C, wmOperator *op)

Detailed Description

The code below uses a suffix naming convention to indicate the coordinate space: cu: Local space of the curves object that is being edited. su: Local space of the surface object. wo: World space. ha: Local space of an individual hair in the legacy hair system.

Typedef Documentation

◆ SelectionRangeFn

Enumeration Type Documentation

◆ CurveDrawState

Enumerator
CURVE_DRAW_IDLE 
CURVE_DRAW_PAINTING 

Definition at line 73 of file curves_draw.cc.

◆ SetHandleType

enum class blender::ed::curves::SetHandleType : uint8_t
strong
Enumerator
Free 
Auto 
Vector 
Align 
Toggle 

Definition at line 578 of file ED_curves.hh.

Function Documentation

◆ active_attribute_poll()

bool blender::ed::curves::active_attribute_poll ( bContext * C)
static

◆ add_curves()

void blender::ed::curves::add_curves ( bke::CurvesGeometry & curves,
Span< int > new_sizes )

◆ append_curve_knots()

void blender::ed::curves::append_curve_knots ( const IndexMask & mask,
bke::CurvesGeometry & curves )
static

Definition at line 244 of file curves_edit.cc.

References blender::bke::curves::nurbs::gather_custom_knots(), and mask().

Referenced by duplicate_curves().

◆ append_point_knots()

◆ append_primitive_curve()

◆ apply_selection_operation_at_index()

void blender::ed::curves::apply_selection_operation_at_index ( GMutableSpan selection,
int index,
eSelectOp sel_op )

◆ calc_curves_extrusion()

void blender::ed::curves::calc_curves_extrusion ( const IndexMask & selection,
const OffsetIndices< int > points_by_curve,
MutableSpan< int > copy_intervals,
MutableSpan< int > curves_intervals_offsets,
MutableSpan< bool > is_first_selected )
static

◆ calc_new_offsets()

void blender::ed::curves::calc_new_offsets ( const Span< int > old_offsets,
const Span< int > curves_intervals_offsets,
MutableSpan< int > new_offsets )
static

◆ clamp_to_zero()

float blender::ed::curves::clamp_to_zero ( const float value)
static

Definition at line 119 of file curves_extrude.cc.

References blender::math::abs().

Referenced by extrude_knots().

◆ closer_elem()

FindClosestData blender::ed::curves::closer_elem ( const FindClosestData & a,
const FindClosestData & b )
static

Definition at line 741 of file curves_selection.cc.

References b, and blender::ed::curves::FindClosestData::distance_sq.

◆ closest_elem_find_screen_space()

std::optional< FindClosestData > blender::ed::curves::closest_elem_find_screen_space ( const ViewContext & vc,
OffsetIndices< int > points_by_curve,
Span< float3 > deformed_positions,
const VArray< bool > & cyclic,
const float4x4 & projection,
const IndexMask & mask,
bke::AttrDomain domain,
int2 coord,
const FindClosestData & initial )

◆ compress_intervals()

Span< int > blender::ed::curves::compress_intervals ( const OffsetIndices< int > intervals_by_curve,
MutableSpan< int > intervals )
static

Merges copy intervals at curve endings to minimize number of copy operations. For example given in function 'extrude_curves' intervals [0, 3, 4, 4, 4] became [0, 4, 4]. Leading to only two copy operations.

Definition at line 22 of file curves_extrude.cc.

References blender::MutableSpan< T >::data(), blender::IndexRange::drop_front(), blender::IndexRange::first(), blender::offset_indices::OffsetIndices< T >::index_range(), blender::IndexRange::size(), and blender::offset_indices::OffsetIndices< T >::size().

◆ copy_data_to_geometry()

◆ create_Bezier()

void blender::ed::curves::create_Bezier ( bke::CurvesGeometry & curves,
bke::MutableAttributeAccessor & attributes,
const CurveDrawData * cdd,
const int curve_index,
const bool is_cyclic,
const uint cubic_spline_len,
const int dims,
const int radius_index,
const float radius_max,
const float * cubic_spline,
const uint * corners_index,
const uint corners_index_len )
static

◆ create_NURBS()

void blender::ed::curves::create_NURBS ( bke::CurvesGeometry & curves,
bke::MutableAttributeAccessor & attributes,
const CurveDrawData * cdd,
const int curve_index,
const bool is_cyclic,
const uint cubic_spline_len,
const int dims,
const int radius_index,
const float radius_max,
const float * cubic_spline )
static

◆ curve_draw_cancel()

void blender::ed::curves::curve_draw_cancel ( bContext * ,
wmOperator * op )
static

Definition at line 1147 of file curves_draw.cc.

References curve_draw_exit().

Referenced by curves_draw_modal().

◆ curve_draw_event_add()

◆ curve_draw_event_add_first()

◆ curve_draw_exec_precalc()

◆ curve_draw_exit()

◆ curve_draw_init()

bool blender::ed::curves::curve_draw_init ( bContext * C,
wmOperator * op,
bool is_invoke )
static

Definition at line 582 of file curves_draw.cc.

References blender::ed::curves::CurveDrawData::bevel_radius, BKE_report(), BLI_assert, BLI_MEMPOOL_ALLOW_ITER, BLI_mempool_create(), ViewContext::bmain, C, CTX_data_edit_object(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CURVE_PAINT_FLAG_DEPTH_STROKE_OFFSET_ABS, ToolSettings::curve_paint_settings, blender::ed::curves::CurveDrawData::curve_type, CurvePaintSettings::curve_type, wmOperator::customdata, depsgraph, ViewContext::depsgraph, ED_view3d_viewcontext_init(), ELEM, CurvePaintSettings::flag, blender::ed::curves::CurveDrawData::is_curve_2d, blender::ed::curves::CurveDrawData::max, MEM_callocN(), MEM_freeN(), blender::ed::curves::CurveDrawData::min, ViewContext::obedit, blender::ed::curves::CurveDrawData::project, wmOperator::ptr, blender::ed::curves::CurveDrawData::radius, CurvePaintSettings::radius_max, CurvePaintSettings::radius_min, blender::ed::curves::CurveDrawData::range, ViewContext::region, wmOperator::reports, RNA_boolean_get(), RNA_collection_is_empty(), RPT_ERROR, ViewContext::rv3d, ViewContext::scene, blender::ed::curves::CurveDrawData::stroke_elem_pool, blender::ed::curves::CurveDrawData::surface_offset, CurvePaintSettings::surface_offset, Scene::toolsettings, blender::ed::curves::CurveDrawData::use_surface_offset_absolute, ViewContext::v3d, blender::ed::curves::CurveDrawData::vc, ViewContext::view_layer, and ViewContext::win.

Referenced by curves_draw_exec(), and curves_draw_invoke().

◆ curve_draw_stroke_3d()

◆ curve_draw_stroke_from_operator()

void blender::ed::curves::curve_draw_stroke_from_operator ( wmOperator * op)
static

Definition at line 325 of file curves_draw.cc.

References curve_draw_stroke_from_operator_elem(), wmOperator::ptr, RNA_BEGIN, and RNA_END.

Referenced by curves_draw_exec().

◆ curve_draw_stroke_from_operator_elem()

◆ curve_draw_stroke_to_operator()

void blender::ed::curves::curve_draw_stroke_to_operator ( wmOperator * op)
static

◆ curve_draw_stroke_to_operator_elem()

◆ curve_mask_from_points()

IndexMask blender::ed::curves::curve_mask_from_points ( const bke::CurvesGeometry & curves,
const IndexMask & point_mask,
const GrainSize grain_size,
IndexMaskMemory & memory )

Create a mask for all curves that have at least one point in the point mask.

Definition at line 18 of file curves_masks.cc.

References blender::IndexMask::from_predicate(), and blender::index_mask::IndexMask::to_bools().

Referenced by blender::ed::greasepencil::apply_mask_as_segment_selection().

◆ curve_offsets_from_selection()

void blender::ed::curves::curve_offsets_from_selection ( const Span< IndexRange > selected_points,
const IndexRange points,
const int curve,
const bool cyclic,
Vector< int > & r_new_curve_offsets,
Vector< bool > & r_new_cyclic,
Vector< IndexRange > & r_src_ranges,
Vector< int > & r_dst_offsets,
Vector< int > & r_dst_to_src_curve )
static

◆ curves_draw_exec()

wmOperatorStatus blender::ed::curves::curves_draw_exec ( bContext * C,
wmOperator * op )
static

Definition at line 738 of file curves_draw.cc.

References blender::bke::attribute_filter_from_skip_ref(), BLI_mempool_iternew(), BLI_mempool_iterstep(), BLI_mempool_len(), C, blender::bke::AttributeAccessor::contains(), copy_v3_v3(), create_Bezier(), create_NURBS(), CU_BEZIER, blender::bke::Curve, curve_draw_exit(), curve_draw_init(), curve_draw_stroke_from_operator(), CURVE_PAINT_FIT_METHOD_REFIT, CURVE_PAINT_FIT_METHOD_SPLIT, CURVE_PAINT_FLAG_PRESSURE_RADIUS, ToolSettings::curve_paint_settings, blender::ed::curves::CurveDrawData::curve_type, CURVE_TYPE_BEZIER, CURVE_TYPE_NURBS, CURVE_TYPE_POLY, wmOperator::customdata, Object::data, DEG_id_tag_update(), blender::bke::fill_attribute_range_default(), blender::bke::AttributeWriter< T >::finish(), blender::bke::SpanAttributeWriter< T >::finish(), CurvePaintSettings::flag, free(), Curves::geometry, get_curves_all_selection_attribute_names(), get_curves_bezier_selection_attribute_names(), get_curves_selection_attribute_names(), i, invert_m4_m4(), blender::ed::curves::CurveDrawData::is_curve_2d, is_cyclic(), blender::ed::curves::StrokeElem::location_local, blender::bke::MutableAttributeAccessor::lookup_or_add_for_write(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), M_PI, MEM_freeN(), MEM_malloc_arrayN(), NC_GEOM, ND_DATA, NURBS_KNOT_MODE_BEZIER, NURBS_KNOT_MODE_ENDPOINT_BEZIER, ViewContext::obedit, OPERATOR_CANCELLED, OPERATOR_FINISHED, blender::bke::Point, blender::ed::curves::StrokeElem::pressure, wmOperator::ptr, CurvePaintSettings::radius_max, CurvePaintSettings::radius_min, CurvePaintSettings::radius_taper_end, CurvePaintSettings::radius_taper_start, remove_selection_attributes(), result, RNA_boolean_get(), RNA_enum_get(), RNA_float_get(), Object::runtime, ViewContext::scene, blender::bke::SpanAttributeWriter< T >::span, blender::ed::curves::CurveDrawData::stroke_elem_pool, Scene::toolsettings, UNLIKELY, blender::bke::AttributeWriter< T >::varray, blender::ed::curves::CurveDrawData::vc, and WM_event_add_notifier().

Referenced by curves_draw_invoke(), curves_draw_modal(), and CURVES_OT_draw().

◆ curves_draw_invoke()

wmOperatorStatus blender::ed::curves::curves_draw_invoke ( bContext * C,
wmOperator * op,
const wmEvent * event )
static

Definition at line 1049 of file curves_draw.cc.

References BKE_report(), C, copy_v3_v3(), CU_POLY, Scene::cursor, curve_draw_event_add_first(), curve_draw_init(), curve_draw_stroke_3d(), CURVE_PAINT_FLAG_DEPTH_ONLY_SELECTED, CURVE_PAINT_PROJECT_SURFACE, ToolSettings::curve_paint_settings, blender::ed::curves::CurveDrawData::curve_type, curves_draw_exec(), wmOperator::customdata, ViewContext::depsgraph, CurvePaintSettings::depth_mode, blender::ed::curves::CurveDrawData::depths, dot_v3v3(), blender::ed::curves::CurveDrawData::draw_handle_view, ED_region_draw_cb_activate(), ED_view3d_depth_override(), ED_view3d_win_to_3d(), CurvePaintSettings::flag, float, blender::ed::curves::CurveDrawData::is_curve_2d, View3DCursor::location, blender::ed::curves::CurveDrawData::location_world, blender::ed::curves::CurveDrawData::location_world_valid, wmEvent::mval, negate_v3_v3(), normalize_v3_v3(), OB_WIRE, ViewContext::obedit, RegionView3D::ofs, OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, blender::ed::curves::CurveDrawData::plane, blender::ed::curves::CurveDrawData::prev, blender::ed::curves::CurveDrawData::project, wmOperator::ptr, ViewContext::region, REGION_DRAW_POST_VIEW, wmOperator::reports, RNA_boolean_get(), RNA_struct_property_is_set(), RPT_WARNING, ARegion::runtime, ViewContext::rv3d, blender::ed::curves::CurveDrawData::sample, ViewContext::scene, View3D::shading, Scene::toolsettings, View3DShading::type, blender::ed::curves::CurveDrawData::use_depth, blender::ed::curves::CurveDrawData::use_plane, blender::ed::curves::CurveDrawData::use_substeps, ViewContext::v3d, V3D_DEPTH_ALL, V3D_DEPTH_SELECTED_ONLY, blender::ed::curves::CurveDrawData::vc, view3d_operator_needs_gpu(), RegionView3D::viewinv, ViewContext::win, WM_cursor_modal_set(), WM_CURSOR_PAINT_BRUSH, and WM_event_add_modal_handler().

Referenced by CURVES_OT_draw().

◆ curves_draw_modal()

◆ curves_extrude_exec()

◆ CURVES_OT_add_bezier()

◆ CURVES_OT_add_circle()

◆ CURVES_OT_attribute_set()

◆ CURVES_OT_convert_from_particle_system()

◆ CURVES_OT_convert_to_particle_system()

void blender::ed::curves::CURVES_OT_convert_to_particle_system ( wmOperatorType * ot)
static

◆ CURVES_OT_curve_type_set()

◆ CURVES_OT_cyclic_toggle()

void blender::ed::curves::CURVES_OT_cyclic_toggle ( wmOperatorType * ot)
static

◆ CURVES_OT_delete()

void blender::ed::curves::CURVES_OT_delete ( wmOperatorType * ot)
static

◆ CURVES_OT_draw()

◆ CURVES_OT_duplicate()

void blender::ed::curves::CURVES_OT_duplicate ( wmOperatorType * ot)
static

◆ CURVES_OT_extrude()

void blender::ed::curves::CURVES_OT_extrude ( wmOperatorType * ot)

◆ CURVES_OT_handle_type_set()

◆ CURVES_OT_pen()

◆ CURVES_OT_select_all()

void blender::ed::curves::CURVES_OT_select_all ( wmOperatorType * ot)
static

◆ CURVES_OT_select_ends()

void blender::ed::curves::CURVES_OT_select_ends ( wmOperatorType * ot)
static

◆ CURVES_OT_select_less()

void blender::ed::curves::CURVES_OT_select_less ( wmOperatorType * ot)
static

◆ CURVES_OT_select_linked()

void blender::ed::curves::CURVES_OT_select_linked ( wmOperatorType * ot)
static

◆ CURVES_OT_select_linked_pick()

void blender::ed::curves::CURVES_OT_select_linked_pick ( wmOperatorType * ot)

◆ CURVES_OT_select_more()

void blender::ed::curves::CURVES_OT_select_more ( wmOperatorType * ot)
static

◆ CURVES_OT_select_random()

◆ CURVES_OT_separate()

void blender::ed::curves::CURVES_OT_separate ( wmOperatorType * ot)

◆ CURVES_OT_set_selection_domain()

◆ CURVES_OT_snap_curves_to_surface()

void blender::ed::curves::CURVES_OT_snap_curves_to_surface ( wmOperatorType * ot)
static

◆ CURVES_OT_split()

void blender::ed::curves::CURVES_OT_split ( wmOperatorType * ot)
static

◆ CURVES_OT_subdivide()

◆ CURVES_OT_surface_set()

◆ CURVES_OT_switch_direction()

void blender::ed::curves::CURVES_OT_switch_direction ( wmOperatorType * ot)
static

◆ CURVES_OT_tilt_clear()

void blender::ed::curves::CURVES_OT_tilt_clear ( wmOperatorType * ot)
static

◆ curves_poll()

bool blender::ed::curves::curves_poll ( bContext * C)

Definition at line 161 of file curves_ops.cc.

References C, and curves_poll_impl().

Referenced by blender::ed::sculpt_paint::CURVES_OT_sculptmode_toggle().

◆ curves_poll_impl()

bool blender::ed::curves::curves_poll_impl ( bContext * C,
const bool check_editable,
const bool check_surface,
const bool check_edit_mode )
static

◆ curves_with_surface_poll()

bool blender::ed::curves::curves_with_surface_poll ( bContext * C)

◆ duplicate_curves()

◆ duplicate_points()

void blender::ed::curves::duplicate_points ( bke::CurvesGeometry & curves,
const IndexMask & mask )

Definition at line 138 of file curves_edit.cc.

References append_point_knots(), blender::Vector< T, InlineBufferCapacity, Allocator >::as_span(), BLI_assert_unreachable, blender::array_utils::copy(), blender::bke::Curve, curve_offsets_from_selection(), blender::offset_indices::OffsetIndices< T >::data(), blender::bke::AttributeIter::domain, blender::bke::GSpanAttributeWriter::finish(), blender::bke::SpanAttributeWriter< T >::finish(), blender::bke::AttributeAccessor::foreach_attribute(), blender::bke::curves::foreach_selected_point_ranges_per_curve(), blender::bke::attribute_math::gather(), blender::bke::attribute_math::gather_ranges_to_groups(), get_curves_selection_attribute_names(), blender::VArrayCommon< T >::get_internal_single(), blender::VArrayCommon< T >::is_single(), blender::bke::MutableAttributeAccessor::lookup_for_write_span(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span(), mask(), blender::bke::AttributeIter::name, blender::bke::Point, remove_selection_attributes(), blender::Vector< T, InlineBufferCapacity, Allocator >::reserve(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), blender::GMutableSpan::slice(), blender::bke::GSpanAttributeWriter::span, and blender::bke::SpanAttributeWriter< T >::span.

Referenced by blender::ed::curves::curves_duplicate::duplicate_exec(), blender::ed::greasepencil::grease_pencil_duplicate_exec(), blender::ed::greasepencil::grease_pencil_reproject_exec(), blender::ed::curves::tests::TEST(), blender::ed::curves::tests::TEST(), and blender::ed::curves::tests::TEST().

◆ ED_curves_pentool_modal_keymap()

void blender::ed::curves::ED_curves_pentool_modal_keymap ( wmKeyConfig * keyconf)

◆ ED_operatortypes_curves_pen()

void blender::ed::curves::ED_operatortypes_curves_pen ( )

◆ editable_curves_in_edit_mode_poll()

◆ editable_curves_point_domain_poll()

◆ editable_curves_poll()

◆ editable_curves_with_surface_poll()

bool blender::ed::curves::editable_curves_with_surface_poll ( bContext * C)

Definition at line 146 of file curves_ops.cc.

References C, and curves_poll_impl().

Referenced by CURVES_OT_snap_curves_to_surface().

◆ end_points() [1/2]

IndexMask blender::ed::curves::end_points ( const bke::CurvesGeometry & curves,
const IndexMask & curves_mask,
const int amount_start,
const int amount_end,
const bool inverted,
IndexMaskMemory & memory )

◆ end_points() [2/2]

IndexMask blender::ed::curves::end_points ( const bke::CurvesGeometry & curves,
int amount_start,
int amount_end,
bool inverted,
IndexMaskMemory & memory )

Return a mask of all the end points in the curves.

Parameters
curves_mask(optional) The curves that should be used in the resulting point mask.
amount_startThe amount of points to mask from the front.
amount_endThe amount of points to mask from the back.
invertedInvert the resulting mask.

Definition at line 58 of file curves_masks.cc.

References end_points().

◆ ensure_selection_attribute()

bke::GSpanAttributeWriter blender::ed::curves::ensure_selection_attribute ( bke::CurvesGeometry & curves,
bke::AttrDomain selection_domain,
bke::AttrType create_type,
StringRef attribute_name = ".selection" )

◆ ensure_surface_deformation_node_exists()

◆ extend_range()

◆ extend_range_by_1_within_bounds()

void blender::ed::curves::extend_range_by_1_within_bounds ( const IndexRange universe,
const bool cyclic,
const Span< IndexRange > ranges,
Vector< IndexRange > & extended_ranges )
static

◆ extrude_curves()

◆ extrude_knots()

◆ fill_selection()

void blender::ed::curves::fill_selection ( GMutableSpan selection,
bool value )

◆ fill_selection_false() [1/2]

◆ fill_selection_false() [2/2]

void blender::ed::curves::fill_selection_false ( GMutableSpan selection,
const IndexMask & mask )

◆ fill_selection_true() [1/2]

◆ fill_selection_true() [2/2]

void blender::ed::curves::fill_selection_true ( GMutableSpan selection,
const IndexMask & mask )

◆ find_closest_curve()

◆ find_closest_curve_to_screen_co()

std::optional< FindClosestData > blender::ed::curves::find_closest_curve_to_screen_co ( const ARegion * region,
const OffsetIndices< int > points_by_curve,
const Span< float3 > positions,
const VArray< bool > & cyclic,
const float4x4 & projection,
const IndexMask & curves_mask,
const float2 mouse_pos,
float radius,
const FindClosestData & initial_closest )
static

◆ find_closest_point_to_screen_co()

std::optional< FindClosestData > blender::ed::curves::find_closest_point_to_screen_co ( const ARegion * region,
const Span< float3 > positions,
const float4x4 & projection,
const IndexMask & points_mask,
const float2 mouse_pos,
const float radius,
const FindClosestData & initial_closest )
static

◆ finish_attribute_writers()

void blender::ed::curves::finish_attribute_writers ( MutableSpan< bke::GSpanAttributeWriter > attribute_writers)
static

◆ foreach_selectable_curve_range()

void blender::ed::curves::foreach_selectable_curve_range ( const bke::CurvesGeometry & curves,
const bke::crazyspace::GeometryDeformation & deformation,
eHandleDisplay handle_display,
SelectionRangeFn range_consumer )

Same logic as in foreach_selectable_point_range, just ranges reference curves instead of positions directly. Further positions can be referenced by using curves.points_by_curve() in a callback function.

Definition at line 284 of file curves_selection.cc.

References blender::index_mask::IndexMask::foreach_range(), blender::Span< T >::index_range(), and init_selectable_foreach().

Referenced by ed_curves_select_pick(), ed_grease_pencil_select_pick(), and find_closest_curve().

◆ foreach_selectable_point_range()

void blender::ed::curves::foreach_selectable_point_range ( const bke::CurvesGeometry & curves,
const bke::crazyspace::GeometryDeformation & deformation,
eHandleDisplay handle_display,
SelectionRangeFn range_consumer )

Traverses all ranges of control points possible select. Callback function is provided with a range being visited, positions (deformed if possible) referenced by the range and selection attribute name positions belongs to: curves.positions() belong to ".selection", curves.handle_positions_left() belong to ".selection_handle_left", curves.handle_positions_right() belong to ".selection_handle_right".

Definition at line 249 of file curves_selection.cc.

References blender::index_mask::IndexMask::foreach_index(), blender::Span< T >::index_range(), and init_selectable_foreach().

Referenced by ed_curves_select_pick(), ed_grease_pencil_select_pick(), select_box(), select_circle(), and select_lasso().

◆ foreach_selection_attribute_writer()

void blender::ed::curves::foreach_selection_attribute_writer ( bke::CurvesGeometry & curves,
bke::AttrDomain selection_domain,
blender::FunctionRef< void(bke::GSpanAttributeWriter &selection)> fn )

◆ get_curves_all_selection_attribute_names()

Span< StringRef > blender::ed::curves::get_curves_all_selection_attribute_names ( )

◆ get_curves_bezier_selection_attribute_names()

Span< StringRef > blender::ed::curves::get_curves_bezier_selection_attribute_names ( const bke::CurvesGeometry & curves)

Returns [".selection_handle_left", ".selection_handle_right"] if argument contains Bezier curves, empty span otherwise.

Definition at line 142 of file curves_selection.cc.

References blender::bke::AttributeAccessor::contains().

Referenced by curves_draw_exec(), and init_selectable_foreach().

◆ get_curves_positions()

Vector< Span< float3 > > blender::ed::curves::get_curves_positions ( const bke::CurvesGeometry & curves)

Get read-only positions per selection attribute for given curve.

Definition at line 26 of file curves_data.cc.

References blender::Vector< T, InlineBufferCapacity, Allocator >::append().

◆ get_curves_positions_for_write()

Vector< MutableSpan< float3 > > blender::ed::curves::get_curves_positions_for_write ( bke::CurvesGeometry & curves)

◆ get_curves_selection_attribute_names()

Span< StringRef > blender::ed::curves::get_curves_selection_attribute_names ( const bke::CurvesGeometry & curves)

◆ get_selection_attribute_positions()

std::optional< Span< float3 > > blender::ed::curves::get_selection_attribute_positions ( const bke::CurvesGeometry & curves,
const bke::crazyspace::GeometryDeformation & deformation,
StringRef attribute_name )

Get the position span associated with the given selection attribute name.

Definition at line 160 of file curves_selection.cc.

References BLI_assert_unreachable, and blender::bke::crazyspace::GeometryDeformation::positions.

Referenced by select_box_mask(), select_circle_mask(), and select_lasso_mask().

◆ get_unique_editable_curves()

◆ has_anything_selected() [1/7]

bool blender::ed::curves::has_anything_selected ( const bke::CurvesGeometry & curves)

Return true if any element is selected, on either domain with either type.

Definition at line 412 of file curves_selection.cc.

References blender::array_utils::contains(), and blender::VArrayCommon< T >::index_range().

◆ has_anything_selected() [2/7]

bool blender::ed::curves::has_anything_selected ( const bke::CurvesGeometry & curves,
bke::AttrDomain selection_domain )

Definition at line 418 of file curves_selection.cc.

References has_anything_selected().

◆ has_anything_selected() [3/7]

bool blender::ed::curves::has_anything_selected ( const bke::CurvesGeometry & curves,
bke::AttrDomain selection_domain,
const IndexMask & mask )

◆ has_anything_selected() [4/7]

bool blender::ed::curves::has_anything_selected ( GSpan selection)

Return true if any element in the span is selected, on either domain with either type.

Definition at line 438 of file curves_selection.cc.

References blender::CPPType::is(), blender::GSpan::type(), and blender::GSpan::typed().

◆ has_anything_selected() [5/7]

◆ has_anything_selected() [6/7]

bool blender::ed::curves::has_anything_selected ( const VArray< bool > & varray,
const IndexMask & indices_to_check )

Definition at line 407 of file curves_selection.cc.

References blender::array_utils::contains().

◆ has_anything_selected() [7/7]

bool blender::ed::curves::has_anything_selected ( const VArray< bool > & varray,
const IndexRange range_to_check )

Definition at line 402 of file curves_selection.cc.

References blender::array_utils::contains().

◆ has_surface_deformation_node() [1/2]

bool blender::ed::curves::has_surface_deformation_node ( const bNodeTree & ntree)
static

◆ has_surface_deformation_node() [2/2]

bool blender::ed::curves::has_surface_deformation_node ( const Object & curves_ob)
static

◆ init_selectable_foreach()

void blender::ed::curves::init_selectable_foreach ( const bke::CurvesGeometry & curves,
const bke::crazyspace::GeometryDeformation & deformation,
eHandleDisplay handle_display,
Span< StringRef > & r_bezier_attribute_names,
Span< float3 > & r_positions,
std::optional< std::array< Span< float3 >, 2 > > & r_bezier_handle_positions,
IndexMaskMemory & r_memory,
IndexMask & r_bezier_curves )
static

◆ init_selection_writers()

◆ invert_ranges()

◆ invert_selection() [1/3]

void blender::ed::curves::invert_selection ( GMutableSpan selection)
static

Definition at line 469 of file curves_selection.cc.

References invert_selection(), and blender::GMutableSpan::size().

◆ invert_selection() [2/3]

void blender::ed::curves::invert_selection ( GMutableSpan selection,
const IndexMask & mask )
static

◆ invert_selection() [3/3]

void blender::ed::curves::invert_selection ( MutableSpan< float > selection,
const IndexMask & mask )
static

Definition at line 453 of file curves_selection.cc.

References i, and mask().

Referenced by invert_selection(), invert_selection(), select_adjacent(), and select_all().

◆ join_objects_exec()

wmOperatorStatus blender::ed::curves::join_objects_exec ( bContext * C,
wmOperator * op )

Definition at line 24 of file curves/intern/join.cc.

References blender::bke::Instances::add_new_reference(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::Vector< T, InlineBufferCapacity, Allocator >::as_span(), blender::ed::object::base_free_and_unlink(), BKE_curves_copy_for_eval(), BKE_report(), BLI_assert, C, CTX_data_active_object(), CTX_DATA_BEGIN, CTX_DATA_END, CTX_data_main(), CTX_data_scene(), blender::Vector< T, InlineBufferCapacity, Allocator >::data(), Object::data, DEG_id_tag_update(), DEG_relations_tag_update(), blender::bke::GeometrySet::from_curves(), blender::bke::GeometrySet::from_instances(), blender::geometry::RealizeInstancesResult::geometry, Curves::geometry, blender::bke::GeometrySet::get_curves_for_write(), blender::bke::GeometrySet::has_curves(), i, Object::id, Scene::id, ID_RECALC_GEOMETRY, ID_RECALC_SELECT, ID_RECALC_TRANSFORM, blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_or_add_cb(), NC_SCENE, ND_LAYER_CONTENT, ND_OB_ACTIVE, OB_CURVES, OPERATOR_CANCELLED, OPERATOR_FINISHED, blender::bke::ReadOnly, blender::geometry::realize_instances(), blender::bke::Instances::reference_handles_for_write(), wmOperator::reports, blender::bke::Instances::resize(), RPT_WARNING, blender::Vector< T, InlineBufferCapacity, Allocator >::size(), blender::bke::Instances::transforms_for_write(), Object::type, and WM_event_add_notifier().

Referenced by blender::ed::object::object_join_exec().

◆ keymap_curves()

◆ object_has_editable_curves()

bool blender::ed::curves::object_has_editable_curves ( const Main & bmain,
const Object & object )

◆ operatormacros_curves()

◆ operatortypes_curves()

◆ point_normals_array_create()

float(* blender::ed::curves::point_normals_array_create ( const Curves * curves_id) )[3]

Return an owning pointer to an array of point normals the same size as the number of control points. The normals depend on the normal mode for each curve and the "tilt" attribute and may be calculated for the evaluated points and sampled back to the control points.

Definition at line 88 of file curves_data.cc.

References blender::bke::curves_normals_point_domain_calc(), data, MEM_malloc_arrayN(), and size().

◆ primitive_random_sphere()

◆ remove_selection()

bool blender::ed::curves::remove_selection ( bke::CurvesGeometry & curves,
bke::AttrDomain selection_domain )

Remove (dissolve) selected curves or points based on the ".selection" attribute.

Returns
true if any point or curve was removed.

Definition at line 23 of file curves_edit.cc.

References BLI_assert_unreachable, blender::bke::Curve, blender::bke::AttributeAccessor::domain_size(), blender::IndexMask::from_bools(), blender::bke::AttributeAccessor::lookup_or_default(), mask(), and blender::bke::Point.

Referenced by blender::ed::curves::curves_delete::delete_exec().

◆ remove_selection_attributes()

void blender::ed::curves::remove_selection_attributes ( bke::MutableAttributeAccessor & attributes,
Span< StringRef > selection_attribute_names = get_curves_all_selection_attribute_names() )

Used to select everything or to delete selection attribute so that it will not have to be resized.

Definition at line 152 of file curves_selection.cc.

References blender::bke::MutableAttributeAccessor::remove().

Referenced by curves_draw_exec(), duplicate_curves(), duplicate_points(), select_all(), and separate_points().

◆ reorder_curves()

void blender::ed::curves::reorder_curves ( bke::CurvesGeometry & curves,
Span< int > old_by_new_indices_map )

Reorders the curves in curves.

Parameters
old_by_new_indices_mapAn index mapping where each value is the target index for the reorder curves.

Definition at line 714 of file curves_edit.cc.

References blender::geometry::reorder_curves_geometry().

◆ resize_curves()

void blender::ed::curves::resize_curves ( bke::CurvesGeometry & curves,
const IndexMask & curves_to_resize,
Span< int > new_sizes )

Resizes the curves in curves.

Parameters
curves_to_resizeThe curves that should be resized.
new_sizesThe new size for each curve in curves_to_resize. If the size is smaller, the curve is trimmed from the end. If the size is larger, the end is extended and all attributes are default initialized. Sizes must be > 0.

Definition at line 637 of file curves_edit.cc.

References blender::offset_indices::accumulate_counts_to_offsets(), blender::bke::attribute_name_is_anonymous(), blender::bke::CurvesGeometry::attributes_for_write(), BLI_assert, blender::index_mask::IndexMask::complement(), blender::GMutableSpan::copy_from(), blender::MutableSpan< T >::copy_from(), blender::offset_indices::copy_group_sizes(), blender::array_utils::copy_group_to_group(), blender::bke::curves::copy_only_curve_domain(), blender::bke::CurvesGeometry::curves_num(), blender::bke::CurvesGeometry::curves_range(), blender::GMutableSpan::data(), blender::bke::AttributeIter::data_type, blender::bke::AttributeIter::domain, blender::IndexRange::drop_back(), MutableSpan< T >::drop_back(), blender::bke::GSpanAttributeWriter::finish(), blender::bke::AttributeAccessor::foreach_attribute(), blender::index_mask::IndexMask::foreach_index(), blender::bke::AttributeIter::get(), blender::index_mask::IndexMask::is_empty(), Span< T >::last(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), blender::bke::AttributeIter::name, blender::bke::CurvesGeometry::nurbs_has_custom_knots(), NURBS_KNOT_MODE_NORMAL, blender::bke::CurvesGeometry::offsets(), blender::bke::CurvesGeometry::offsets_for_write(), blender::bke::Point, blender::bke::CurvesGeometry::points_by_curve(), blender::bke::CurvesGeometry::resize(), blender::array_utils::scatter(), blender::GMutableSpan::size(), blender::index_mask::IndexMask::size(), blender::IndexRange::size(), blender::Span< T >::size(), blender::GMutableSpan::slice(), blender::GSpan::slice(), blender::bke::GSpanAttributeWriter::span, blender::IndexRange::take_back(), blender::index_mask::IndexMask::to_range(), blender::GSpan::type(), blender::bke::CurvesGeometry::update_curve_types(), blender::bke::curves::nurbs::update_custom_knot_modes(), and blender::CPPType::value_initialize_n().

◆ retrieve_all_selected_points()

◆ retrieve_selected_curves() [1/2]

IndexMask blender::ed::curves::retrieve_selected_curves ( const bke::CurvesGeometry & curves,
IndexMaskMemory & memory )

Find curves that have any point selected (a selection factor greater than zero), or curves that have their own selection factor greater than zero.

Definition at line 28 of file curves_selection.cc.

References blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), blender::bke::Curve, CURVE_TYPE_BEZIER, CURVE_TYPE_POLY, blender::IndexMask::from_bools(), blender::IndexMask::from_predicate(), blender::VArrayCommon< T >::get_internal_single(), blender::VArrayCommon< T >::is_single(), blender::bke::AttributeAccessor::lookup_meta_data(), blender::bke::AttributeAccessor::lookup_or_default(), blender::VArrayCommon< T >::materialize_compressed(), blender::bke::Point, and blender::IndexRange::size().

Referenced by blender::ed::spreadsheet::GeometryDataSource::apply_selection_filter(), apply_to_active_object(), blender::ed::curves::curves_duplicate::duplicate_exec(), blender::ed::curves::curve_type_set::exec(), blender::ed::curves::cyclic_toggle::exec(), blender::ed::curves::switch_direction::exec(), blender::ed::sculpt_paint::CombOperationExecutor::execute(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::execute(), blender::ed::sculpt_paint::DeleteOperationExecutor::execute(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::execute(), blender::ed::sculpt_paint::PinchOperationExecutor::execute(), blender::ed::sculpt_paint::PuffOperationExecutor::execute(), blender::ed::sculpt_paint::SlideOperationExecutor::execute(), blender::ed::sculpt_paint::SmoothOperationExecutor::execute(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::execute(), blender::ed::sculpt_paint::greasepencil::find_curve_mapping_from_index(), blender::ed::greasepencil::grease_pencil_copy_strokes_exec(), blender::ed::greasepencil::grease_pencil_move_to_layer_exec(), blender::ed::greasepencil::grease_pencil_snap_to_cursor_exec(), blender::ed::greasepencil::retrieve_editable_and_selected_fill_strokes(), blender::ed::greasepencil::retrieve_editable_and_selected_strokes(), retrieve_selected_curves(), retrieve_selected_elements(), and blender::ed::greasepencil::retrieve_visible_bezier_handle_strokes().

◆ retrieve_selected_curves() [2/2]

IndexMask blender::ed::curves::retrieve_selected_curves ( const Curves & curves_id,
IndexMaskMemory & memory )

Definition at line 74 of file curves_selection.cc.

References Curves::geometry, and retrieve_selected_curves().

◆ retrieve_selected_elements()

IndexMask blender::ed::curves::retrieve_selected_elements ( const Curves & curves_id,
const bke::AttrDomain domain,
IndexMaskMemory & memory )
static

◆ retrieve_selected_points() [1/3]

◆ retrieve_selected_points() [2/3]

IndexMask blender::ed::curves::retrieve_selected_points ( const bke::CurvesGeometry & curves,
StringRef attribute_name,
const IndexMask & bezier_points,
IndexMaskMemory & memory )

Find points that are selected, for a given attribute_name, requires mask of all Bezier points. Note: When retrieving ".selection_handle_left" or ".selection_handle_right" all non-Bezier points will be deselected even if the raw attribute is selected.

Definition at line 106 of file curves_selection.cc.

References blender::IndexMask::from_bools(), and blender::bke::Point.

◆ retrieve_selected_points() [3/3]

IndexMask blender::ed::curves::retrieve_selected_points ( const Curves & curves_id,
IndexMaskMemory & memory )

Definition at line 121 of file curves_selection.cc.

References Curves::geometry, and retrieve_selected_points().

◆ select_adjacent() [1/2]

void blender::ed::curves::select_adjacent ( bke::CurvesGeometry & curves,
bool deselect )

(De)select all the adjacent points of the current selected points.

Parameters
curves_mask(optional) The curves that should be affected.

Definition at line 696 of file curves_selection.cc.

References select_adjacent().

◆ select_adjacent() [2/2]

◆ select_adjacent_mask() [1/2]

◆ select_adjacent_mask() [2/2]

IndexMask blender::ed::curves::select_adjacent_mask ( const bke::CurvesGeometry & curves,
StringRef attribute_name,
bool deselect,
IndexMaskMemory & memory )

Mask of points adjacent to a selected point, or unselected point if deselect is true.

Definition at line 1305 of file curves_selection.cc.

References select_adjacent_mask().

◆ select_all() [1/2]

void blender::ed::curves::select_all ( bke::CurvesGeometry & curves,
bke::AttrDomain selection_domain,
int action )

(De)select all the curves.

Parameters
mask(optional) The elements that should be affected. This mask should be in the domain of the selection_domain.
actionOne of SEL_TOGGLE, SEL_SELECT, SEL_DESELECT, or SEL_INVERT. See ED_select_utils.hh.

Definition at line 504 of file curves_selection.cc.

References select_all().

◆ select_all() [2/2]

◆ select_all_exec()

◆ select_alternate() [1/2]

void blender::ed::curves::select_alternate ( bke::CurvesGeometry & curves,
const bool deselect_ends )

Select alternated points in strokes with already selected points

Parameters
curves_mask(optional) The curves that should be affected.

Definition at line 603 of file curves_selection.cc.

References select_alternate().

◆ select_alternate() [2/2]

◆ select_box()

bool blender::ed::curves::select_box ( const ViewContext & vc,
bke::CurvesGeometry & curves,
const bke::crazyspace::GeometryDeformation & deformation,
const float4x4 & projection,
const IndexMask & selection_mask,
const IndexMask & bezier_mask,
bke::AttrDomain selection_domain,
const rcti & rect,
eSelectOp sel_op )

◆ select_box_mask()

IndexMask blender::ed::curves::select_box_mask ( const ViewContext & vc,
const bke::CurvesGeometry & curves,
const bke::crazyspace::GeometryDeformation & deformation,
const float4x4 & projection,
const IndexMask & selection_mask,
const IndexMask & bezier_mask,
bke::AttrDomain selection_domain,
StringRef attribute_name,
const rcti & rect,
IndexMaskMemory & memory )

◆ select_circle()

bool blender::ed::curves::select_circle ( const ViewContext & vc,
bke::CurvesGeometry & curves,
const bke::crazyspace::GeometryDeformation & deformation,
const float4x4 & projection,
const IndexMask & selection_mask,
const IndexMask & bezier_mask,
bke::AttrDomain selection_domain,
int2 coord,
float radius,
eSelectOp sel_op )

◆ select_circle_mask()

IndexMask blender::ed::curves::select_circle_mask ( const ViewContext & vc,
const bke::CurvesGeometry & curves,
const bke::crazyspace::GeometryDeformation & deformation,
const float4x4 & projection,
const IndexMask & selection_mask,
const IndexMask & bezier_mask,
bke::AttrDomain selection_domain,
StringRef attribute_name,
int2 coord,
float radius,
IndexMaskMemory & memory )

◆ select_ends_exec()

◆ select_ends_ui()

void blender::ed::curves::select_ends_ui ( bContext * ,
wmOperator * op )
static

◆ select_lasso()

bool blender::ed::curves::select_lasso ( const ViewContext & vc,
bke::CurvesGeometry & curves,
const bke::crazyspace::GeometryDeformation & deformation,
const float4x4 & projection,
const IndexMask & selection_mask,
const IndexMask & bezier_mask,
bke::AttrDomain selection_domain,
Span< int2 > lasso_coords,
eSelectOp sel_op )

◆ select_lasso_mask()

IndexMask blender::ed::curves::select_lasso_mask ( const ViewContext & vc,
const bke::CurvesGeometry & curves,
const bke::crazyspace::GeometryDeformation & deformation,
const float4x4 & projection,
const IndexMask & selection_mask,
const IndexMask & bezier_mask,
bke::AttrDomain selection_domain,
StringRef attribute_name,
Span< int2 > lasso_coords,
IndexMaskMemory & memory )

◆ select_less_exec()

wmOperatorStatus blender::ed::curves::select_less_exec ( bContext * C,
wmOperator *  )
static

◆ select_linked() [1/2]

void blender::ed::curves::select_linked ( bke::CurvesGeometry & curves)

Select the points of all curves that have at least one point selected.

Parameters
curves_mask(optional) The curves that should be affected.

Definition at line 545 of file curves_selection.cc.

References select_linked().

◆ select_linked() [2/2]

◆ select_linked_exec()

wmOperatorStatus blender::ed::curves::select_linked_exec ( bContext * C,
wmOperator *  )
static

◆ select_linked_pick()

◆ select_linked_pick_invoke()

wmOperatorStatus blender::ed::curves::select_linked_pick_invoke ( bContext * C,
wmOperator * op,
const wmEvent * event )
static

◆ select_mask_from_predicates()

template<typename PointSelectFn, typename LineSelectFn>
IndexMask blender::ed::curves::select_mask_from_predicates ( const bke::CurvesGeometry & curves,
const IndexMask & mask,
const bke::AttrDomain selection_domain,
IndexMaskMemory & memory,
PointSelectFn && point_predicate,
LineSelectFn && line_predicate )

◆ select_more_exec()

wmOperatorStatus blender::ed::curves::select_more_exec ( bContext * C,
wmOperator *  )
static

◆ select_random_exec()

◆ select_random_ui()

void blender::ed::curves::select_random_ui ( bContext * ,
wmOperator * op )
static

◆ selection_attribute_writer_by_name()

◆ separate_exec()

◆ separate_points()

◆ set_attribute_exec()

◆ set_attribute_invoke()

◆ set_attribute_ui()

◆ shift_end_by()

IndexRange blender::ed::curves::shift_end_by ( const IndexRange & range,
const int n )
static

Creates a new index range with the same beginning but a shifted end.

Definition at line 114 of file curves_extrude.cc.

References blender::IndexRange::from_begin_size(), blender::IndexRange::size(), and blender::IndexRange::start().

◆ split_points()

◆ stroke_elem_interp()

◆ stroke_elem_pressure_set()

◆ stroke_elem_project()

◆ stroke_elem_project_fallback()

bool blender::ed::curves::stroke_elem_project_fallback ( const CurveDrawData * cdd,
const int mval_i[2],
const float mval_fl[2],
const float surface_offset,
const float radius,
const float location_fallback_depth[3],
float r_location_world[3],
float r_location_local[3],
float r_normal_world[3],
float r_normal_local[3] )
static

◆ stroke_elem_project_fallback_elem()

◆ stroke_elem_radius()

float blender::ed::curves::stroke_elem_radius ( const CurveDrawData * cdd,
const StrokeElem * selem )
static

◆ stroke_elem_radius_from_pressure()

float blender::ed::curves::stroke_elem_radius_from_pressure ( const CurveDrawData * cdd,
const float pressure )
static

◆ transverts_from_curves_positions_create()

◆ undosys_type_register()

◆ validate_value()

Variable Documentation

◆ rna_enum_set_handle_type_items

const EnumPropertyItem blender::ed::curves::rna_enum_set_handle_type_items
Initial value:
= {
"AUTO",
0,
"Auto",
"The location is automatically calculated to be smooth"},
"VECTOR",
0,
"Vector",
"The location is calculated to point to the next/previous control point"},
"ALIGN",
0,
"Align",
"The location is constrained to point in the opposite direction as the other handle"},
"FREE_ALIGN",
0,
"Free",
"The handle can be moved anywhere, and does not influence the point's other handle"},
"TOGGLE_FREE_ALIGN",
0,
"Toggle Free/Align",
"Replace Free handles with Align, and all Align with Free handles"},
{0, nullptr, 0, nullptr, nullptr},
}

Definition at line 1792 of file curves_ops.cc.

Referenced by CURVES_OT_handle_type_set(), and blender::ed::greasepencil::GREASE_PENCIL_OT_set_handle_type().