Blender V4.3
editcurve.cc File Reference
#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.h"
#include "BLI_blenlib.h"
#include "BLI_ghash.h"
#include "BLI_listbase_wrapper.hh"
#include "BLI_math_geom.h"
#include "BLI_math_matrix.h"
#include "BLI_math_rotation.h"
#include "BLI_math_vector.h"
#include "BLI_set.hh"
#include "BLI_span.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_action_legacy.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_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  NurbDim
 
struct  NurbSort
 

Macros

#define BEZT_VALUE(bezt)   (*((float *)((char *)(bezt) + bezt_offsetof)))
 
#define BP_VALUE(bp)   (*((float *)((char *)(bp) + bp_offset)))
 

Functions

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

To do:

  • Make smoothing distance based.
  • Support cyclic curves.
static void curve_smooth_value (ListBase *editnurb, const int bezt_offsetof, const int bp_offset)
 
Smooth Weight Operator
static int curve_smooth_weight_exec (bContext *C, wmOperator *)
 
void CURVE_OT_smooth_weight (wmOperatorType *ot)
 
Smooth Radius Operator
static int curve_smooth_radius_exec (bContext *C, wmOperator *op)
 
void CURVE_OT_smooth_radius (wmOperatorType *ot)
 
Smooth Tilt Operator
static int curve_smooth_tilt_exec (bContext *C, wmOperator *op)
 
void CURVE_OT_smooth_tilt (wmOperatorType *ot)
 
Hide Operator
static int hide_exec (bContext *C, wmOperator *op)
 
void CURVE_OT_hide (wmOperatorType *ot)
 
Reveal Operator
static int reveal_exec (bContext *C, wmOperator *op)
 
void CURVE_OT_reveal (wmOperatorType *ot)
 
Subdivide Operator
static void subdividenurb (Object *obedit, View3D *v3d, int number_cuts)
 
static int subdivide_exec (bContext *C, wmOperator *op)
 
void CURVE_OT_subdivide (wmOperatorType *ot)
 
Set Spline Type Operator
static int set_spline_type_exec (bContext *C, wmOperator *op)
 
void CURVE_OT_spline_type_set (wmOperatorType *ot)
 
Set Handle Type Operator
static int set_handle_type_exec (bContext *C, wmOperator *op)
 
void CURVE_OT_handle_type_set (wmOperatorType *ot)
 
Recalculate Handles Operator
static int curve_normals_make_consistent_exec (bContext *C, wmOperator *op)
 
void CURVE_OT_normals_make_consistent (wmOperatorType *ot)
 
Pick Select from 3D View
bool ED_curve_editnurb_select_pick (bContext *C, const int mval[2], const int dist_px, const SelectPick_Params *params)
 
Spin Operator
bool ed_editnurb_spin (float viewmat[4][4], View3D *v3d, Object *obedit, const float axis[3], const float cent[3])
 
static int spin_exec (bContext *C, wmOperator *op)
 
static int spin_invoke (bContext *C, wmOperator *op, const wmEvent *)
 
void CURVE_OT_spin (wmOperatorType *ot)
 
Extrude Vertex Operator
static bool ed_editcurve_extrude (Curve *cu, EditNurb *editnurb, View3D *v3d)
 
Add Vertex Operator
int ed_editcurve_addvert (Curve *cu, EditNurb *editnurb, View3D *v3d, const float location_init[3])
 
static int add_vertex_exec (bContext *C, wmOperator *op)
 
static int add_vertex_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void CURVE_OT_vertex_add (wmOperatorType *ot)
 
Extrude Operator
static int curve_extrude_exec (bContext *C, wmOperator *)
 
void CURVE_OT_extrude (wmOperatorType *ot)
 
Make Cyclic Operator
bool curve_toggle_cyclic (View3D *v3d, ListBase *editnurb, int direction)
 
static int toggle_cyclic_exec (bContext *C, wmOperator *op)
 
static int toggle_cyclic_invoke (bContext *C, wmOperator *op, const wmEvent *)
 
void CURVE_OT_cyclic_toggle (wmOperatorType *ot)
 
Add Duplicate Operator
static int duplicate_exec (bContext *C, wmOperator *op)
 
void CURVE_OT_duplicate (wmOperatorType *ot)
 
Dissolve Vertices
static bool test_bezt_is_sel_any (const void *bezt_v, void *user_data)
 
void 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 int curve_dissolve_exec (bContext *C, wmOperator *)
 
void CURVE_OT_dissolve_verts (wmOperatorType *ot)
 
Decimate Operator
static bool nurb_bezt_flag_any (const Nurb *nu, const char flag_test)
 
static int curve_decimate_exec (bContext *C, wmOperator *op)
 
void CURVE_OT_decimate (wmOperatorType *ot)
 
Shade Smooth/Flat Operator
static int shade_smooth_exec (bContext *C, wmOperator *op)
 
void CURVE_OT_shade_smooth (wmOperatorType *ot)
 
void CURVE_OT_shade_flat (wmOperatorType *ot)
 
Join Operator
int ED_curve_join_objects_exec (bContext *C, wmOperator *op)
 
Clear Tilt Operator
static int clear_tilt_exec (bContext *C, wmOperator *op)
 
void CURVE_OT_tilt_clear (wmOperatorType *ot)
 
void ED_curve_beztcpy (EditNurb *editnurb, BezTriple *dst, BezTriple *src, int count)
 
void ED_curve_bpcpy (EditNurb *editnurb, BPoint *dst, BPoint *src, int count)
 
Match Texture Space Operator
static bool match_texture_space_poll (bContext *C)
 
static int match_texture_space_exec (bContext *C, wmOperator *)
 
void CURVE_OT_match_texture_space (wmOperatorType *ot)
 

Make Segment Operator

Also handles skinning & lofting.

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

Delete Operator

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

Macro Definition Documentation

◆ BEZT_VALUE

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

Referenced by curve_smooth_value().

◆ BP_VALUE

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

Referenced by curve_smooth_value().

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
CURVE_MERGE_OK 
CURVE_MERGE_ERR_FEW_SELECTION 
CURVE_MERGE_ERR_RESOLUTION_ALL 
CURVE_MERGE_ERR_RESOLUTION_SOME 

Definition at line 4294 of file editcurve.cc.

Function Documentation

◆ add_vertex_exec()

◆ add_vertex_invoke()

◆ adduplicateflagNurb()

◆ bezt_to_key()

static void bezt_to_key ( BezTriple * bezt,
float * key )
static

Definition at line 573 of file editcurve.cc.

References BezTriple::radius, BezTriple::tilt, and BezTriple::vec.

Referenced by calc_keyHandles().

◆ calc_duplicate_actnurb()

static void calc_duplicate_actnurb ( const ListBase * editnurb,
const ListBase * newnurb,
Curve * cu )
static

Definition at line 2176 of file editcurve.cc.

References Curve::actnu, and BLI_listbase_count().

Referenced by adduplicateflagNurb(), and calc_duplicate_actvert().

◆ calc_duplicate_actvert()

static bool calc_duplicate_actvert ( const ListBase * editnurb,
const ListBase * newnurb,
Curve * cu,
int start,
int end,
int vert )
static

Definition at line 2181 of file editcurve.cc.

References Curve::actvert, and calc_duplicate_actnurb().

Referenced by adduplicateflagNurb().

◆ calc_keyHandles()

◆ calc_shapeKeys()

◆ clear_tilt_exec()

◆ curve_decimate_exec()

◆ curve_delete_exec()

◆ curve_delete_segments()

◆ curve_delete_vertices()

static bool curve_delete_vertices ( Object * obedit,
View3D * v3d )
static

Definition at line 6073 of file editcurve.cc.

References ed_curve_delete_selected(), ed_surf_delete_selected(), OB_SURF, and Object::type.

Referenced by curve_delete_exec().

◆ curve_dissolve_exec()

◆ curve_extrude_exec()

◆ curve_is_animated()

static bool curve_is_animated ( Curve * cu)
static

◆ curve_normals_make_consistent_exec()

◆ CURVE_OT_cyclic_toggle()

◆ CURVE_OT_decimate()

◆ CURVE_OT_delete()

◆ CURVE_OT_dissolve_verts()

◆ CURVE_OT_duplicate()

◆ CURVE_OT_extrude()

◆ CURVE_OT_handle_type_set()

◆ CURVE_OT_hide()

◆ CURVE_OT_make_segment()

◆ CURVE_OT_match_texture_space()

◆ CURVE_OT_normals_make_consistent()

◆ CURVE_OT_radius_set()

◆ CURVE_OT_reveal()

◆ CURVE_OT_separate()

◆ CURVE_OT_shade_flat()

◆ CURVE_OT_shade_smooth()

◆ CURVE_OT_smooth()

◆ CURVE_OT_smooth_radius()

◆ CURVE_OT_smooth_tilt()

◆ CURVE_OT_smooth_weight()

◆ CURVE_OT_spin()

◆ CURVE_OT_spline_type_set()

◆ CURVE_OT_spline_weight_set()

◆ CURVE_OT_split()

◆ CURVE_OT_subdivide()

◆ CURVE_OT_switch_direction()

◆ CURVE_OT_tilt_clear()

◆ CURVE_OT_vertex_add()

◆ curve_rename_fcurves()

static blender::Vector< FCurve * > curve_rename_fcurves ( Curve * cu,
blender::Span< FCurve * > orig_curves )
staticnodiscard

◆ curve_smooth_radius_exec()

◆ curve_smooth_tilt_exec()

◆ curve_smooth_value()

static void curve_smooth_value ( ListBase * editnurb,
const int bezt_offsetof,
const int bp_offset )
static

◆ curve_smooth_weight_exec()

◆ curve_split_exec()

◆ curve_toggle_cyclic()

◆ duplicate_exec()

◆ ED_curve_beztcpy()

void ED_curve_beztcpy ( EditNurb * editnurb,
BezTriple * dst,
BezTriple * src,
int count )

◆ ED_curve_bpcpy()

◆ ed_curve_delete_selected()

◆ ED_curve_editnurb_free()

void ED_curve_editnurb_free ( Object * obedit)

◆ ED_curve_editnurb_load()

◆ ED_curve_editnurb_make()

◆ ED_curve_editnurb_select_pick()

◆ ED_curve_get_edit_shape_key()

KeyBlock * ED_curve_get_edit_shape_key ( const Curve * cu)

◆ ED_curve_join_objects_exec()

◆ ED_curve_keyindex_hash_duplicate()

◆ ED_curve_keyindex_update_nurb()

void ED_curve_keyindex_update_nurb ( EditNurb * editnurb,
Nurb * nu,
Nurb * newnu )

◆ ED_curve_updateAnimPaths()

◆ ed_dissolve_bez_segment()

void 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] )

◆ ed_editcurve_addvert()

◆ ed_editcurve_extrude()

◆ ed_editnurb_extrude_flag()

◆ ed_editnurb_spin()

◆ ed_editnurb_translate_flag()

void ed_editnurb_translate_flag ( ListBase * editnurb,
uint8_t flag,
const float vec[3],
bool is_2d )

◆ ed_surf_delete_selected()

◆ editnurb_find_max_points_num()

static NurbDim editnurb_find_max_points_num ( const EditNurb * editnurb)
static

◆ fcurve_path_rename()

static void fcurve_path_rename ( const char * orig_rna_path,
const char * rna_path,
const blender::Span< FCurve * > orig_curves,
blender::Set< FCurve * > & processed_fcurves )
static

◆ getCVKeyIndex()

static CVKeyIndex * getCVKeyIndex ( EditNurb * editnurb,
const void * cv )
static

◆ getKeyIndexOrig_bezt()

static BezTriple * getKeyIndexOrig_bezt ( EditNurb * editnurb,
const BezTriple * bezt )
static

Definition at line 236 of file editcurve.cc.

References getCVKeyIndex().

Referenced by calc_shapeKeys(), and switch_keys_direction().

◆ getKeyIndexOrig_bp()

static BPoint * getKeyIndexOrig_bp ( EditNurb * editnurb,
BPoint * bp )
static

Definition at line 247 of file editcurve.cc.

References getCVKeyIndex().

Referenced by calc_shapeKeys(), and switch_keys_direction().

◆ getKeyIndexOrig_keyIndex()

static int getKeyIndexOrig_keyIndex ( EditNurb * editnurb,
void * cv )
static

Definition at line 258 of file editcurve.cc.

References getCVKeyIndex().

Referenced by calc_shapeKeys().

◆ hide_exec()

◆ init_cvKeyIndex()

static CVKeyIndex * init_cvKeyIndex ( void * cv,
int key_index,
int nu_index,
int pt_index,
int vertex_index )
static

◆ init_editNurb_keyIndex()

◆ init_index_map()

static int * init_index_map ( Object * obedit,
int * r_old_totvert )
static

◆ is_u_selected()

static bool is_u_selected ( Nurb * nu,
int u )
static

Definition at line 4208 of file editcurve.cc.

References Nurb::bp, BPoint::f1, Nurb::pntsu, Nurb::pntsv, SELECT, and v.

Referenced by merge_2_nurb().

◆ isNurbselU()

static bool isNurbselU ( Nurb * nu,
int * v,
int flag )
static

◆ isNurbselV()

static bool isNurbselV ( Nurb * nu,
int * u,
int flag )
static

Definition at line 1624 of file editcurve.cc.

References b, Nurb::bp, flag, Nurb::pntsu, and Nurb::pntsv.

Referenced by adduplicateflagNurb(), curve_delete_segments(), and ed_surf_delete_selected().

◆ key_to_bezt()

static void key_to_bezt ( float * key,
BezTriple * basebezt,
BezTriple * bezt )
static

Definition at line 565 of file editcurve.cc.

References BezTriple::radius, BezTriple::tilt, and BezTriple::vec.

Referenced by calc_keyHandles().

◆ keyData_switchDirectionNurb()

static void keyData_switchDirectionNurb ( Curve * cu,
Nurb * nu )
static

◆ keyIndex_delBezt()

static void keyIndex_delBezt ( EditNurb * editnurb,
BezTriple * bezt )
static

Definition at line 269 of file editcurve.cc.

References BKE_curve_editNurb_keyIndex_delCV(), and EditNurb::keyindex.

Referenced by ed_curve_delete_selected().

◆ keyIndex_delBP()

static void keyIndex_delBP ( EditNurb * editnurb,
BPoint * bp )
static

◆ keyIndex_delNurb()

static void keyIndex_delNurb ( EditNurb * editnurb,
Nurb * nu )
static

◆ keyIndex_delNurbList()

static void keyIndex_delNurbList ( EditNurb * editnurb,
ListBase * nubase )
static

Definition at line 315 of file editcurve.cc.

References keyIndex_delNurb(), and LISTBASE_FOREACH.

Referenced by curve_delete_segments().

◆ keyIndex_swap()

static void keyIndex_swap ( EditNurb * editnurb,
void * a,
void * b )
static

Definition at line 364 of file editcurve.cc.

References b, BLI_ghash_insert(), EditNurb::keyindex, and popCVKeyIndex().

Referenced by keyIndex_switchDirection().

◆ keyIndex_switchDirection()

static void keyIndex_switchDirection ( EditNurb * editnurb,
Nurb * nu )
static

◆ keyIndex_updateBezt()

static void keyIndex_updateBezt ( EditNurb * editnurb,
BezTriple * bezt,
BezTriple * newbezt,
int count )
static

◆ keyIndex_updateBP()

static void keyIndex_updateBP ( EditNurb * editnurb,
BPoint * bp,
BPoint * newbp,
int count )
static

◆ keyIndex_updateCV()

static void keyIndex_updateCV ( EditNurb * editnurb,
char * cv,
char * newcv,
int count,
int size )
static

Definition at line 322 of file editcurve.cc.

References BLI_ghash_insert(), count, EditNurb::keyindex, popCVKeyIndex(), and size().

Referenced by keyIndex_updateBezt(), and keyIndex_updateBP().

◆ make_segment_exec()

◆ make_selection_list_nurb()

◆ match_texture_space_exec()

◆ match_texture_space_poll()

static bool match_texture_space_poll ( bContext * C)
static

Definition at line 7146 of file editcurve.cc.

References CTX_data_active_object(), ELEM, OB_CURVES_LEGACY, OB_FONT, and OB_SURF.

Referenced by CURVE_OT_match_texture_space().

◆ merge_2_nurb()

◆ merge_nurb()

◆ nurb_bezt_flag_any()

static bool nurb_bezt_flag_any ( const Nurb * nu,
const char flag_test )
static

Definition at line 6768 of file editcurve.cc.

References Nurb::bezt, BezTriple::f2, and Nurb::pntsu.

Referenced by curve_decimate_exec().

◆ object_editcurve_get()

◆ popCVKeyIndex()

static CVKeyIndex * popCVKeyIndex ( EditNurb * editnurb,
const void * cv )
static

Definition at line 231 of file editcurve.cc.

References BLI_ghash_popkey(), and EditNurb::keyindex.

Referenced by keyIndex_swap(), and keyIndex_updateCV().

◆ remap_hooks_and_vertex_parents()

static void remap_hooks_and_vertex_parents ( Main * bmain,
Object * obedit )
static

◆ reveal_exec()

◆ rna_curve_delete_type_itemf()

static const EnumPropertyItem * rna_curve_delete_type_itemf ( bContext * C,
PointerRNA * ,
PropertyRNA * ,
bool * r_free )
static

◆ rotate_direction_nurb()

static void rotate_direction_nurb ( Nurb * nu)
static

◆ rotateflagNurb()

static void rotateflagNurb ( ListBase * editnurb,
short flag,
const float cent[3],
const float rotmat[3][3] )
static

◆ sel_to_copy_ints()

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

Calculate and return fully selected legs along i dimension. Calculates intervals to create extrusion by duplicating existing points while copied to destination NURBS. For ex. for curve of 3 points indexed by 0..2 to extrude first and last point copy intervals would be [0, 0][0, 2][2, 2]. Representation in copy_intervals array would be [0, 0, 2, 2]. Returns -1 if selection is not valid.

Definition at line 1994 of file editcurve.cc.

References BPoint::f1, flag, and max_i().

Referenced by ed_editnurb_extrude_flag().

◆ select_bpoints()

static void select_bpoints ( BPoint * bp,
const int stride,
const int count,
const bool selstatus,
const uint8_t flag,
const bool hidden )
static

Definition at line 1974 of file editcurve.cc.

References count, flag, and select_bpoint().

Referenced by ed_editnurb_extrude_flag().

◆ selectend_nurb()

void selectend_nurb ( Object * obedit,
enum eEndPoint_Types selfirst,
bool doswap,
bool selstatus )

◆ separate_exec()

◆ set_goal_weight_exec()

◆ set_handle_type_exec()

◆ set_radius_exec()

◆ set_spline_type_exec()

◆ shade_smooth_exec()

◆ smooth_exec()

◆ smooth_single_bezt()

static void smooth_single_bezt ( BezTriple * bezt,
const BezTriple * bezt_orig_prev,
const BezTriple * bezt_orig_next,
float factor )
static

Definition at line 2807 of file editcurve.cc.

References BLI_assert, IN_RANGE_INCL, and BezTriple::vec.

Referenced by smooth_exec().

◆ smooth_single_bp()

static void smooth_single_bp ( BPoint * bp,
const BPoint * bp_orig_prev,
const BPoint * bp_orig_next,
float factor )
static

Same as smooth_single_bezt(), keep in sync.

Definition at line 2832 of file editcurve.cc.

References BLI_assert, IN_RANGE_INCL, and BPoint::vec.

Referenced by smooth_exec().

◆ spin_exec()

◆ spin_invoke()

static int spin_invoke ( bContext * C,
wmOperator * op,
const wmEvent *  )
static

◆ subdivide_exec()

◆ subdividenurb()

static void subdividenurb ( Object * obedit,
View3D * v3d,
int number_cuts )
static

Divide the line segments associated with the currently selected curve nodes (Bezier or NURB). If there are no valid segment selections within the current selection, nothing happens.

NOTE(@nzc): Subdivide NURB surfaces

Subdivision of a NURB curve can be effected by adding a control point (insertion of a knot), or by raising the degree of the functions used to build the NURB. The expression

`degree = knots - controlpoints + 1` (J Walter piece)
`degree = knots - controlpoints` (Blender implementation)
  ( this is confusing.... what is true? Another concern
  is that the JW piece allows the curve to become
  explicitly 1st order derivative discontinuous, while
  this is not what we want here... )

is an invariant for a single NURB curve. Raising the degree of the NURB is done elsewhere; the degree is assumed constant during this operation. Degree is a property shared by all control-points in a curve (even though it is stored per control point - this can be misleading). Adding a knot is done by searching for the place in the knot vector where a certain knot value must be inserted, or by picking an appropriate knot value between two existing ones. The number of control-points that is influenced by the insertion depends on the order of the curve. A certain minimum number of knots is needed to form high-order curves, as can be seen from the equation above. In Blender, currently NURBs may be up to 6th order, so we modify at most 6 points. One point is added. For an n-degree curve, n points are discarded, and n+1 points inserted (so effectively, n points are modified). (that holds for the JW piece, but it seems not for our NURBs) In practice, the knot spacing is copied, but the tail (the points following the insertion point) need to be offset to keep the knot series ascending. The knot series is always a series of monotonically ascending integers in Blender. When not enough control points are available to fit the order, duplicates of the endpoints are added as needed.

Definition at line 3474 of file editcurve.cc.

References b, Nurb::bezt, BEZT_ISSEL_ANY_HIDDENHANDLES, BKE_nurb_bezt_get_next(), BKE_nurb_bpoint_get_next(), BKE_nurb_handles_calc(), BKE_nurb_knot_calc_u(), BKE_nurb_knot_calc_v(), Nurb::bp, copy_v3_v3(), CU_BEZIER, CU_NURB_CYCLIC, CU_NURBS, Object::data, Curve::editnurb, BPoint::f1, Nurb::flagu, float, interp_v3_v3v3(), interp_v4_v4v4(), interpf(), keyIndex_updateBezt(), keyIndex_updateBP(), LISTBASE_FOREACH, MEM_callocN, MEM_freeN(), MEM_mallocN, EditNurb::nurbs, Nurb::pntsu, Nurb::pntsv, BezTriple::radius, BPoint::radius, SELECT, Nurb::type, BezTriple::vec, BPoint::vec, and BezTriple::weight.

Referenced by subdivide_exec().

◆ switch_direction_exec()

◆ switch_keys_direction()

◆ switchdirection_knots()

static void switchdirection_knots ( float * base,
int tot )
static

Definition at line 4138 of file editcurve.cc.

References fabsf, MEM_freeN(), and MEM_mallocN.

Referenced by rotate_direction_nurb().

◆ test_bezt_is_sel_any()

static bool test_bezt_is_sel_any ( const void * bezt_v,
void * user_data )
static

Definition at line 6622 of file editcurve.cc.

References BEZT_ISSEL_ANY_HIDDENHANDLES.

Referenced by curve_dissolve_exec().

◆ toggle_cyclic_exec()

◆ toggle_cyclic_invoke()

◆ weightflagNurb()

static void weightflagNurb ( ListBase * editnurb,
short flag,
float w )
static

Variable Documentation

◆ curve_delete_type_items

const EnumPropertyItem curve_delete_type_items[]
static
Initial value:
= {
{CURVE_VERTEX, "VERT", 0, "Vertices", ""},
{CURVE_SEGMENT, "SEGMENT", 0, "Segments", ""},
{0, nullptr, 0, nullptr, nullptr},
}
@ CURVE_VERTEX
@ CURVE_SEGMENT

Definition at line 6565 of file editcurve.cc.

Referenced by CURVE_OT_delete(), and rna_curve_delete_type_itemf().