Blender  V3.3
Classes | Macros | Functions
editcurve.c 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_math.h"
#include "BLT_translation.h"
#include "BKE_action.h"
#include "BKE_anim_data.h"
#include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_displist.h"
#include "BKE_fcurve.h"
#include "BKE_global.h"
#include "BKE_key.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_modifier.h"
#include "BKE_report.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
#include "DEG_depsgraph_query.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_curve.h"
#include "ED_object.h"
#include "ED_outliner.h"
#include "ED_screen.h"
#include "ED_select_utils.h"
#include "ED_transform.h"
#include "ED_transform_snap_object_context.h"
#include "ED_types.h"
#include "ED_view3d.h"
#include "curve_intern.h"
#include "curve_fit_nd.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"

Go to the source code of this file.

Classes

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 isNurbselUV (const Nurb *nu, uint8_t flag, int *r_u, int *r_v)
 
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)
 
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
ListBase * object_editcurve_get (Object *ob)
 
Shape keys
static CVKeyIndex * init_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 CVKeyIndex * getCVKeyIndex (EditNurb *editnurb, const void *cv)
 
static CVKeyIndex * popCVKeyIndex (EditNurb *editnurb, const void *cv)
 
static BezTriple * getKeyIndexOrig_bezt (EditNurb *editnurb, const BezTriple *bezt)
 
static BPoint * getKeyIndexOrig_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)
 
GHash * ED_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 (AnimData *adt, const char *orig_rna_path, const char *rna_path, ListBase *orig_curves, ListBase *curves)
 
static void fcurve_remove (AnimData *adt, ListBase *orig_curves, FCurve *fcu)
 
static void curve_rename_fcurves (Curve *cu, ListBase *orig_curves)
 
int ED_curve_updateAnimPaths (Main *bmain, Curve *cu)
 
Edit Mode Conversion (Make & Load)
static int * init_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 *UNUSED(op))
 
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 *UNUSED(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 *UNUSED(op))
 
void CURVE_OT_smooth_weight (wmOperatorType *ot)
 
Smooth Radius Operator
static int curve_smooth_radius_exec (bContext *C, wmOperator *UNUSED(op))
 
void CURVE_OT_smooth_radius (wmOperatorType *ot)
 
Smooth Tilt Operator
static int curve_smooth_tilt_exec (bContext *C, wmOperator *UNUSED(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 bool vert_without_handles, const struct 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 *UNUSED(event))
 
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 *UNUSED(op))
 
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 *UNUSED(event))
 
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 *UNUSED(op))
 
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 *UNUSED(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 *UNUSED(op))
 
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 }
 
typedef struct NurbSort NurbSort
 
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 EnumPropertyItem * rna_curve_delete_type_itemf (bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
 
void CURVE_OT_delete (wmOperatorType *ot)
 

Macro Definition Documentation

◆ BEZT_VALUE

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

◆ BP_VALUE

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

Typedef Documentation

◆ NurbSort

typedef struct NurbSort NurbSort

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 4193 of file editcurve.c.

Function Documentation

◆ add_vertex_exec()

static int add_vertex_exec ( bContext *  C,
wmOperator *  op 
)
static

◆ add_vertex_invoke()

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

◆ adduplicateflagNurb()

static void adduplicateflagNurb ( Object *  obedit,
View3D *  v3d,
ListBase *  newnurb,
const uint8_t  flag,
const bool  split 
)
static

◆ bezt_to_key()

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

Definition at line 550 of file editcurve.c.

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 2095 of file editcurve.c.

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 2100 of file editcurve.c.

References Curve::actvert, and calc_duplicate_actnurb().

Referenced by adduplicateflagNurb().

◆ calc_keyHandles()

static void calc_keyHandles ( ListBase *  nurb,
float *  key 
)
static

◆ calc_shapeKeys()

static void calc_shapeKeys ( Object *  obedit,
ListBase *  newnurbs 
)
static

◆ clear_tilt_exec()

static int clear_tilt_exec ( bContext *  C,
wmOperator *  UNUSEDop 
)
static

◆ curve_decimate_exec()

static int curve_decimate_exec ( bContext *  C,
wmOperator *  op 
)
static

◆ curve_delete_exec()

static int curve_delete_exec ( bContext *  C,
wmOperator *  op 
)
static

◆ curve_delete_segments()

static bool curve_delete_segments ( Object *  obedit,
View3D *  v3d,
const bool  split 
)
static

◆ curve_delete_vertices()

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

◆ curve_dissolve_exec()

static int curve_dissolve_exec ( bContext *  C,
wmOperator *  UNUSEDop 
)
static

◆ curve_extrude_exec()

static int curve_extrude_exec ( bContext *  C,
wmOperator *  UNUSEDop 
)
static

◆ curve_is_animated()

static bool curve_is_animated ( Curve *  cu)
static

◆ curve_normals_make_consistent_exec()

static int curve_normals_make_consistent_exec ( bContext *  C,
wmOperator *  op 
)
static

◆ CURVE_OT_cyclic_toggle()

void CURVE_OT_cyclic_toggle ( wmOperatorType *  ot)

◆ CURVE_OT_decimate()

void CURVE_OT_decimate ( wmOperatorType *  ot)

◆ CURVE_OT_delete()

void CURVE_OT_delete ( wmOperatorType *  ot)

◆ CURVE_OT_dissolve_verts()

void CURVE_OT_dissolve_verts ( wmOperatorType *  ot)

◆ CURVE_OT_duplicate()

void CURVE_OT_duplicate ( wmOperatorType *  ot)

◆ CURVE_OT_extrude()

void CURVE_OT_extrude ( wmOperatorType *  ot)

◆ CURVE_OT_handle_type_set()

void CURVE_OT_handle_type_set ( wmOperatorType *  ot)

◆ CURVE_OT_hide()

void CURVE_OT_hide ( wmOperatorType *  ot)

◆ CURVE_OT_make_segment()

void CURVE_OT_make_segment ( wmOperatorType *  ot)

◆ CURVE_OT_match_texture_space()

void CURVE_OT_match_texture_space ( wmOperatorType *  ot)

◆ CURVE_OT_normals_make_consistent()

void CURVE_OT_normals_make_consistent ( wmOperatorType *  ot)

◆ CURVE_OT_radius_set()

void CURVE_OT_radius_set ( wmOperatorType *  ot)

◆ CURVE_OT_reveal()

void CURVE_OT_reveal ( wmOperatorType *  ot)

◆ CURVE_OT_separate()

void CURVE_OT_separate ( wmOperatorType *  ot)

◆ CURVE_OT_shade_flat()

void CURVE_OT_shade_flat ( wmOperatorType *  ot)

◆ CURVE_OT_shade_smooth()

void CURVE_OT_shade_smooth ( wmOperatorType *  ot)

◆ CURVE_OT_smooth()

void CURVE_OT_smooth ( wmOperatorType *  ot)

◆ CURVE_OT_smooth_radius()

void CURVE_OT_smooth_radius ( wmOperatorType *  ot)

◆ CURVE_OT_smooth_tilt()

void CURVE_OT_smooth_tilt ( wmOperatorType *  ot)

◆ CURVE_OT_smooth_weight()

void CURVE_OT_smooth_weight ( wmOperatorType *  ot)

◆ CURVE_OT_spin()

void CURVE_OT_spin ( wmOperatorType *  ot)

◆ CURVE_OT_spline_type_set()

void CURVE_OT_spline_type_set ( wmOperatorType *  ot)

◆ CURVE_OT_spline_weight_set()

void CURVE_OT_spline_weight_set ( wmOperatorType *  ot)

◆ CURVE_OT_split()

void CURVE_OT_split ( wmOperatorType *  ot)

◆ CURVE_OT_subdivide()

void CURVE_OT_subdivide ( wmOperatorType *  ot)

◆ CURVE_OT_switch_direction()

void CURVE_OT_switch_direction ( wmOperatorType *  ot)

◆ CURVE_OT_tilt_clear()

void CURVE_OT_tilt_clear ( wmOperatorType *  ot)

◆ CURVE_OT_vertex_add()

void CURVE_OT_vertex_add ( wmOperatorType *  ot)

◆ curve_rename_fcurves()

static void curve_rename_fcurves ( Curve *  cu,
ListBase *  orig_curves 
)
static

◆ curve_smooth_radius_exec()

static int curve_smooth_radius_exec ( bContext *  C,
wmOperator *  UNUSEDop 
)
static

◆ curve_smooth_tilt_exec()

static int curve_smooth_tilt_exec ( bContext *  C,
wmOperator *  UNUSEDop 
)
static

◆ curve_smooth_value()

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

◆ curve_smooth_weight_exec()

static int curve_smooth_weight_exec ( bContext *  C,
wmOperator *  UNUSEDop 
)
static

◆ curve_split_exec()

static int curve_split_exec ( bContext *  C,
wmOperator *  op 
)
static

◆ curve_toggle_cyclic()

bool curve_toggle_cyclic ( View3D *  v3d,
ListBase *  editnurb,
int  direction 
)

◆ duplicate_exec()

static int duplicate_exec ( bContext *  C,
wmOperator *  op 
)
static

◆ ED_curve_beztcpy()

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

◆ ED_curve_bpcpy()

void ED_curve_bpcpy ( EditNurb *  editnurb,
BPoint *  dst,
BPoint *  src,
int  count 
)

◆ ed_curve_delete_selected()

static void ed_curve_delete_selected ( Object *  obedit,
View3D *  v3d 
)
static

◆ ED_curve_editnurb_free()

void ED_curve_editnurb_free ( Object *  obedit)

Definition at line 1316 of file editcurve.c.

References BKE_curve_editNurb_free(), and Object::data.

Referenced by ED_object_editmode_load_free_ex(), and separate_exec().

◆ ED_curve_editnurb_load()

void ED_curve_editnurb_load ( struct Main *  bmain,
struct Object *  obedit 
)

◆ ED_curve_editnurb_make()

void ED_curve_editnurb_make ( struct Object *  obedit)

◆ ED_curve_editnurb_select_pick()

bool ED_curve_editnurb_select_pick ( struct bContext *  C,
const int  mval[2],
int  dist_px,
bool  vert_without_handles,
const struct SelectPick_Params *  params 
)

◆ ED_curve_join_objects_exec()

int ED_curve_join_objects_exec ( struct bContext *  C,
struct wmOperator *  op 
)

◆ ED_curve_keyindex_hash_duplicate()

GHash* ED_curve_keyindex_hash_duplicate ( GHash *  keyindex)

◆ ED_curve_keyindex_update_nurb()

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

◆ ED_curve_updateAnimPaths()

int ED_curve_updateAnimPaths ( struct Main *  bmain,
struct Curve *  cu 
)

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

int ed_editcurve_addvert ( Curve *  cu,
EditNurb *  editnurb,
View3D *  v3d,
const float  location_init[3] 
)

◆ ed_editcurve_extrude()

static bool ed_editcurve_extrude ( Curve *  cu,
EditNurb *  editnurb,
View3D *  v3d 
)
static

◆ ed_editnurb_extrude_flag()

bool ed_editnurb_extrude_flag ( struct EditNurb *  editnurb,
uint8_t  flag 
)

◆ ed_editnurb_spin()

bool ed_editnurb_spin ( float  viewmat[4][4],
struct View3D *  v3d,
struct Object *  obedit,
const float  axis[3],
const float  cent[3] 
)

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

static void ed_surf_delete_selected ( Object *  obedit)
static

◆ fcurve_path_rename()

static void fcurve_path_rename ( AnimData *  adt,
const char *  orig_rna_path,
const char *  rna_path,
ListBase *  orig_curves,
ListBase *  curves 
)
static

◆ fcurve_remove()

static void fcurve_remove ( AnimData *  adt,
ListBase *  orig_curves,
FCurve *  fcu 
)
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 214 of file editcurve.c.

References getCVKeyIndex(), NULL, and CVKeyIndex::orig_cv.

Referenced by calc_shapeKeys(), and switch_keys_direction().

◆ getKeyIndexOrig_bp()

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

Definition at line 225 of file editcurve.c.

References getCVKeyIndex(), NULL, and CVKeyIndex::orig_cv.

Referenced by calc_shapeKeys(), and switch_keys_direction().

◆ getKeyIndexOrig_keyIndex()

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

Definition at line 236 of file editcurve.c.

References getCVKeyIndex(), and CVKeyIndex::key_index.

Referenced by calc_shapeKeys().

◆ hide_exec()

static int hide_exec ( bContext *  C,
wmOperator *  op 
)
static

◆ init_cvKeyIndex()

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

◆ init_editNurb_keyIndex()

static void init_editNurb_keyIndex ( EditNurb *  editnurb,
ListBase *  origBase 
)
static

◆ 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 4107 of file editcurve.c.

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

◆ isNurbselUV()

static bool isNurbselUV ( const Nurb *  nu,
uint8_t  flag,
int *  r_u,
int *  r_v 
)
static

Definition at line 1544 of file editcurve.c.

References Freestyle::a, usdtokens::b(), Nurb::bp, BPoint::f1, Nurb::pntsu, and Nurb::pntsv.

Referenced by ed_editnurb_extrude_flag().

◆ isNurbselV()

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

◆ key_to_bezt()

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

Definition at line 542 of file editcurve.c.

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 247 of file editcurve.c.

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 293 of file editcurve.c.

References keyIndex_delNurb(), and LISTBASE_FOREACH.

Referenced by curve_delete_segments().

◆ keyIndex_swap()

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

◆ 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 300 of file editcurve.c.

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

Referenced by keyIndex_updateBezt(), and keyIndex_updateBP().

◆ make_segment_exec()

static int make_segment_exec ( bContext *  C,
wmOperator *  op 
)
static

◆ make_selection_list_nurb()

static void make_selection_list_nurb ( View3D *  v3d,
ListBase *  editnurb,
ListBase *  nsortbase 
)
static

◆ match_texture_space_exec()

static int match_texture_space_exec ( bContext *  C,
wmOperator *  UNUSEDop 
)
static

◆ match_texture_space_poll()

static bool match_texture_space_poll ( bContext *  C)
static

◆ merge_2_nurb()

static bool merge_2_nurb ( Curve *  cu,
ListBase *  editnurb,
Nurb *  nu1,
Nurb *  nu2 
)
static

◆ merge_nurb()

static int merge_nurb ( View3D *  v3d,
Object *  obedit 
)
static

◆ nurb_bezt_flag_any()

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

Definition at line 6690 of file editcurve.c.

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

Referenced by curve_decimate_exec().

◆ object_editcurve_get()

ListBase* object_editcurve_get ( Object *  ob)

◆ popCVKeyIndex()

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

Definition at line 209 of file editcurve.c.

References BLI_ghash_popkey(), EditNurb::keyindex, and NULL.

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

static int reveal_exec ( bContext *  C,
wmOperator *  op 
)
static

◆ rna_curve_delete_type_itemf()

static const EnumPropertyItem* rna_curve_delete_type_itemf ( bContext *  C,
PointerRNA *  UNUSEDptr,
PropertyRNA *  UNUSEDprop,
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

◆ selectend_nurb()

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

◆ separate_exec()

static int separate_exec ( bContext *  C,
wmOperator *  op 
)
static

◆ set_goal_weight_exec()

static int set_goal_weight_exec ( bContext *  C,
wmOperator *  op 
)
static

◆ set_handle_type_exec()

static int set_handle_type_exec ( bContext *  C,
wmOperator *  op 
)
static

◆ set_radius_exec()

static int set_radius_exec ( bContext *  C,
wmOperator *  op 
)
static

◆ set_spline_type_exec()

static int set_spline_type_exec ( bContext *  C,
wmOperator *  op 
)
static

◆ shade_smooth_exec()

static int shade_smooth_exec ( bContext *  C,
wmOperator *  op 
)
static

◆ smooth_exec()

static int smooth_exec ( bContext *  C,
wmOperator *  UNUSEDop 
)
static

◆ 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 2720 of file editcurve.c.

References BLI_assert, IN_RANGE_INCL, offset, 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 2745 of file editcurve.c.

References BLI_assert, IN_RANGE_INCL, offset, and BPoint::vec.

Referenced by smooth_exec().

◆ spin_exec()

static int spin_exec ( bContext *  C,
wmOperator *  op 
)
static

◆ spin_invoke()

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

◆ subdivide_exec()

static int subdivide_exec ( bContext *  C,
wmOperator *  op 
)
static

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

Subdivide NURB surfaces - nzc 30-5-'00 -

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 3375 of file editcurve.c.

References Freestyle::a, usdtokens::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, NULL, 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()

static int switch_direction_exec ( bContext *  C,
wmOperator *  UNUSEDop 
)
static

◆ switch_keys_direction()

static void switch_keys_direction ( Curve *  cu,
Nurb *  actnu 
)
static

◆ switchdirection_knots()

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

Definition at line 4037 of file editcurve.c.

References Freestyle::a, fabsf, MEM_freeN, MEM_mallocN, NULL, and SWAP.

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 6543 of file editcurve.c.

References BEZT_ISSEL_ANY_HIDDENHANDLES, user_data, and SnapObjectContext::v3d.

Referenced by curve_dissolve_exec().

◆ toggle_cyclic_exec()

static int toggle_cyclic_exec ( bContext *  C,
wmOperator *  op 
)
static

◆ toggle_cyclic_invoke()

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

◆ 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, NULL, 0, NULL, NULL},
}
@ CURVE_VERTEX
Definition: curve_intern.h:54
@ CURVE_SEGMENT
Definition: curve_intern.h:55

Definition at line 6486 of file editcurve.c.

Referenced by CURVE_OT_delete(), and rna_curve_delete_type_itemf().