Blender V5.3
editcurve.cc File Reference
#include <algorithm>
#include "DNA_anim_types.h"
#include "DNA_key_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_array_utils_c.hh"
#include "BLI_ghash.hh"
#include "BLI_listbase_wrapper.hh"
#include "BLI_math_geom_c.hh"
#include "BLI_math_matrix_c.hh"
#include "BLI_math_rotation_c.hh"
#include "BLI_math_vector_c.hh"
#include "BLI_set.hh"
#include "BLI_span.hh"
#include "BLI_string.hh"
#include "BLI_string_utf8.hh"
#include "BLT_translation.hh"
#include "BKE_action.hh"
#include "BKE_anim_data.hh"
#include "BKE_context.hh"
#include "BKE_curve.hh"
#include "BKE_displist.h"
#include "BKE_fcurve.hh"
#include "BKE_global.hh"
#include "BKE_key.hh"
#include "BKE_layer.hh"
#include "BKE_lib_id.hh"
#include "BKE_main.hh"
#include "BKE_modifier.hh"
#include "BKE_object_types.hh"
#include "BKE_report.hh"
#include "ANIM_action.hh"
#include "ANIM_animdata.hh"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_build.hh"
#include "DEG_depsgraph_query.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "ED_curve.hh"
#include "ED_object.hh"
#include "ED_outliner.hh"
#include "ED_screen.hh"
#include "ED_select_utils.hh"
#include "ED_transform.hh"
#include "ED_transform_snap_object_context.hh"
#include "ED_view3d.hh"
#include "curve_intern.hh"
#include "curve_fit_nd.h"
#include "UI_interface.hh"
#include "UI_interface_layout.hh"
#include "UI_resources.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "RNA_enum_types.hh"

Go to the source code of this file.

Classes

struct  blender::NurbDim
struct  blender::NurbSort

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define BEZT_VALUE(bezt)
#define BP_VALUE(bp)

Functions

void blender::selectend_nurb (Object *obedit, enum eEndPoint_Types selfirst, bool doswap, bool selstatus)
Flag Utility Functions
static void blender::adduplicateflagNurb (Object *obedit, View3D *v3d, ListBaseT< Nurb > *newnurb, const eBezTriple_Flag flag, const bool split)
static bool blender::isNurbselU (Nurb *nu, int *v, eBezTriple_Flag flag)
static bool blender::isNurbselV (Nurb *nu, int *u, eBezTriple_Flag flag)
static void blender::rotateflagNurb (ListBaseT< Nurb > *editnurb, eBezTriple_Flag flag, const float cent[3], const float rotmat[3][3])
void blender::ed_editnurb_translate_flag (ListBaseT< Nurb > *editnurb, eBezTriple_Flag flag, const float vec[3], bool is_2d)
static void blender::weightflagNurb (ListBaseT< Nurb > *editnurb, short flag, float w)
static void blender::ed_surf_delete_selected (Object *obedit)
static void blender::ed_curve_delete_selected (Object *obedit, View3D *v3d)
static void blender::select_bpoints (BPoint *bp, const int stride, const int count, const bool selstatus, const eBezTriple_Flag flag, const bool hidden)
static int blender::sel_to_copy_ints (const BPoint *bp, const int next_j, const int max_j, const int next_i, const int max_i, const uint8_t flag, int copy_intervals[], int *interval_count, bool *out_is_first_sel)
static NurbDim blender::editnurb_find_max_points_num (const EditNurb *editnurb)
bool blender::ed_editnurb_extrude_flag (EditNurb *editnurb, eBezTriple_Flag flag)
static void blender::calc_duplicate_actnurb (const ListBaseT< Nurb > *editnurb, const ListBaseT< Nurb > *newnurb, Curve *cu)
static bool blender::calc_duplicate_actvert (const ListBaseT< Nurb > *editnurb, const ListBaseT< Nurb > *newnurb, Curve *cu, int start, int end, int vert)
Utility Functions
ListBaseT< Nurb > * blender::object_editcurve_get (Object *ob)
KeyBlock * blender::ED_curve_get_edit_shape_key (const Curve *cu)
Shape keys
static CVKeyIndex * blender::init_cvKeyIndex (void *cv, int key_index, int nu_index, int pt_index, int vertex_index)
static void blender::init_editNurb_keyIndex (EditNurb *editnurb, ListBaseT< Nurb > *origBase)
static CVKeyIndex * blender::getCVKeyIndex (EditNurb *editnurb, const void *cv)
static CVKeyIndex * blender::popCVKeyIndex (EditNurb *editnurb, const void *cv)
static BezTriple * blender::getKeyIndexOrig_bezt (EditNurb *editnurb, const BezTriple *bezt)
static BPoint * blender::getKeyIndexOrig_bp (EditNurb *editnurb, BPoint *bp)
static int blender::getKeyIndexOrig_keyIndex (EditNurb *editnurb, void *cv)
static void blender::keyIndex_delBezt (EditNurb *editnurb, BezTriple *bezt)
static void blender::keyIndex_delBP (EditNurb *editnurb, BPoint *bp)
static void blender::keyIndex_delNurb (EditNurb *editnurb, Nurb *nu)
static void blender::keyIndex_delNurbList (EditNurb *editnurb, ListBaseT< Nurb > *nubase)
static void blender::keyIndex_updateCV (EditNurb *editnurb, char *cv, char *newcv, int count, int size)
static void blender::keyIndex_updateBezt (EditNurb *editnurb, BezTriple *bezt, BezTriple *newbezt, int count)
static void blender::keyIndex_updateBP (EditNurb *editnurb, BPoint *bp, BPoint *newbp, int count)
void blender::ED_curve_keyindex_update_nurb (EditNurb *editnurb, Nurb *nu, Nurb *newnu)
static void blender::keyIndex_swap (EditNurb *editnurb, void *a, void *b)
static void blender::keyIndex_switchDirection (EditNurb *editnurb, Nurb *nu)
static void blender::switch_keys_direction (Curve *cu, Nurb *actnu)
static void blender::keyData_switchDirectionNurb (Curve *cu, Nurb *nu)
CVKeyIndexMap * blender::ED_curve_keyindex_hash_duplicate (CVKeyIndexMap *keyindex)
static void blender::key_to_bezt (float *key, BezTriple *basebezt, BezTriple *bezt)
static void blender::bezt_to_key (BezTriple *bezt, float *key)
static void blender::calc_keyHandles (ListBaseT< Nurb > *nurb, float *key)
static void blender::calc_shapeKeys (Object *obedit, ListBaseT< Nurb > *newnurbs)
Animation Data
static bool blender::curve_is_animated (Curve *cu)
static void blender::fcurve_path_rename (const char *orig_rna_path, const char *rna_path, const Span< FCurve * > orig_curves, Set< FCurve * > &processed_fcurves)
static Vector< FCurve * > blender::curve_rename_fcurves (Curve *cu, Span< FCurve * > orig_curves)
int blender::ED_curve_updateAnimPaths (Main *bmain, Curve *cu)
Edit Mode Conversion (Make & Load)
static int * blender::init_index_map (Object *obedit, int *r_old_totvert)
static void blender::remap_hooks_and_vertex_parents (Main *bmain, Object *obedit)
void blender::ED_curve_editnurb_load (Main *bmain, Object *obedit)
void blender::ED_curve_editnurb_make (Object *obedit)
void blender::ED_curve_editnurb_free (Object *obedit)
Separate Operator
static wmOperatorStatus blender::separate_exec (bContext *C, wmOperator *op)
void blender::CURVE_OT_separate (wmOperatorType *ot)
Split Operator
static wmOperatorStatus blender::curve_split_exec (bContext *C, wmOperator *op)
void blender::CURVE_OT_split (wmOperatorType *ot)
Switch Direction Operator
static wmOperatorStatus blender::switch_direction_exec (bContext *C, wmOperator *)
void blender::CURVE_OT_switch_direction (wmOperatorType *ot)
Set Weight Operator
static wmOperatorStatus blender::set_goal_weight_exec (bContext *C, wmOperator *op)
void blender::CURVE_OT_spline_weight_set (wmOperatorType *ot)
Set Radius Operator
static wmOperatorStatus blender::set_radius_exec (bContext *C, wmOperator *op)
void blender::CURVE_OT_radius_set (wmOperatorType *ot)
Smooth Vertices Operator
static void blender::smooth_single_bezt (BezTriple *bezt, const BezTriple *bezt_orig_prev, const BezTriple *bezt_orig_next, float factor)
static void blender::smooth_single_bp (BPoint *bp, const BPoint *bp_orig_prev, const BPoint *bp_orig_next, float factor)
static wmOperatorStatus blender::smooth_exec (bContext *C, wmOperator *op)
void blender::CURVE_OT_smooth (wmOperatorType *ot)
Smooth Operator (Radius/Weight/Tilt) Utilities

To do:

  • Make smoothing distance based.
  • Support cyclic curves.
static void blender::curve_smooth_value (ListBaseT< Nurb > *editnurb, const int bezt_offsetof, const int bp_offset)
Smooth Weight Operator
static wmOperatorStatus blender::curve_smooth_weight_exec (bContext *C, wmOperator *)
void blender::CURVE_OT_smooth_weight (wmOperatorType *ot)
Smooth Radius Operator
static wmOperatorStatus blender::curve_smooth_radius_exec (bContext *C, wmOperator *op)
void blender::CURVE_OT_smooth_radius (wmOperatorType *ot)
Smooth Tilt Operator
static wmOperatorStatus blender::curve_smooth_tilt_exec (bContext *C, wmOperator *op)
void blender::CURVE_OT_smooth_tilt (wmOperatorType *ot)
Hide Operator
static wmOperatorStatus blender::hide_exec (bContext *C, wmOperator *op)
void blender::CURVE_OT_hide (wmOperatorType *ot)
Reveal Operator
static wmOperatorStatus blender::reveal_exec (bContext *C, wmOperator *op)
void blender::CURVE_OT_reveal (wmOperatorType *ot)
Subdivide Operator
static void blender::interp_bpoint (BPoint *bp_target, const BPoint *bp_a, const BPoint *bp_b, const float factor)
static void blender::subdividenurb (Object *obedit, View3D *v3d, int number_cuts)
static wmOperatorStatus blender::subdivide_exec (bContext *C, wmOperator *op)
void blender::CURVE_OT_subdivide (wmOperatorType *ot)
Set Spline Type Operator
static wmOperatorStatus blender::set_spline_type_exec (bContext *C, wmOperator *op)
void blender::CURVE_OT_spline_type_set (wmOperatorType *ot)
Set Handle Type Operator
static wmOperatorStatus blender::set_handle_type_exec (bContext *C, wmOperator *op)
void blender::CURVE_OT_handle_type_set (wmOperatorType *ot)
Recalculate Handles Operator
static wmOperatorStatus blender::curve_normals_make_consistent_exec (bContext *C, wmOperator *op)
void blender::CURVE_OT_normals_make_consistent (wmOperatorType *ot)
Pick Select from 3D View
bool blender::ED_curve_editnurb_select_pick (bContext *C, const int mval[2], const int dist_px, const SelectPick_Params &params)
Spin Operator
bool blender::ed_editnurb_spin (float viewmat[4][4], View3D *v3d, Object *obedit, const float axis[3], const float cent[3])
static wmOperatorStatus blender::spin_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::spin_invoke (bContext *C, wmOperator *op, const wmEvent *)
void blender::CURVE_OT_spin (wmOperatorType *ot)
Extrude Vertex Operator
static bool blender::ed_editcurve_extrude (Curve *cu, EditNurb *editnurb, View3D *v3d)
Add Vertex Operator
int blender::ed_editcurve_addvert (Curve *cu, EditNurb *editnurb, View3D *v3d, const float location_init[3])
static wmOperatorStatus blender::add_vertex_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::add_vertex_invoke (bContext *C, wmOperator *op, const wmEvent *event)
void blender::CURVE_OT_vertex_add (wmOperatorType *ot)
Extrude Operator
static wmOperatorStatus blender::curve_extrude_exec (bContext *C, wmOperator *)
void blender::CURVE_OT_extrude (wmOperatorType *ot)
Make Cyclic Operator
bool blender::curve_toggle_cyclic (View3D *v3d, ListBaseT< Nurb > *editnurb, int direction)
static wmOperatorStatus blender::toggle_cyclic_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::toggle_cyclic_invoke (bContext *C, wmOperator *op, const wmEvent *)
void blender::CURVE_OT_cyclic_toggle (wmOperatorType *ot)
Add Duplicate Operator
static wmOperatorStatus blender::duplicate_exec (bContext *C, wmOperator *op)
void blender::CURVE_OT_duplicate (wmOperatorType *ot)
Dissolve Vertices
static bool blender::test_bezt_is_sel_any (const void *bezt_v, void *user_data)
void blender::ed_dissolve_bez_segment (BezTriple *bezt_prev, BezTriple *bezt_next, const Nurb *nu, const Curve *cu, const uint span_len, const uint span_step[2])
static wmOperatorStatus blender::curve_dissolve_exec (bContext *C, wmOperator *)
void blender::CURVE_OT_dissolve_verts (wmOperatorType *ot)
Decimate Operator
Note
The function to decimate is intended for use as a modifier, while its handy allow access as a tool - this does cause access to be a little awkward (passing selection as weights for eg).
static bool blender::nurb_bezt_flag_any (const Nurb *nu, const char flag_test)
static wmOperatorStatus blender::curve_decimate_exec (bContext *C, wmOperator *op)
void blender::CURVE_OT_decimate (wmOperatorType *ot)
Shade Smooth/Flat Operator
static wmOperatorStatus blender::shade_smooth_exec (bContext *C, wmOperator *op)
void blender::CURVE_OT_shade_smooth (wmOperatorType *ot)
void blender::CURVE_OT_shade_flat (wmOperatorType *ot)
Join Operator
wmOperatorStatus blender::ED_curve_join_objects_exec (bContext *C, wmOperator *op)
Clear Tilt Operator
static wmOperatorStatus blender::clear_tilt_exec (bContext *C, wmOperator *op)
void blender::CURVE_OT_tilt_clear (wmOperatorType *ot)
void blender::ED_curve_beztcpy (EditNurb *editnurb, BezTriple *dst, BezTriple *src, int count)
void blender::ED_curve_bpcpy (EditNurb *editnurb, BPoint *dst, BPoint *src, int count)
Match Texture Space Operator
static bool blender::match_texture_space_poll (bContext *C)
static wmOperatorStatus blender::match_texture_space_exec (bContext *C, wmOperator *)
void blender::CURVE_OT_match_texture_space (wmOperatorType *ot)

Make Segment Operator

Also handles skinning & lofting.

enum  { blender::CURVE_MERGE_OK = 0 , blender::CURVE_MERGE_ERR_FEW_SELECTION , blender::CURVE_MERGE_ERR_RESOLUTION_ALL , blender::CURVE_MERGE_ERR_RESOLUTION_SOME }
static void blender::switchdirection_knots (float *base, int tot)
static void blender::rotate_direction_nurb (Nurb *nu)
static bool blender::is_u_selected (Nurb *nu, int u)
static void blender::make_selection_list_nurb (View3D *v3d, ListBaseT< Nurb > *editnurb, ListBaseT< NurbSort > *nsortbase)
static bool blender::merge_2_nurb (Curve *cu, ListBaseT< Nurb > *editnurb, Nurb *nu1, Nurb *nu2)
static int blender::merge_nurb (View3D *v3d, Object *obedit)
static wmOperatorStatus blender::make_segment_exec (bContext *C, wmOperator *op)
void blender::CURVE_OT_make_segment (wmOperatorType *ot)

Delete Operator

static const EnumPropertyItem blender::curve_delete_type_items []
static bool blender::curve_delete_segments (Object *obedit, View3D *v3d, const bool split)
static bool blender::curve_delete_vertices (Object *obedit, View3D *v3d)
static wmOperatorStatus blender::curve_delete_exec (bContext *C, wmOperator *op)
static const EnumPropertyItem * blender::rna_curve_delete_type_itemf (bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)
void blender::CURVE_OT_delete (wmOperatorType *ot)

Macro Definition Documentation

◆ BEZT_VALUE

#define BEZT_VALUE ( bezt)
Value:
(*((float *)((char *)(bezt) + bezt_offsetof)))

Referenced by blender::curve_smooth_value().

◆ BP_VALUE

#define BP_VALUE ( bp)
Value:
(*((float *)((char *)(bp) + bp_offset)))

Referenced by blender::curve_smooth_value().