Blender V4.3
blender::ed::curves Namespace Reference

Namespaces

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

Classes

struct  CurveDrawData
 
struct  FindClosestData
 
struct  StrokeElem
 

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 int set_attribute_exec (bContext *C, wmOperator *op)
 
static int 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)
 
void transverts_from_curves_positions_create (bke::CurvesGeometry &curves, TransVertStore *tvs)
 
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 int curves_draw_exec (bContext *C, wmOperator *op)
 
static int 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 int curves_draw_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static Span< intcompress_intervals (const Span< IndexRange > curve_interval_ranges, MutableSpan< int > intervals)
 
static bool handle_range (const int curve_index, const int interval_offset, const Span< int > offsets, int &current_interval, IndexRange &range, MutableSpan< int > curve_intervals, MutableSpan< bool > is_first_selected)
 
static void calc_curve_offset (const int curve_index, int &interval_offset, const Span< int > offsets, MutableSpan< int > new_offsets, MutableSpan< IndexRange > curve_interval_ranges)
 
static void finish_curve (int &curve_index, int &interval_offset, int last_interval, int last_elem, const Span< int > offsets, MutableSpan< int > new_offsets, MutableSpan< int > curve_intervals, MutableSpan< IndexRange > curve_interval_ranges, MutableSpan< bool > is_first_selected)
 
static void finish_curve_or_full_copy (int &curve_index, int &interval_offset, int current_interval, const std::optional< IndexRange > prev_range, const Span< int > offsets, MutableSpan< int > new_offsets, MutableSpan< int > curve_intervals, MutableSpan< IndexRange > curve_interval_ranges, MutableSpan< bool > is_first_selected)
 
static void calc_curves_extrusion (const IndexMask &selection, const Span< int > offsets, MutableSpan< int > new_offsets, MutableSpan< int > curve_intervals, MutableSpan< IndexRange > curve_interval_ranges, MutableSpan< bool > is_first_selected)
 
static void extrude_curves (Curves &curves_id)
 
static int 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 int select_all_exec (bContext *C, wmOperator *op)
 
static void CURVES_OT_select_all (wmOperatorType *ot)
 
static int select_random_exec (bContext *C, wmOperator *op)
 
static void select_random_ui (bContext *, wmOperator *op)
 
static void CURVES_OT_select_random (wmOperatorType *ot)
 
static int select_ends_exec (bContext *C, wmOperator *op)
 
static void select_ends_ui (bContext *, wmOperator *op)
 
static void CURVES_OT_select_ends (wmOperatorType *ot)
 
static int select_linked_exec (bContext *C, wmOperator *)
 
static void CURVES_OT_select_linked (wmOperatorType *ot)
 
static int select_more_exec (bContext *C, wmOperator *)
 
static void CURVES_OT_select_more (wmOperatorType *ot)
 
static int select_less_exec (bContext *C, wmOperator *)
 
static void CURVES_OT_select_less (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)
 
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)
 
Span< float3get_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, Span< StringRef > &r_bezier_attribute_names, Span< float3 > &r_positions, 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, SelectionRangeFn range_consumer)
 
void foreach_selectable_curve_range (const bke::CurvesGeometry &curves, const bke::crazyspace::GeometryDeformation &deformation, SelectionRangeFn range_consumer)
 
static bool contains (const VArray< bool > &varray, const IndexMask &indices_to_check, const bool value)
 
static bool contains (const VArray< bool > &varray, const IndexRange range_to_check, const bool value)
 
static void invert_selection (MutableSpan< float > selection)
 
static void invert_selection (GMutableSpan selection)
 
static void invert_selection (MutableSpan< float > selection, const IndexMask &mask)
 
static void invert_selection (GMutableSpan selection, const IndexMask &mask)
 
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, 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)
 
Operators
void CURVES_OT_attribute_set (wmOperatorType *ot)
 
void CURVES_OT_draw (wmOperatorType *ot)
 
void CURVES_OT_extrude (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)
 
Editing
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)
 
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)
 
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)
 
IndexMask random_mask (const bke::CurvesGeometry &curves, const IndexMask &mask, const bke::AttrDomain selection_domain, const uint32_t random_seed, const float probability, IndexMaskMemory &memory)
 
IndexMask random_mask (const bke::CurvesGeometry &curves, const bke::AttrDomain selection_domain, const uint32_t random_seed, const float probability, 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_selected_points (const bke::CurvesGeometry &curves, StringRef attribute_name, 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, eCustomDataType 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_matrix, 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)
 

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

Initial value:
FunctionRef<void(
IndexRange range, Span<float3> positions, StringRef selection_attribute_name)>

Definition at line 84 of file ED_curves.hh.

Enumeration Type Documentation

◆ CurveDrawState

Enumerator
CURVE_DRAW_IDLE 
CURVE_DRAW_PAINTING 

Definition at line 69 of file curves_draw.cc.

Function Documentation

◆ active_attribute_poll()

static 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_primitive_curve()

◆ apply_selection_operation_at_index()

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

◆ calc_curve_offset()

static void blender::ed::curves::calc_curve_offset ( const int curve_index,
int & interval_offset,
const Span< int > offsets,
MutableSpan< int > new_offsets,
MutableSpan< IndexRange > curve_interval_ranges )
static

Calculates number of points in resulting curve denoted by #curve_index and sets its #curve_offsets value.

Definition at line 80 of file curves_extrude.cc.

References blender::MutableSpan< T >::size().

Referenced by finish_curve(), and finish_curve_or_full_copy().

◆ calc_curves_extrusion()

static void blender::ed::curves::calc_curves_extrusion ( const IndexMask & selection,
const Span< int > offsets,
MutableSpan< int > new_offsets,
MutableSpan< int > curve_intervals,
MutableSpan< IndexRange > curve_interval_ranges,
MutableSpan< bool > is_first_selected )
static

Definition at line 158 of file curves_extrude.cc.

References finish_curve(), handle_range(), and range.

Referenced by extrude_curves().

◆ 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 )

Find the closest screen-space point or curve in projected region-space.

Returns
A new point or curve closer than the initial input, if one exists.

Definition at line 892 of file curves_selection.cc.

References BLI_assert_unreachable, closest_elem_find_screen_space(), ED_view3d_select_dist_px(), find_closest_curve_to_screen_co(), find_closest_point_to_screen_co(), and ViewContext::region.

Referenced by closest_elem_find_screen_space().

◆ compress_intervals()

static Span< int > blender::ed::curves::compress_intervals ( const Span< IndexRange > curve_interval_ranges,
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 curve, blender::MutableSpan< T >::data(), blender::Span< T >::last(), and blender::Span< T >::size().

◆ contains() [1/2]

◆ contains() [2/2]

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

Definition at line 405 of file curves_selection.cc.

◆ create_Bezier()

static 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()

static 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()

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

Definition at line 1138 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()

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

Definition at line 577 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, 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()

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

Definition at line 321 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()

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

◆ curve_draw_stroke_to_operator_elem()

static void blender::ed::curves::curve_draw_stroke_to_operator_elem ( wmOperator * op,
const StrokeElem * selem )
static

◆ 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 19 of file curves_masks.cc.

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

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

◆ curves_draw_exec()

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

Definition at line 733 of file curves_draw.cc.

References blender::bke::attribute_filter_from_skip_ref(), BLI_mempool_iternew(), BLI_mempool_iterstep(), BLI_mempool_len(), 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, blender::bke::CurvesGeometry::curves_num(), wmOperator::customdata, Object::data, DEG_id_tag_update(), blender::bke::fill_attribute_range_default(), blender::bke::AttributeWriter< T >::finish(), CurvePaintSettings::flag, free(), Curves::geometry, get_curves_all_selection_attribute_names(), get_curves_bezier_selection_attribute_names(), get_curves_selection_attribute_names(), invert_m4_m4(), blender::ed::curves::CurveDrawData::is_curve_2d, is_cyclic(), blender::ed::curves::StrokeElem::location_local, M_PI, MEM_freeN(), MEM_mallocN, 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::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()

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

Definition at line 1045 of file curves_draw.cc.

References BKE_report(), 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, ViewContext::rv3d, blender::ed::curves::CurveDrawData::sample, ViewContext::scene, View3D::shading, Scene::toolsettings, ARegion::type, View3DShading::type, blender::ed::curves::CurveDrawData::use_depth, blender::ed::curves::CurveDrawData::use_plane, blender::ed::curves::CurveDrawData::use_substeps, ViewContext::v3d, V3D_DEPTH_NO_OVERLAYS, V3D_DEPTH_SELECTED_ONLY, blender::ed::curves::CurveDrawData::vc, view3d_operator_needs_opengl(), 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()

static int blender::ed::curves::curves_extrude_exec ( bContext * C,
wmOperator *  )
static

◆ CURVES_OT_add_bezier()

◆ CURVES_OT_add_circle()

◆ CURVES_OT_attribute_set()

◆ CURVES_OT_convert_from_particle_system()

◆ CURVES_OT_convert_to_particle_system()

◆ CURVES_OT_curve_type_set()

◆ CURVES_OT_cyclic_toggle()

◆ CURVES_OT_delete()

◆ CURVES_OT_draw()

◆ CURVES_OT_duplicate()

◆ CURVES_OT_extrude()

◆ CURVES_OT_handle_type_set()

◆ CURVES_OT_select_all()

◆ CURVES_OT_select_ends()

◆ CURVES_OT_select_less()

◆ CURVES_OT_select_linked()

◆ CURVES_OT_select_more()

◆ CURVES_OT_select_random()

◆ CURVES_OT_set_selection_domain()

◆ CURVES_OT_snap_curves_to_surface()

◆ CURVES_OT_subdivide()

◆ CURVES_OT_surface_set()

◆ CURVES_OT_switch_direction()

◆ CURVES_OT_tilt_clear()

◆ curves_poll()

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

Definition at line 166 of file curves_ops.cc.

References curves_poll_impl().

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

◆ curves_poll_impl()

static 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)

Definition at line 156 of file curves_ops.cc.

References curves_poll_impl().

Referenced by CURVES_OT_convert_to_particle_system().

◆ duplicate_curves()

◆ duplicate_points()

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

Definition at line 41 of file curves_edit.cc.

References blender::offset_indices::accumulate_counts_to_offsets(), blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), blender::Vector< T, InlineBufferCapacity, Allocator >::as_span(), BLI_assert_unreachable, blender::array_utils::copy(), blender::bke::Curve, blender::bke::AttributeIter::domain, blender::MutableSpan< T >::drop_back(), blender::IndexRange::drop_front(), blender::MutableSpan< T >::drop_front(), blender::array_utils::fill_index_range(), blender::array_utils::find_all_ranges(), blender::IndexRange::first(), blender::Vector< T, InlineBufferCapacity, Allocator >::first(), blender::bke::attribute_math::gather(), get_curves_selection_attribute_names(), blender::VArrayCommon< T >::get_internal_single(), blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), is_cyclic(), blender::Vector< T, InlineBufferCapacity, Allocator >::is_empty(), blender::VArrayCommon< T >::is_single(), blender::Vector< T, InlineBufferCapacity, Allocator >::last(), blender::bke::AttributeIter::name, blender::bke::Point, remove_selection_attributes(), blender::IndexRange::size(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), blender::bke::SpanAttributeWriter< T >::span, and blender::IndexRange::start().

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

◆ editable_curves_in_edit_mode_poll()

◆ editable_curves_point_domain_poll()

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

◆ editable_curves_poll()

◆ editable_curves_with_surface_poll()

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

Definition at line 151 of file curves_ops.cc.

References 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 59 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,
eCustomDataType create_type,
StringRef attribute_name = ".selection" )

◆ ensure_surface_deformation_node_exists()

◆ extrude_curves()

◆ fill_selection()

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

Definition at line 315 of file curves_selection.cc.

◆ fill_selection_false() [1/2]

void blender::ed::curves::fill_selection_false ( GMutableSpan selection)

◆ fill_selection_false() [2/2]

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

Definition at line 325 of file curves_selection.cc.

References blender::index_mask::masked_fill().

◆ fill_selection_true() [1/2]

void blender::ed::curves::fill_selection_true ( GMutableSpan selection)

◆ fill_selection_true() [2/2]

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

Definition at line 335 of file curves_selection.cc.

References blender::index_mask::masked_fill().

◆ find_closest_curve_to_screen_co()

static 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()

static 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,
float radius,
const FindClosestData & initial_closest )
static

◆ finish_attribute_writers()

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

Definition at line 151 of file curves_selection.cc.

Referenced by foreach_selection_attribute_writer(), and select_linked().

◆ finish_curve()

static void blender::ed::curves::finish_curve ( int & curve_index,
int & interval_offset,
int last_interval,
int last_elem,
const Span< int > offsets,
MutableSpan< int > new_offsets,
MutableSpan< int > curve_intervals,
MutableSpan< IndexRange > curve_interval_ranges,
MutableSpan< bool > is_first_selected )
static

Definition at line 92 of file curves_extrude.cc.

References calc_curve_offset().

Referenced by calc_curves_extrusion(), and finish_curve_or_full_copy().

◆ finish_curve_or_full_copy()

static void blender::ed::curves::finish_curve_or_full_copy ( int & curve_index,
int & interval_offset,
int current_interval,
const std::optional< IndexRange > prev_range,
const Span< int > offsets,
MutableSpan< int > new_offsets,
MutableSpan< int > curve_intervals,
MutableSpan< IndexRange > curve_interval_ranges,
MutableSpan< bool > is_first_selected )
static

Definition at line 123 of file curves_extrude.cc.

References calc_curve_offset(), and finish_curve().

◆ foreach_selectable_curve_range()

void blender::ed::curves::foreach_selectable_curve_range ( const bke::CurvesGeometry & curves,
const bke::crazyspace::GeometryDeformation & deformation,
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 233 of file curves_selection.cc.

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

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

◆ foreach_selectable_point_range()

void blender::ed::curves::foreach_selectable_point_range ( const bke::CurvesGeometry & curves,
const bke::crazyspace::GeometryDeformation & deformation,
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 204 of file curves_selection.cc.

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

Referenced by 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 )

Definition at line 174 of file curves_selection.cc.

References finish_attribute_writers(), and init_selection_writers().

Referenced by append_primitive_curve(), and select_all().

◆ 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 102 of file curves_selection.cc.

Referenced by curves_draw_exec(), and init_selectable_foreach().

◆ 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 names need for given curve and domain. Possible outcomes: [".selection", ".selection_handle_left", ".selection_handle_right"] if Bezier curves are present, [".selection"] otherwise.

Definition at line 86 of file curves_selection.cc.

References get_curves_all_selection_attribute_names().

Referenced by blender::ed::transform::curves::createTransCurvesVerts(), blender::ed::transform::greasepencil::createTransGreasePencilVerts(), curves_draw_exec(), blender::ed::curves::set_selection_domain::curves_set_selection_domain_exec(), duplicate_curves(), duplicate_points(), extrude_curves(), has_anything_selected(), and init_selection_writers().

◆ get_selection_attribute_positions()

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

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

Definition at line 120 of file curves_selection.cc.

References BLI_assert_unreachable.

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

◆ get_unique_editable_curves()

◆ handle_range()

static bool blender::ed::curves::handle_range ( const int curve_index,
const int interval_offset,
const Span< int > offsets,
int & current_interval,
IndexRange & range,
MutableSpan< int > curve_intervals,
MutableSpan< bool > is_first_selected )
static

Creates copy intervals for selection #range in the context of #curve_index. If part of the #range is outside given curve, slices it and returns false indicating remaining still needs to be handled. If whole #range was handled returns true.

Definition at line 44 of file curves_extrude.cc.

References blender::MutableSpan< T >::first(), and blender::MutableSpan< T >::last().

Referenced by calc_curves_extrusion().

◆ 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 420 of file curves_selection.cc.

References has_anything_selected().

◆ has_anything_selected() [2/7]

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

Definition at line 426 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 446 of file curves_selection.cc.

References has_anything_selected().

◆ 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 415 of file curves_selection.cc.

References has_anything_selected().

◆ has_anything_selected() [7/7]

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

◆ has_surface_deformation_node() [1/2]

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

◆ has_surface_deformation_node() [2/2]

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

◆ init_selectable_foreach()

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

◆ init_selection_writers()

◆ invert_selection() [1/4]

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

Definition at line 470 of file curves_selection.cc.

References invert_selection().

◆ invert_selection() [2/4]

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

Definition at line 486 of file curves_selection.cc.

References invert_selection().

◆ invert_selection() [3/4]

static void blender::ed::curves::invert_selection ( MutableSpan< float > selection)
static

◆ invert_selection() [4/4]

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

Definition at line 480 of file curves_selection.cc.

References invert_selection().

◆ keymap_curves()

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

◆ object_has_editable_curves()

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

◆ operatormacros_curves()

void blender::ed::curves::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 43 of file curves_data.cc.

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

◆ primitive_random_sphere()

◆ random_mask() [1/2]

IndexMask blender::ed::curves::random_mask ( const bke::CurvesGeometry & curves,
bke::AttrDomain selection_domain,
uint32_t random_seed,
float probability,
IndexMaskMemory & memory )

Return a mask of random points or curves.

Parameters
mask(optional): The elements that should be used in the resulting mask. This mask should be in the same domain as the selection_domain.
random_seedThe seed for the RandomNumberGenerator.
probabilityDetermines how likely a point/curve will be chosen. If set to 0.0, nothing will be in the mask, if set to 1.0 everything will be in the mask.

Definition at line 87 of file curves_masks.cc.

References random_mask(), and selection.

◆ random_mask() [2/2]

IndexMask blender::ed::curves::random_mask ( const bke::CurvesGeometry & curves,
const IndexMask & mask,
const bke::AttrDomain selection_domain,
const uint32_t random_seed,
const float probability,
IndexMaskMemory & memory )

◆ 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 19 of file curves_edit.cc.

References BLI_assert_unreachable, blender::bke::Curve, blender::index_mask::IndexMask::from_bools(), 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 112 of file curves_selection.cc.

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

◆ 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 249 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::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::AttributeIter::data_type, blender::bke::AttributeIter::domain, blender::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(), blender::Span< T >::last(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), blender::bke::AttributeIter::name, 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::index_mask::IndexMask::size(), blender::IndexRange::size(), blender::Span< T >::size(), blender::bke::GSpanAttributeWriter::span, blender::index_mask::IndexMask::to_range(), and blender::bke::CurvesGeometry::update_curve_types().

◆ 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, blender::index_mask::IndexMask::from_bools(), blender::index_mask::IndexMask::from_predicate(), blender::VArrayCommon< T >::get_internal_single(), blender::bke::AttributeAccessor::lookup_meta_data(), and blender::bke::Point.

Referenced by blender::ed::spreadsheet::GeometryDataSource::apply_selection_filter(), blender::ed::curves::curves_duplicate::delete_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::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::retrieve_editable_and_selected_fill_strokes(), blender::ed::greasepencil::retrieve_editable_and_selected_strokes(), retrieve_selected_curves(), and retrieve_selected_elements().

◆ retrieve_selected_curves() [2/2]

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

Definition at line 60 of file curves_selection.cc.

References Curves::geometry, and retrieve_selected_curves().

◆ retrieve_selected_elements()

static 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,
IndexMaskMemory & memory )

◆ retrieve_selected_points() [3/3]

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

Definition at line 80 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 704 of file curves_selection.cc.

References select_adjacent().

◆ select_adjacent() [2/2]

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

◆ select_adjacent_mask() [1/2]

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

◆ 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 1341 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 526 of file curves_selection.cc.

References select_all(), and selection.

◆ 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 611 of file curves_selection.cc.

References select_alternate().

◆ select_alternate() [2/2]

◆ select_box()

◆ 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()

◆ 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()

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

◆ select_lasso()

◆ 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()

static int 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 562 of file curves_selection.cc.

References select_linked().

◆ select_linked() [2/2]

◆ select_linked_exec()

static int blender::ed::curves::select_linked_exec ( bContext * C,
wmOperator *  )
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()

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

◆ select_random_exec()

◆ select_random_ui()

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

◆ selection_attribute_writer_by_name()

◆ set_attribute_exec()

◆ set_attribute_invoke()

◆ set_attribute_ui()

◆ stroke_elem_interp()

static void blender::ed::curves::stroke_elem_interp ( StrokeElem * selem_out,
const StrokeElem * selem_a,
const StrokeElem * selem_b,
float t )
static

◆ stroke_elem_pressure_set()

◆ stroke_elem_project()

◆ stroke_elem_project_fallback()

static 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()

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

◆ stroke_elem_radius_from_pressure()

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

◆ transverts_from_curves_positions_create()

void blender::ed::curves::transverts_from_curves_positions_create ( bke::CurvesGeometry & curves,
TransVertStore * tvs )

Allocate an array of TransVert for cursor/selection snapping (See ED_transverts_create_from_obedit in view3d_snap.cc).

Note
The TransVert elements in tvs are expected to write to the positions of curves.

Definition at line 25 of file curves_data.cc.

References copy_v3_v3(), TransVert::flag, TransVert::loc, MEM_calloc_arrayN, TransVert::oldloc, pos, retrieve_selected_points(), SELECT, TransVertStore::transverts, and TransVertStore::transverts_tot.

Referenced by ED_transverts_create_from_obedit().

◆ undosys_type_register()

◆ validate_value()

static void blender::ed::curves::validate_value ( const bke::AttributeAccessor attributes,
const StringRef name,
const CPPType & type,
void * buffer )
static