|
Blender V4.3
|
#include "DNA_curve_types.h"#include "DNA_windowmanager_types.h"#include "MEM_guardedalloc.h"#include "BLI_listbase.h"#include "BLI_math_geom.h"#include "BLI_math_matrix.h"#include "BLI_math_vector.h"#include "BKE_context.hh"#include "BKE_curve.hh"#include "DEG_depsgraph.hh"#include "WM_api.hh"#include "ED_curve.hh"#include "ED_screen.hh"#include "ED_select_utils.hh"#include "ED_view3d.hh"#include "curve_intern.hh"#include "RNA_access.hh"#include "RNA_define.hh"#include <cfloat>Go to the source code of this file.
Classes | |
| struct | CutData |
| struct | MoveSegmentData |
| struct | CurvePenData |
Macros | |
| #define | FOREACH_SELECTED_BEZT_BEGIN(bezt, nurbs) |
| #define | FOREACH_SELECTED_BEZT_END |
| #define | SEL_DIST_FACTOR 0.2f |
Enumerations | |
| enum | eClose_opt { OFF = 0 , ON_PRESS = 1 , ON_CLICK = 2 } |
| enum | { PEN_MODAL_FREE_ALIGN_TOGGLE = 1 , PEN_MODAL_MOVE_ADJACENT , PEN_MODAL_MOVE_ENTIRE , PEN_MODAL_LINK_HANDLES , PEN_MODAL_LOCK_ANGLE } |
Functions | |
| static void | update_location_for_2d_curve (const ViewContext *vc, float location[3]) |
| static void | screenspace_to_worldspace (const ViewContext *vc, const float pos_2d[2], const float depth[3], float r_pos_3d[3]) |
| static void | screenspace_to_worldspace_int (const ViewContext *vc, const int pos_2d[2], const float depth[3], float r_pos_3d[3]) |
| static bool | worldspace_to_screenspace (const ViewContext *vc, const float pos_3d[3], float r_pos_2d[2]) |
| static void | move_bezt_by_displacement (BezTriple *bezt, const float disp_3d[3]) |
| static void | move_bezt_to_location (BezTriple *bezt, const float location[3]) |
| static void | remove_handle_movement_constraints (BezTriple *bezt, const bool f1, const bool f3) |
| static void | move_bezt_handle_or_vertex_by_displacement (const ViewContext *vc, BezTriple *bezt, const int bezt_idx, const float disp_2d[2], const float distance, const bool link_handles, const bool lock_angle) |
| static void | move_bp_to_location (const ViewContext *vc, BPoint *bp, const float mval[2]) |
| static bool | get_selected_center (const ListBase *nurbs, const bool mid_only, const bool bezt_only, float r_center[3]) |
| static void | move_all_selected_points (const ViewContext *vc, const wmEvent *event, CurvePenData *cpd, ListBase *nurbs, const bool bezt_only) |
| static int | get_nurb_index (const ListBase *nurbs, const Nurb *nurb) |
| static void | delete_nurb (Curve *cu, Nurb *nu) |
| static void | delete_bezt_from_nurb (const BezTriple *bezt, Nurb *nu, EditNurb *editnurb) |
| static void | delete_bp_from_nurb (const BPoint *bp, Nurb *nu, EditNurb *editnurb) |
| static bool | get_closest_vertex_to_point_in_nurbs (const ViewContext *vc, const ListBase *nurbs, const float point[2], Nurb **r_nu, BezTriple **r_bezt, BPoint **r_bp, int *r_bezt_idx) |
| static void | get_bezier_interpolated_point (const BezTriple *bezt1, const BezTriple *bezt2, const float parameter, float r_point[3]) |
| static void | calculate_new_bezier_point (const float point_prev[3], float handle_prev[3], float new_left_handle[3], float new_right_handle[3], float handle_next[3], const float point_next[3], const float parameter) |
| static bool | is_cyclic (const Nurb *nu) |
| static void | insert_bezt_to_nurb (Nurb *nu, const CutData *data, Curve *cu) |
| static void | insert_bp_to_nurb (Nurb *nu, const CutData *data, Curve *cu) |
| static void | get_updated_data_for_edge (const float point[2], const float point1[2], const float point2[2], const int point_idx, const int resolu_idx, float *r_min_dist, int *r_min_i, float *r_param) |
| static void | update_cut_data_for_nurb (const ViewContext *vc, CutData *cd, Nurb *nu, const int resolu, const float point[2]) |
| static bool | update_cut_data_for_all_nurbs (const ViewContext *vc, const ListBase *nurbs, const float point[2], const float sel_dist, CutData *cd) |
| static CutData | init_cut_data (const wmEvent *event) |
| static bool | insert_point_to_segment (const ViewContext *vc, const wmEvent *event) |
| static void | get_first_selected_point (Curve *cu, View3D *v3d, Nurb **r_nu, BezTriple **r_bezt, BPoint **r_bp) |
| static void | extrude_vertices_from_selected_endpoints (EditNurb *editnurb, ListBase *nurbs, Curve *cu, const float disp_3d[3]) |
| static void | deselect_all_center_vertices (ListBase *nurbs) |
| static bool | is_last_bezt (const Nurb *nu, const BezTriple *bezt) |
| static void | extrude_points_from_selected_vertices (const ViewContext *vc, const wmEvent *event, const int extrude_handle) |
| static bool | is_spline_nearby (ViewContext *vc, wmOperator *op, const wmEvent *event, const float sel_dist) |
| static void | move_segment (const ViewContext *vc, MoveSegmentData *seg_data, const wmEvent *event) |
| static void | toggle_bezt_free_align_handles (BezTriple *bezt) |
| static void | toggle_sel_bezt_free_align_handles (ListBase *nurbs) |
| static bool | delete_point_under_mouse (const ViewContext *vc, const wmEvent *event) |
| static void | move_adjacent_handle (const ViewContext *vc, const wmEvent *event, ListBase *nurbs) |
| static bool | make_cyclic_if_endpoints (const ViewContext *vc, Nurb *sel_nu, BezTriple *sel_bezt, BPoint *sel_bp) |
| static void | init_selected_bezt_handles (ListBase *nurbs) |
| static void | toggle_select_bezt (BezTriple *bezt, const int bezt_idx, Curve *cu, Nurb *nu) |
| static void | toggle_select_bp (BPoint *bp, Curve *cu, Nurb *nu) |
| static void | toggle_handle_types (BezTriple *bezt, int bezt_idx, CurvePenData *cpd) |
| static void | cycle_handles (BezTriple *bezt) |
| wmKeyMap * | curve_pen_modal_keymap (wmKeyConfig *keyconf) |
| static int | curve_pen_modal (bContext *C, wmOperator *op, const wmEvent *event) |
| static int | curve_pen_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
| void | CURVE_OT_pen (wmOperatorType *ot) |
Variables | |
| static const EnumPropertyItem | prop_handle_types [] |
| static const EnumPropertyItem | prop_close_spline_method [] |
| #define FOREACH_SELECTED_BEZT_BEGIN | ( | bezt, | |
| nurbs ) |
Definition at line 38 of file editcurve_pen.cc.
Referenced by extrude_points_from_selected_vertices(), init_selected_bezt_handles(), move_adjacent_handle(), and toggle_sel_bezt_free_align_handles().
| #define FOREACH_SELECTED_BEZT_END |
Definition at line 45 of file editcurve_pen.cc.
Referenced by extrude_points_from_selected_vertices(), init_selected_bezt_handles(), move_adjacent_handle(), and toggle_sel_bezt_free_align_handles().
| #define SEL_DIST_FACTOR 0.2f |
Definition at line 54 of file editcurve_pen.cc.
Referenced by curve_pen_invoke(), curve_pen_modal(), get_closest_vertex_to_point_in_nurbs(), and insert_point_to_segment().
| anonymous enum |
| Enumerator | |
|---|---|
| PEN_MODAL_FREE_ALIGN_TOGGLE | |
| PEN_MODAL_MOVE_ADJACENT | |
| PEN_MODAL_MOVE_ENTIRE | |
| PEN_MODAL_LINK_HANDLES | |
| PEN_MODAL_LOCK_ANGLE | |
Definition at line 1504 of file editcurve_pen.cc.
| enum eClose_opt |
| Enumerator | |
|---|---|
| OFF | |
| ON_PRESS | |
| ON_CLICK | |
Definition at line 130 of file editcurve_pen.cc.
|
static |
Calculate handle positions of added and adjacent control points such that shape is preserved.
Definition at line 576 of file editcurve_pen.cc.
References interp_v3_v3v3().
Referenced by insert_bezt_to_nurb().
| void CURVE_OT_pen | ( | wmOperatorType * | ot | ) |
Definition at line 1836 of file editcurve_pen.cc.
References curve_pen_invoke(), curve_pen_modal(), wmOperatorType::description, ED_operator_editcurve(), wmOperatorType::flag, HD_VECT, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OFF, OPTYPE_UNDO, ot, wmOperatorType::poll, prop_close_spline_method, prop_handle_types, RNA_def_boolean(), RNA_def_enum(), wmOperatorType::srna, and WM_operator_properties_mouse_select().
Referenced by ED_operatortypes_curve().
|
static |
Definition at line 1747 of file editcurve_pen.cc.
References CurvePenData::bezt, BEZT_ISSEL_IDX, BEZT_SEL_IDX, BKE_curve_nurb_vert_active_set(), CurvePenData::bp, CurvePenData::changed, copy_v2_v2_int(), CTX_data_ensure_evaluated_depsgraph(), wmOperator::customdata, Object::data, depsgraph, ED_curve_deselect_all(), ED_view3d_select_dist_px(), ED_view3d_viewcontext_init(), Curve::editnurb, ELEM, extrude_points_from_selected_vertices(), BPoint::f1, float, CurvePenData::found_point, get_closest_vertex_to_point_in_nurbs(), get_first_selected_point(), Nurb::hide, insert_point_to_segment(), is_cyclic(), is_spline_nearby(), KM_DBL_CLICK, KM_PRESS, LEFTMOUSE, CurvePenData::link_handles, make_cyclic_if_endpoints(), MEM_callocN, ViewContext::mval, wmEvent::mval, CurvePenData::new_point, CurvePenData::nu, EditNurb::nurbs, ViewContext::obedit, ON_PRESS, OPERATOR_RUNNING_MODAL, wmOperator::ptr, RNA_boolean_get(), RNA_enum_get(), SEL_DIST_FACTOR, SELECT, CurvePenData::selection_made, CurvePenData::spline_nearby, wmEvent::type, ViewContext::v3d, wmEvent::val, and WM_event_add_modal_handler().
Referenced by CURVE_OT_pen().
|
static |
Definition at line 1557 of file editcurve_pen.cc.
References CurvePenData::bezt, Nurb::bezt, MoveSegmentData::bezt_index, BKE_nurb_bezt_get_next(), BKE_nurb_handles_calc(), CurvePenData::bp, CurvePenData::changed, copy_v2_v2_int(), CTX_data_edit_object(), CTX_data_ensure_evaluated_depsgraph(), CU_BEZIER, wmOperator::customdata, cycle_handles(), Object::data, DEG_id_tag_update(), delete_point_under_mouse(), depsgraph, CurvePenData::dragging, ED_curve_deselect_all(), ED_curve_editnurb_select_pick(), ED_view3d_select_dist_px(), ED_view3d_viewcontext_init(), Curve::editnurb, ELEM, EVT_MODAL_MAP, extrude_points_from_selected_vertices(), float, CurvePenData::found_point, get_closest_vertex_to_point_in_nurbs(), init_selected_bezt_handles(), insert_point_to_segment(), is_cyclic(), ISMOUSE_MOTION, KM_DBL_CLICK, KM_RELEASE, KM_SHIFT, LEFTMOUSE, CurvePenData::link_handles, CurvePenData::lock_angle, make_cyclic_if_endpoints(), MEM_callocN, MEM_freeN(), CurvePenData::move_adjacent, move_adjacent_handle(), move_all_selected_points(), CurvePenData::move_entire, move_segment(), CurvePenData::msd, ViewContext::mval, wmEvent::mval, NC_GEOM, ND_DATA, ND_SELECT, CurvePenData::new_point, CurvePenData::nu, MoveSegmentData::nu, EditNurb::nurbs, ViewContext::obedit, ON_CLICK, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, params, PEN_MODAL_FREE_ALIGN_TOGGLE, PEN_MODAL_LINK_HANDLES, PEN_MODAL_LOCK_ANGLE, PEN_MODAL_MOVE_ADJACENT, PEN_MODAL_MOVE_ENTIRE, wmEvent::prev_press_xy, wmOperator::ptr, ret, RNA_boolean_get(), RNA_enum_get(), SEL_DIST_FACTOR, SEL_OP_SET, CurvePenData::select_multi, CurvePenData::selection_made, CurvePenData::spline_nearby, toggle_bezt_free_align_handles(), toggle_handle_types(), toggle_sel_bezt_free_align_handles(), toggle_select_bezt(), toggle_select_bp(), Nurb::type, wmEvent::type, wmEvent::val, WM_event_add_notifier(), and WM_event_drag_test().
Referenced by CURVE_OT_pen().
| wmKeyMap * curve_pen_modal_keymap | ( | wmKeyConfig * | keyconf | ) |
Definition at line 1512 of file editcurve_pen.cc.
References wmKeyMap::modal_items, PEN_MODAL_FREE_ALIGN_TOGGLE, PEN_MODAL_LINK_HANDLES, PEN_MODAL_LOCK_ANGLE, PEN_MODAL_MOVE_ADJACENT, PEN_MODAL_MOVE_ENTIRE, WM_modalkeymap_assign(), WM_modalkeymap_ensure(), and WM_modalkeymap_find().
Referenced by ED_keymap_curve().
|
static |
Definition at line 1488 of file editcurve_pen.cc.
References BezTriple::h1, BezTriple::h2, HD_ALIGN, HD_AUTO, HD_FREE, and HD_VECT.
Referenced by curve_pen_modal().
Definition at line 448 of file editcurve_pen.cc.
References Nurb::bezt, BKE_curve_editNurb_keyIndex_delCV(), BKE_curve_nurb_vert_index_get(), BLI_assert, CU_BEZIER, EditNurb::keyindex, Nurb::pntsu, and Nurb::type.
Referenced by delete_point_under_mouse().
Definition at line 457 of file editcurve_pen.cc.
References BKE_curve_editNurb_keyIndex_delCV(), BKE_curve_nurb_vert_index_get(), BLI_assert, Nurb::bp, CU_NURBS, CU_POLY, EditNurb::keyindex, Nurb::pntsu, and Nurb::type.
Referenced by delete_point_under_mouse().
Definition at line 435 of file editcurve_pen.cc.
References Curve::actnu, BKE_curve_nurb_vert_active_set(), BKE_nurb_free(), BLI_remlink(), Curve::editnurb, get_nurb_index(), and EditNurb::nurbs.
Referenced by delete_point_under_mouse().
|
static |
If a point is found under mouse, delete point and return true. Else return false.
Definition at line 1293 of file editcurve_pen.cc.
References Curve::actvert, BKE_curve_editNurbs_get(), BKE_curve_nurb_vert_index_get(), BKE_nurb_bezt_get_next(), BKE_nurb_bezt_get_prev(), BKE_nurb_handles_calc(), CU_ACT_NONE, CU_BEZIER, Object::data, delete_bezt_from_nurb(), delete_bp_from_nurb(), delete_nurb(), ED_curve_deselect_all(), ed_dissolve_bez_segment(), Curve::editnurb, float, get_closest_vertex_to_point_in_nurbs(), wmEvent::mval, ViewContext::obedit, Nurb::pntsu, and Nurb::type.
Referenced by curve_pen_modal().
|
static |
Deselect all vertices that are not endpoints.
Definition at line 1060 of file editcurve_pen.cc.
References BEZT_DESEL_ALL, CU_BEZIER, is_cyclic(), LISTBASE_FOREACH, and SELECT.
Referenced by extrude_points_from_selected_vertices().
|
static |
Add new vertices connected to the selected vertices.
Definition at line 1093 of file editcurve_pen.cc.
References Nurb::bezt, BKE_curve_editNurbs_get(), BKE_curve_nurb_vert_active_set(), Nurb::bp, copy_v3_v3(), Scene::cursor, Object::data, deselect_all_center_vertices(), ed_editcurve_addvert(), ED_view3d_win_to_3d_int(), Curve::editnurb, extrude_vertices_from_selected_endpoints(), Nurb::flagu, FOREACH_SELECTED_BEZT_BEGIN, FOREACH_SELECTED_BEZT_END, get_selected_center(), ListBase::last, View3DCursor::location, mul_v3_m4v3(), wmEvent::mval, EditNurb::nurbs, ViewContext::obedit, ViewContext::region, ViewContext::scene, sub_v3_v3v3(), update_location_for_2d_curve(), and ViewContext::v3d.
Referenced by curve_pen_invoke(), and curve_pen_modal().
|
static |
Definition at line 935 of file editcurve_pen.cc.
References Curve::actnu, Curve::actvert, add_v3_v3(), BEZT_DESEL_ALL, BEZT_ISSEL_ANY, BEZT_SEL_IDX, BKE_curve_nurb_vert_active_validate(), BKE_nurb_knot_calc_u(), CU_BEZIER, ED_curve_beztcpy(), ED_curve_bpcpy(), BPoint::f1, LISTBASE_FOREACH, MEM_freeN(), MEM_mallocN, move_bezt_by_displacement(), SELECT, and BPoint::vec.
Referenced by extrude_points_from_selected_vertices().
|
static |
Interpolate along the Bezier segment by a parameter (between 0 and 1) and get its location.
Definition at line 559 of file editcurve_pen.cc.
References interp_v3_v3v3(), and BezTriple::vec.
Referenced by insert_point_to_segment(), and move_segment().
|
static |
Get closest vertex in all nurbs in given ListBase to a given point. Returns true if point is found.
Definition at line 470 of file editcurve_pen.cc.
References BEZT_ISSEL_ANY, CU_BEZIER, CURVE_HANDLE_NONE, CURVE_HANDLE_SELECTED, ED_view3d_select_dist_px(), FLT_MAX, View3DOverlay::handle_display, len_manhattan_v2v2(), LISTBASE_FOREACH, View3D::overlay, SEL_DIST_FACTOR, ViewContext::v3d, BezTriple::vec, BPoint::vec, and worldspace_to_screenspace().
Referenced by curve_pen_invoke(), curve_pen_modal(), delete_point_under_mouse(), and make_cyclic_if_endpoints().
|
static |
Get the first selected point from the curve. If more than one selected point is found, define and return only the first detected nu.
Definition at line 887 of file editcurve_pen.cc.
References BEZT_ISSEL_ANY_HIDDENHANDLES, CU_BEZIER, Curve::editnurb, BPoint::f1, LISTBASE_FOREACH, EditNurb::nurbs, and SELECT.
Referenced by curve_pen_invoke().
Definition at line 430 of file editcurve_pen.cc.
References BLI_findindex().
Referenced by delete_nurb().
|
static |
Get the average position of selected points.
| mid_only | Use only the middle point of the three points on a BezTriple. |
| bezt_only | Use only points of Bezier splines. |
Definition at line 313 of file editcurve_pen.cc.
References add_v3_v3(), BEZT_ISSEL_ANY, BEZT_ISSEL_IDX, CU_BEZIER, BezTriple::hide, LISTBASE_FOREACH, mul_v3_fl(), SELECT, BezTriple::vec, and zero_v3().
Referenced by extrude_points_from_selected_vertices(), and move_all_selected_points().
|
static |
Update r_min_dist, r_min_i, and r_param based on the edge and the external point.
| point | External point |
| point1 | One end of the edge |
| point2 | The other end of the edge |
| point_idx | Index of the control point out of the points on the Nurb |
| resolu_idx | Index of the edge on a Bezier segment (zero for non-Bezier edges) |
| r_min_dist | minimum distance from point to edge |
| r_min_i | index of closest point on Nurb |
| r_param | the fraction along the edge at which the closest point lies |
Definition at line 709 of file editcurve_pen.cc.
References angle_v2v2(), cos_v2v2v2(), dot_v2v2(), len_v2(), sinf, and sub_v2_v2v2().
Referenced by update_cut_data_for_nurb().
Definition at line 833 of file editcurve_pen.cc.
References CutData::bezt_index, and FLT_MAX.
Referenced by insert_point_to_segment(), and is_spline_nearby().
|
static |
Definition at line 1423 of file editcurve_pen.cc.
References BEZT_DESEL_ALL, BEZT_SEL_IDX, copy_v3_v3(), FOREACH_SELECTED_BEZT_BEGIN, FOREACH_SELECTED_BEZT_END, HD_ALIGN, and is_last_bezt().
Referenced by curve_pen_modal().
Insert a BezTriple to a nurb at the location specified by data.
Definition at line 600 of file editcurve_pen.cc.
References Nurb::bezt, BEZT_SEL_IDX, BKE_curve_nurb_vert_active_set(), BKE_nurb_handles_calc(), calculate_new_bezier_point(), copy_v3_v3(), ED_curve_beztcpy(), ED_curve_deselect_all(), Curve::editnurb, BezTriple::h1, BezTriple::h2, HD_ALIGN, interpf(), is_cyclic(), MEM_freeN(), MEM_mallocN, Nurb::pntsu, BezTriple::radius, BezTriple::tilt, BezTriple::vec, and BezTriple::weight.
Referenced by insert_point_to_segment().
Insert a BPoint to a nurb at the location specified by op_data.
Definition at line 656 of file editcurve_pen.cc.
References BKE_curve_nurb_vert_active_set(), BKE_nurb_knot_calc_u(), Nurb::bp, copy_v3_v3(), ED_curve_bpcpy(), ED_curve_deselect_all(), Curve::editnurb, BPoint::f1, interpf(), is_cyclic(), MEM_freeN(), MEM_mallocN, Nurb::pntsu, BPoint::radius, SELECT, BPoint::tilt, BPoint::vec, and BPoint::weight.
Referenced by insert_point_to_segment().
|
static |
Definition at line 847 of file editcurve_pen.cc.
References Nurb::bezt, CutData::bezt_index, BKE_curve_editNurbs_get(), Nurb::bp, CutData::bp_index, CU_BEZIER, CutData::cut_loc, Object::data, ED_view3d_select_dist_px(), float, FLT_MAX, get_bezier_interpolated_point(), Nurb::hide, init_cut_data(), insert_bezt_to_nurb(), insert_bp_to_nurb(), interp_v2_v2v2(), CutData::min_dist, wmEvent::mval, CutData::nurb, ViewContext::obedit, CutData::parameter, Nurb::pntsu, SEL_DIST_FACTOR, Nurb::type, update_cut_data_for_all_nurbs(), and update_cut_data_for_nurb().
Referenced by curve_pen_invoke(), and curve_pen_modal().
|
static |
Definition at line 592 of file editcurve_pen.cc.
References CU_NURB_CYCLIC, and Nurb::flagu.
Referenced by bevel_list_calc_bisect(), blender::io::alembic::bezier_point_count(), blender::io::usd::bezier_point_count(), BKE_curve_bevelList_make(), BKE_curve_calc_coords_axis(), BKE_curve_calc_coords_axis_len(), BKE_curve_decimate_bezt_array(), BKE_gpencil_editcurve_subdivide(), BKE_gpencil_stroke_delete_tagged_points(), BKE_gpencil_stroke_smooth_point(), BKE_gpencil_stroke_smooth_strength(), BKE_gpencil_stroke_smooth_thickness(), BKE_gpencil_stroke_smooth_uv(), BKE_maskrasterize_handle_init(), BKE_where_on_path(), blender::ed::greasepencil::build_curves_2d_bvh_from_visible(), blender::calc_radius_limit(), calcknots(), blender::bke::curves::poly::calculate_tangents(), blender::ed::curves::create_Bezier(), blender::ed::curves::create_NURBS(), createTransGPencil_curves(), curve_pen_invoke(), curve_pen_modal(), curve_to_displist(), blender::ed::curves::curves_draw_exec(), deselect_all_center_vertices(), blender::io::alembic::ABCCurveWriter::do_write(), blender::io::usd::USDCurvesWriter::do_write(), blender::ed::curves::duplicate_points(), ed_editcurve_extrude(), fcurve_to_keylist(), blender::ed::greasepencil::find_curve_intersections(), blender::ed::greasepencil::find_curve_segments(), blender::find_envelope(), blender::geometry::gaussian_blur_1D(), blender::ed::greasepencil::generate_stroke_perimeter(), get_curve_points_from_idx(), blender::io::usd::get_curve_width_interpolation(), blender::ed::greasepencil::trim::get_intersections_of_curve_with_curves(), gpencil_editcurve_subdivide_count(), blender::ed::sculpt_paint::grease_pencil_fill_extension_cut(), blender::draw::grease_pencil_geom_batch_ensure(), blender::ed::greasepencil::grease_pencil_primitive_init_curves(), blender::draw::grease_pencil_weight_batch_ensure(), blender::draw::grease_pencil_wire_batch_ensure(), blender::draw::index_buf_add_line_points(), insert_bezt_to_nurb(), insert_bp_to_nurb(), is_last_bezt(), knifeproject_poly_from_object(), make_bevel_list_3D_minimum_twist(), blender::io::usd::point_count(), blender::io::usd::populate_curve_props(), blender::io::usd::populate_curve_props_for_bezier(), blender::io::usd::populate_curve_props_for_nurbs(), blender::io::usd::populate_curve_verts(), blender::io::usd::populate_curve_verts_for_bezier(), position_tail_on_spline(), blender::io::usd::USDCurvesReader::read_curve_sample(), blender::ed::greasepencil::remove_points_and_split(), blender::ed::curves::select_mask_from_predicates(), set_up_beztriple_chain(), blender::ed::greasepencil::trim::trim_curve_segments(), update_cut_data_for_nurb(), and blender::write_stroke_transforms().
Definition at line 1085 of file editcurve_pen.cc.
References Nurb::bezt, is_cyclic(), and Nurb::pntsu.
Referenced by init_selected_bezt_handles().
|
static |
Check if a spline segment is nearby.
Definition at line 1148 of file editcurve_pen.cc.
References CutData::bezt_index, MoveSegmentData::bezt_index, BKE_curve_editNurbs_get(), CU_BEZIER, wmOperator::customdata, Object::data, float, init_cut_data(), MEM_callocN, CurvePenData::msd, wmEvent::mval, MoveSegmentData::nu, CutData::nurb, ViewContext::obedit, CutData::parameter, wmOperator::ptr, RNA_boolean_get(), MoveSegmentData::t, Nurb::type, and update_cut_data_for_all_nurbs().
Referenced by curve_pen_invoke().
|
static |
Close the spline if endpoints are selected consecutively. Return true if cycle was created.
Definition at line 1385 of file editcurve_pen.cc.
References Nurb::bezt, Nurb::bp, CU_BEZIER, curve_toggle_cyclic(), Object::data, Curve::editnurb, ELEM, float, get_closest_vertex_to_point_in_nurbs(), ViewContext::mval, EditNurb::nurbs, ViewContext::obedit, object_editcurve_get(), Nurb::pntsu, Nurb::type, and ViewContext::v3d.
Referenced by curve_pen_invoke(), and curve_pen_modal().
|
static |
Definition at line 1341 of file editcurve_pen.cc.
References BEZT_ISSEL_IDX, BKE_nurb_bezt_get_next(), BKE_nurb_bezt_get_prev(), BKE_nurb_handles_calc(), float, FOREACH_SELECTED_BEZT_BEGIN, FOREACH_SELECTED_BEZT_END, BezTriple::h1, BezTriple::h2, HD_FREE, move_bezt_handle_or_vertex_by_displacement(), wmEvent::prev_xy, sub_v2_v2v2_int(), and wmEvent::xy.
Referenced by curve_pen_modal().
|
static |
Move all selected points by an amount equivalent to the distance moved by mouse.
Definition at line 368 of file editcurve_pen.cc.
References add_v2_v2v2(), BEZT_ISSEL_ANY, BEZT_ISSEL_IDX, BKE_nurb_handles_calc(), CU_BEZIER, BPoint::f1, float, CurvePenData::free_toggle, get_selected_center(), BezTriple::hide, BPoint::hide, len_v3v3(), CurvePenData::link_handles, LISTBASE_FOREACH, CurvePenData::lock_angle, move_bezt_handle_or_vertex_by_displacement(), move_bp_to_location(), CurvePenData::move_entire, wmEvent::mval, pos, wmEvent::prev_xy, remove_handle_movement_constraints(), screenspace_to_worldspace_int(), SELECT, sub_v2_v2v2(), BPoint::vec, worldspace_to_screenspace(), and wmEvent::xy.
Referenced by curve_pen_modal().
Definition at line 214 of file editcurve_pen.cc.
References add_v3_v3(), and BezTriple::vec.
Referenced by extrude_vertices_from_selected_endpoints(), and move_bezt_to_location().
|
static |
Definition at line 256 of file editcurve_pen.cc.
References add_v2_v2v2(), add_v3_v3v3(), copy_v3_v3(), BezTriple::h1, BezTriple::h2, HD_ALIGN, len_v3v3(), move_bezt_to_location(), normalize_v3_length(), pos, screenspace_to_worldspace(), sub_v3_v3v3(), BezTriple::vec, and worldspace_to_screenspace().
Referenced by move_adjacent_handle(), and move_all_selected_points().
Move entire control point to given worldspace location.
Definition at line 224 of file editcurve_pen.cc.
References move_bezt_by_displacement(), sub_v3_v3v3(), and BezTriple::vec.
Referenced by move_bezt_handle_or_vertex_by_displacement().
|
static |
Definition at line 300 of file editcurve_pen.cc.
References copy_v3_v3(), screenspace_to_worldspace(), and BPoint::vec.
Referenced by move_all_selected_points().
|
static |
Definition at line 1175 of file editcurve_pen.cc.
References add_v3_v3v3(), Nurb::bezt, MoveSegmentData::bezt_index, BKE_nurb_bezt_get_next(), get_bezier_interpolated_point(), BezTriple::h1, BezTriple::h2, HD_ALIGN, BezTriple::hide, len_v3v3(), max_ff(), min_ff(), mul_v3_fl(), wmEvent::mval, normalize_v3_length(), MoveSegmentData::nu, remove_handle_movement_constraints(), screenspace_to_worldspace_int(), sub_v3_v3v3(), MoveSegmentData::t, and BezTriple::vec.
Referenced by curve_pen_modal().
|
static |
Alter handle types to allow free movement (Set handles to #FREE or #ALIGN).
Definition at line 234 of file editcurve_pen.cc.
References BezTriple::h1, BezTriple::h2, HD_ALIGN, HD_AUTO, HD_FREE, and HD_VECT.
Referenced by move_all_selected_points(), and move_segment().
|
static |
Definition at line 186 of file editcurve_pen.cc.
References ED_view3d_win_to_3d(), mul_v3_m4v3(), ViewContext::obedit, ViewContext::region, update_location_for_2d_curve(), and ViewContext::v3d.
Referenced by move_bezt_handle_or_vertex_by_displacement(), move_bp_to_location(), and screenspace_to_worldspace_int().
|
static |
Definition at line 196 of file editcurve_pen.cc.
References float, and screenspace_to_worldspace().
Referenced by move_all_selected_points(), and move_segment().
|
static |
Toggle between HD_FREE and HD_ALIGN handles of the given BezTriple
Definition at line 1269 of file editcurve_pen.cc.
References BezTriple::h1, BezTriple::h2, HD_ALIGN, and HD_FREE.
Referenced by curve_pen_modal(), and toggle_sel_bezt_free_align_handles().
|
static |
Definition at line 1460 of file editcurve_pen.cc.
References CurvePenData::changed, BezTriple::h1, BezTriple::h2, HD_AUTO, HD_FREE, and HD_VECT.
Referenced by curve_pen_modal().
|
static |
Toggle between HD_FREE and HD_ALIGN handles of the all selected BezTriple
Definition at line 1282 of file editcurve_pen.cc.
References FOREACH_SELECTED_BEZT_BEGIN, FOREACH_SELECTED_BEZT_END, and toggle_bezt_free_align_handles().
Referenced by curve_pen_modal().
|
static |
Definition at line 1435 of file editcurve_pen.cc.
References BEZT_DESEL_IDX, BEZT_ISSEL_ANY, BEZT_ISSEL_IDX, BEZT_SEL_IDX, and BKE_curve_nurb_vert_active_set().
Referenced by curve_pen_modal().
Definition at line 1449 of file editcurve_pen.cc.
References BKE_curve_nurb_vert_active_set(), BPoint::f1, and SELECT.
Referenced by curve_pen_modal().
|
static |
Definition at line 819 of file editcurve_pen.cc.
References FLT_MAX, LISTBASE_FOREACH, CutData::min_dist, and update_cut_data_for_nurb().
Referenced by insert_point_to_segment(), and is_spline_nearby().
|
static |
Update CutData for a single Nurb.
Definition at line 750 of file editcurve_pen.cc.
References Nurb::bezt, CutData::bezt_index, BKE_curve_forward_diff_bezier(), Nurb::bp, CutData::bp_index, copy_v2_v2(), CU_BEZIER, get_updated_data_for_edge(), is_cyclic(), len_v2v2(), MEM_freeN(), MEM_mallocN, CutData::min_dist, min_i(), CutData::nurb, CutData::parameter, Nurb::pntsu, Nurb::type, BezTriple::vec, BPoint::vec, and worldspace_to_screenspace().
Referenced by insert_point_to_segment(), and update_cut_data_for_all_nurbs().
|
static |
Definition at line 143 of file editcurve_pen.cc.
References copy_v3_v3(), CU_IS_2D, Object::data, dot_v3v3(), ED_view3d_global_to_vector(), eps, fabsf, invert_m4_m4(), RegionView3D::is_persp, isect_ray_plane_v3_factor(), madd_v3_v3v3fl(), mul_m4_v3(), mul_project_m4_v3_zfac(), normalize_v3_v3(), ViewContext::obedit, RegionView3D::persmat, and ViewContext::rv3d.
Referenced by extrude_points_from_selected_vertices(), and screenspace_to_worldspace().
|
static |
Definition at line 205 of file editcurve_pen.cc.
References ED_view3d_project_float_object(), ViewContext::region, V3D_PROJ_RET_OK, V3D_PROJ_TEST_CLIP_BB, and V3D_PROJ_TEST_CLIP_WIN.
Referenced by get_closest_vertex_to_point_in_nurbs(), move_all_selected_points(), move_bezt_handle_or_vertex_by_displacement(), and update_cut_data_for_nurb().
|
static |
Definition at line 136 of file editcurve_pen.cc.
Referenced by CURVE_OT_pen().
|
static |
Definition at line 124 of file editcurve_pen.cc.
Referenced by CURVE_OT_pen().