Blender
V3.3
|
#include "DNA_curve_types.h"
#include "DNA_windowmanager_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BKE_context.h"
#include "BKE_curve.h"
#include "DEG_depsgraph.h"
#include "WM_api.h"
#include "ED_curve.h"
#include "ED_screen.h"
#include "ED_select_utils.h"
#include "ED_view3d.h"
#include "BKE_object.h"
#include "curve_intern.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "float.h"
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 |
Typedefs | |
typedef struct CutData | CutData |
typedef struct MoveSegmentData | MoveSegmentData |
typedef struct CurvePenData | CurvePenData |
typedef enum eClose_opt | eClose_opt |
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, struct wmOperator *op, const wmEvent *event, const float sel_dist) |
static void | move_segment (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 (ViewContext *vc, const wmEvent *event) |
static void | move_adjacent_handle (ViewContext *vc, const wmEvent *event, ListBase *nurbs) |
static bool | make_cyclic_if_endpoints (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 37 of file editcurve_pen.c.
#define FOREACH_SELECTED_BEZT_END |
Definition at line 44 of file editcurve_pen.c.
#define SEL_DIST_FACTOR 0.2f |
Definition at line 53 of file editcurve_pen.c.
typedef struct CurvePenData CurvePenData |
typedef enum eClose_opt eClose_opt |
typedef struct MoveSegmentData MoveSegmentData |
Data required for segment altering functionality.
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 1494 of file editcurve_pen.c.
enum eClose_opt |
Enumerator | |
---|---|
OFF | |
ON_PRESS | |
ON_CLICK |
Definition at line 129 of file editcurve_pen.c.
|
static |
Calculate handle positions of added and adjacent control points such that shape is preserved.
Definition at line 572 of file editcurve_pen.c.
References interp_v3_v3v3().
Referenced by insert_bezt_to_nurb().
void CURVE_OT_pen | ( | wmOperatorType * | ot | ) |
Definition at line 1829 of file editcurve_pen.c.
References curve_pen_invoke(), curve_pen_modal(), wmOperatorType::description, ED_operator_view3d_active(), 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 1736 of file editcurve_pen.c.
References CurvePenData::acted, CurvePenData::bezt, BEZT_ISSEL_IDX, BEZT_SEL_ALL, BEZT_SEL_IDX, BKE_curve_nurb_vert_active_set(), CurvePenData::bp, C, copy_v2_v2_int(), CTX_data_ensure_evaluated_depsgraph(), wmOperator::customdata, Object::data, ED_curve_deselect_all(), ED_view3d_select_dist_px(), ED_view3d_viewcontext_init(), Curve::editnurb, ELEM, extrude_points_from_selected_vertices(), BPoint::f1, 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, NULL, 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, UNPACK2, ViewContext::v3d, wmEvent::val, and WM_event_add_modal_handler().
Referenced by CURVE_OT_pen().
|
static |
Definition at line 1547 of file editcurve_pen.c.
References CurvePenData::acted, CurvePenData::bezt, Nurb::bezt, MoveSegmentData::bezt_index, BKE_nurb_bezt_get_next(), BKE_nurb_handles_calc(), CurvePenData::bp, C, 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(), 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, MoveSegmentData::nu, CurvePenData::nu, NULL, 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, UNPACK2, 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 1502 of file editcurve_pen.c.
References wmKeyMap::modal_items, NULL, 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().
Definition at line 1478 of file editcurve_pen.c.
References BezTriple::h1, BezTriple::h2, HD_ALIGN, HD_AUTO, HD_FREE, and HD_VECT.
Referenced by curve_pen_modal().
Definition at line 446 of file editcurve_pen.c.
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 455 of file editcurve_pen.c.
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 433 of file editcurve_pen.c.
References Curve::actnu, BKE_curve_nurb_vert_active_set(), BKE_nurb_free(), BLI_remlink(), Curve::editnurb, get_nurb_index(), NULL, 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 1271 of file editcurve_pen.c.
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, get_closest_vertex_to_point_in_nurbs(), wmEvent::mval, NULL, ViewContext::obedit, Nurb::pntsu, Nurb::type, and UNPACK2.
Referenced by curve_pen_modal().
Deselect all vertices that are not endpoints.
Definition at line 1040 of file editcurve_pen.c.
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 1073 of file editcurve_pen.c.
References Nurb::bezt, BKE_curve_editNurbs_get(), BKE_curve_nurb_vert_active_set(), Nurb::bp, center, copy_v3_v3(), CU_NURB_CYCLIC, 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, Object::obmat, 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 930 of file editcurve_pen.c.
References Curve::actnu, Curve::actvert, add_v3_v3(), BEZT_DESEL_ALL, BEZT_ISSEL_ANY, 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 555 of file editcurve_pen.c.
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 468 of file editcurve_pen.c.
References BEZT_ISSEL_ANY, CU_BEZIER, CURVE_HANDLE_NONE, CURVE_HANDLE_SELECTED, ED_view3d_select_dist_px(), View3DOverlay::handle_display, len_manhattan_v2v2(), LISTBASE_FOREACH, NULL, View3D::overlay, point, 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 882 of file editcurve_pen.c.
References Freestyle::a, BEZT_ISSEL_ANY_HIDDENHANDLES, CU_BEZIER, Curve::editnurb, BPoint::f1, LISTBASE_FOREACH, NULL, EditNurb::nurbs, and SELECT.
Referenced by curve_pen_invoke().
Definition at line 428 of file editcurve_pen.c.
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 311 of file editcurve_pen.c.
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 705 of file editcurve_pen.c.
References angle_v2v2(), cos_v2v2v2(), dot_v2v2(), len_v2(), point, sinf, and sub_v2_v2v2().
Referenced by update_cut_data_for_nurb().
Definition at line 829 of file editcurve_pen.c.
References CutData::bezt_index.
Referenced by insert_point_to_segment(), and is_spline_nearby().
Definition at line 1403 of file editcurve_pen.c.
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 596 of file editcurve_pen.c.
References Nurb::bezt, BEZT_SEL_ALL, BKE_curve_nurb_vert_active_set(), BKE_nurb_handles_calc(), calculate_new_bezier_point(), copy_v3_v3(), data, 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 652 of file editcurve_pen.c.
References BKE_curve_nurb_vert_active_set(), BKE_nurb_knot_calc_u(), Nurb::bp, copy_v3_v3(), data, 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 842 of file editcurve_pen.c.
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(), 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, UNPACK2, update_cut_data_for_all_nurbs(), and update_cut_data_for_nurb().
Referenced by curve_pen_invoke(), and curve_pen_modal().
Definition at line 588 of file editcurve_pen.c.
References CU_NURB_CYCLIC, and Nurb::flagu.
Referenced by accumulate_lengths(), apply_stroke_envelope(), bevel_list_calc_bisect(), BKE_curve_bevelList_make(), BKE_curve_calc_coords_axis(), BKE_curve_calc_coords_axis_len(), BKE_curve_decimate_bezt_array(), BKE_gpencil_curve_delete_tagged_points(), BKE_gpencil_editcurve_subdivide(), BKE_gpencil_stroke_delete_tagged_points(), BKE_gpencil_stroke_sample(), BKE_gpencil_stroke_smooth_point(), BKE_gpencil_stroke_smooth_strength(), BKE_gpencil_stroke_smooth_thickness(), BKE_gpencil_stroke_smooth_uv(), BKE_gpencil_stroke_uniform_subdivide(), BKE_gpencil_stroke_update_geometry_from_editcurve(), BKE_maskrasterize_handle_init(), BKE_where_on_path(), calc_radius_limit(), calcknots(), blender::bke::curves::poly::calculate_tangents(), calculate_tangents(), createTransGPencil_curves(), curve_pen_invoke(), curve_pen_modal(), curve_to_displist(), deselect_all_center_vertices(), ed_editcurve_extrude(), fcurve_to_keylist(), get_curve_points_from_idx(), gpencil_buffer_add_stroke(), gpencil_editcurve_subdivide_count(), gpencil_stroke_points_from_editcurve_adaptive_resolu(), gpencil_stroke_points_from_editcurve_fixed_resolu(), insert_bezt_to_nurb(), insert_bp_to_nurb(), is_last_bezt(), knifeproject_poly_from_object(), position_tail_on_spline(), and update_cut_data_for_nurb().
Definition at line 1065 of file editcurve_pen.c.
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 1128 of file editcurve_pen.c.
References CutData::bezt_index, MoveSegmentData::bezt_index, BKE_curve_editNurbs_get(), CU_BEZIER, wmOperator::customdata, Object::data, 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, UNPACK2, 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 1363 of file editcurve_pen.c.
References Nurb::bezt, Nurb::bp, CU_BEZIER, curve_toggle_cyclic(), Object::data, Curve::editnurb, get_closest_vertex_to_point_in_nurbs(), ViewContext::mval, NULL, EditNurb::nurbs, ViewContext::obedit, object_editcurve_get(), Nurb::pntsu, Nurb::type, UNPACK2, and ViewContext::v3d.
Referenced by curve_pen_invoke(), and curve_pen_modal().
|
static |
Definition at line 1319 of file editcurve_pen.c.
References BEZT_ISSEL_IDX, BKE_nurb_bezt_get_next(), BKE_nurb_bezt_get_prev(), BKE_nurb_handles_calc(), 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(), UNPACK2, 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 366 of file editcurve_pen.c.
References add_v2_v2v2(), BEZT_ISSEL_ANY, BEZT_ISSEL_IDX, BKE_nurb_handles_calc(), CU_BEZIER, blender::math::distance(), BPoint::f1, 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(), UNPACK2, BPoint::vec, worldspace_to_screenspace(), and wmEvent::xy.
Referenced by curve_pen_modal().
Definition at line 212 of file editcurve_pen.c.
References add_v3_v3(), and BezTriple::vec.
Referenced by extrude_vertices_from_selected_endpoints(), and move_bezt_to_location().
|
static |
Definition at line 254 of file editcurve_pen.c.
References add_v2_v2v2(), add_v3_v3v3(), copy_v3_v3(), blender::math::distance(), 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 222 of file editcurve_pen.c.
References move_bezt_by_displacement(), sub_v3_v3v3(), and BezTriple::vec.
Referenced by move_bezt_handle_or_vertex_by_displacement().
|
static |
Definition at line 298 of file editcurve_pen.c.
References copy_v3_v3(), screenspace_to_worldspace(), and BPoint::vec.
Referenced by move_all_selected_points().
|
static |
Definition at line 1154 of file editcurve_pen.c.
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, 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 232 of file editcurve_pen.c.
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 184 of file editcurve_pen.c.
References ED_view3d_win_to_3d(), mul_v3_m4v3(), ViewContext::obedit, Object::obmat, 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 194 of file editcurve_pen.c.
References screenspace_to_worldspace(), and UNPACK2.
Referenced by move_all_selected_points(), and move_segment().
Toggle between HD_FREE and HD_ALIGN handles of the given BezTriple
Definition at line 1247 of file editcurve_pen.c.
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 1450 of file editcurve_pen.c.
References CurvePenData::acted, BezTriple::h1, BezTriple::h2, HD_AUTO, HD_FREE, and HD_VECT.
Referenced by curve_pen_modal().
Toggle between HD_FREE and HD_ALIGN handles of the all selected BezTriple
Definition at line 1260 of file editcurve_pen.c.
References FOREACH_SELECTED_BEZT_BEGIN, FOREACH_SELECTED_BEZT_END, and toggle_bezt_free_align_handles().
Referenced by curve_pen_modal().
|
static |
Definition at line 1415 of file editcurve_pen.c.
References BEZT_DESEL_ALL, BEZT_DESEL_IDX, BEZT_ISSEL_ANY, BEZT_ISSEL_IDX, BEZT_SEL_ALL, BEZT_SEL_IDX, and BKE_curve_nurb_vert_active_set().
Referenced by curve_pen_modal().
Definition at line 1439 of file editcurve_pen.c.
References BKE_curve_nurb_vert_active_set(), BPoint::f1, and SELECT.
Referenced by curve_pen_modal().
|
static |
Definition at line 815 of file editcurve_pen.c.
References LISTBASE_FOREACH, CutData::min_dist, point, 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 746 of file editcurve_pen.c.
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, point, 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 142 of file editcurve_pen.c.
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(), madd_v3_v3v3fl(), mul_m4_v3(), mul_project_m4_v3_zfac(), normalize_v3_v3(), ViewContext::obedit, Object::obmat, RegionView3D::persmat, and ViewContext::rv3d.
Referenced by extrude_points_from_selected_vertices(), and screenspace_to_worldspace().
|
static |
Definition at line 203 of file editcurve_pen.c.
References ED_view3d_project_float_object(), ViewContext::region, V3D_PROJ_RET_CLIP_BB, V3D_PROJ_RET_CLIP_WIN, and V3D_PROJ_RET_OK.
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 |
|
static |