Blender V2.61 - r43446
Classes | Defines | Typedefs | Functions | Variables

editcurve.c File Reference

#include <math.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include "DNA_key_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_anim_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_dynstr.h"
#include "BLI_rand.h"
#include "BLI_utildefines.h"
#include "BLI_ghash.h"
#include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_depsgraph.h"
#include "BKE_fcurve.h"
#include "BKE_global.h"
#include "BKE_key.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_report.h"
#include "BKE_animsys.h"
#include "BKE_action.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_keyframes_edit.h"
#include "ED_object.h"
#include "ED_screen.h"
#include "ED_transform.h"
#include "ED_types.h"
#include "ED_util.h"
#include "ED_view3d.h"
#include "ED_curve.h"
#include "curve_intern.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  UndoCurve
struct  CVKeyIndex
struct  NurbSort

Defines

#define callocstructN(x, y, name)   (x*)MEM_callocN((y)* sizeof(x),name)
#define HIDDEN   1
#define VISIBLE   0
#define FIRST   1
#define LAST   0

Typedefs

typedef struct NurbSort NurbSort

Functions

void selectend_nurb (Object *obedit, short selfirst, short doswap, short selstatus)
static void select_adjacent_cp (ListBase *editnurb, short next, short cont, short selstatus)
ListBaseobject_editcurve_get (Object *ob)
static void set_actNurb (Object *obedit, Nurb *nu)
static Nurbget_actNurb (Object *obedit)
static short select_beztriple (BezTriple *bezt, short selstatus, short flag, short hidden)
static short select_bpoint (BPoint *bp, short selstatus, short flag, short hidden)
static short swap_selection_beztriple (BezTriple *bezt)
static short swap_selection_bpoint (BPoint *bp)
int isNurbsel (Nurb *nu)
static int isNurbsel_count (Curve *cu, Nurb *nu)
void printknots (Object *obedit)
static CVKeyIndexinit_cvKeyIndex (void *cv, int key_index, int nu_index, int pt_index, Nurb *orig_nu)
static void init_editNurb_keyIndex (EditNurb *editnurb, ListBase *origBase)
static CVKeyIndexgetCVKeyIndex (EditNurb *editnurb, void *cv)
static BezTriplegetKeyIndexOrig_bezt (EditNurb *editnurb, BezTriple *bezt)
static BPointgetKeyIndexOrig_bp (EditNurb *editnurb, BPoint *bp)
static int getKeyIndexOrig_keyIndex (EditNurb *editnurb, void *cv)
static void keyIndex_delCV (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)
static void keyIndex_updateNurb (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)
static GHashdupli_keyIndexHash (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)
static int curve_is_animated (Object *ob)
static void fcurve_path_rename (AnimData *ad, char *orig_rna_path, char *rna_path, ListBase *orig_curves, ListBase *curves)
static void fcurve_remove (AnimData *ad, ListBase *orig_curves, FCurve *fcu)
static void curve_rename_fcurves (Object *obedit, ListBase *orig_curves)
int ED_curve_updateAnimPaths (Object *obedit)
void load_editNurb (Object *obedit)
void make_editNurb (Object *obedit)
void free_editNurb (Object *obedit)
void CU_deselect_all (Object *obedit)
void CU_select_all (Object *obedit)
void CU_select_swap (Object *obedit)
static int separate_exec (bContext *C, wmOperator *op)
void CURVE_OT_separate (wmOperatorType *ot)
static short isNurbselUV (Nurb *nu, int *u, int *v, int flag)
static void setflagsNurb (ListBase *editnurb, short flag)
static void rotateflagNurb (ListBase *editnurb, short flag, float *cent, float rotmat[][3])
static void translateflagNurb (ListBase *editnurb, short flag, float *vec)
static void weightflagNurb (ListBase *editnurb, short flag, float w)
static int deleteflagNurb (bContext *C, wmOperator *UNUSED(op), int flag)
static short extrudeflagNurb (EditNurb *editnurb, int flag)
static void adduplicateflagNurb (Object *obedit, short flag)
static int switch_direction_exec (bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_switch_direction (wmOperatorType *ot)
static int set_goal_weight_exec (bContext *C, wmOperator *op)
void CURVE_OT_spline_weight_set (wmOperatorType *ot)
static int set_radius_exec (bContext *C, wmOperator *op)
void CURVE_OT_radius_set (wmOperatorType *ot)
static int smooth_exec (bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_smooth (wmOperatorType *ot)
static int smooth_radius_exec (bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_smooth_radius (wmOperatorType *ot)
static int de_select_first_exec (bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_de_select_first (wmOperatorType *ot)
static int de_select_last_exec (bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_de_select_last (wmOperatorType *ot)
static short nurb_has_selected_cps (ListBase *editnurb)
static int de_select_all_exec (bContext *C, wmOperator *op)
void CURVE_OT_select_all (wmOperatorType *ot)
static int hide_exec (bContext *C, wmOperator *op)
void CURVE_OT_hide (wmOperatorType *ot)
static int reveal_exec (bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_reveal (wmOperatorType *ot)
static void subdividenurb (Object *obedit, int number_cuts)
static int subdivide_exec (bContext *C, wmOperator *op)
void CURVE_OT_subdivide (wmOperatorType *ot)
static void findnearestNurbvert__doClosest (void *userData, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y)
static short findnearestNurbvert (ViewContext *vc, short sel, const int mval[2], Nurb **nurb, BezTriple **bezt, BPoint **bp)
static void findselectedNurbvert (ListBase *editnurb, Nurb **nu, BezTriple **bezt, BPoint **bp)
static int convertspline (short type, Nurb *nu)
void ED_nurb_set_spline_type (Nurb *nu, int type)
static int set_spline_type_exec (bContext *C, wmOperator *op)
void CURVE_OT_spline_type_set (wmOperatorType *ot)
static int set_handle_type_exec (bContext *C, wmOperator *op)
void CURVE_OT_handle_type_set (wmOperatorType *ot)
static void switchdirection_knots (float *base, int tot)
static void rotate_direction_nurb (Nurb *nu)
static int is_u_selected (Nurb *nu, int u)
static void make_selection_list_nurb (ListBase *editnurb)
static void merge_2_nurb (wmOperator *op, ListBase *editnurb, Nurb *nu1, Nurb *nu2)
static int merge_nurb (bContext *C, wmOperator *op)
static int make_segment_exec (bContext *C, wmOperator *op)
void CURVE_OT_make_segment (wmOperatorType *ot)
int mouse_nurb (bContext *C, const int mval[2], int extend)
static int spin_nurb (float viewmat[][4], Object *obedit, float *axis, float *cent)
static int spin_exec (bContext *C, wmOperator *op)
static int spin_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void CURVE_OT_spin (wmOperatorType *ot)
static int addvert_Nurb (bContext *C, short mode, float location[3])
static int add_vertex_exec (bContext *C, wmOperator *op)
static int add_vertex_invoke (bContext *C, wmOperator *op, wmEvent *event)
void CURVE_OT_vertex_add (wmOperatorType *ot)
static int extrude_exec (bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_extrude (wmOperatorType *ot)
static int toggle_cyclic_exec (bContext *C, wmOperator *op)
static int toggle_cyclic_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void CURVE_OT_cyclic_toggle (wmOperatorType *ot)
static int select_linked_exec (bContext *C, wmOperator *UNUSED(op))
static int select_linked_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void CURVE_OT_select_linked (wmOperatorType *ot)
static int select_linked_pick_invoke (bContext *C, wmOperator *op, wmEvent *event)
void CURVE_OT_select_linked_pick (wmOperatorType *ot)
static int select_row_exec (bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_select_row (wmOperatorType *ot)
static int select_next_exec (bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_select_next (wmOperatorType *ot)
static int select_previous_exec (bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_select_previous (wmOperatorType *ot)
static int select_more_exec (bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_select_more (wmOperatorType *ot)
static int select_less_exec (bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_select_less (wmOperatorType *ot)
static void selectrandom_curve (ListBase *editnurb, float randfac)
static int select_random_exec (bContext *C, wmOperator *op)
void CURVE_OT_select_random (wmOperatorType *ot)
static int point_on_nurb (Nurb *nu, void *point)
static Nurbget_lastsel_nurb (Curve *cu)
static void select_nth_bezt (Nurb *nu, BezTriple *bezt, int nth)
static void select_nth_bp (Nurb *nu, BPoint *bp, int nth)
int CU_select_nth (Object *obedit, int nth)
static int select_nth_exec (bContext *C, wmOperator *op)
void CURVE_OT_select_nth (wmOperatorType *ot)
static int duplicate_exec (bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_duplicate (wmOperatorType *ot)
static int delete_exec (bContext *C, wmOperator *op)
static int delete_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED(event))
void CURVE_OT_delete (wmOperatorType *ot)
static int shade_smooth_exec (bContext *C, wmOperator *op)
void CURVE_OT_shade_smooth (wmOperatorType *ot)
void CURVE_OT_shade_flat (wmOperatorType *ot)
int join_curve_exec (bContext *C, wmOperator *UNUSED(op))
static const char * get_curve_defname (int type)
static const char * get_surf_defname (int type)
Nurbadd_nurbs_primitive (bContext *C, float mat[4][4], int type, int newob)
static int curvesurf_prim_add (bContext *C, wmOperator *op, int type, int isSurf)
static int curve_prim_add (bContext *C, wmOperator *op, int type)
static int surf_prim_add (bContext *C, wmOperator *op, int type)
static int add_primitive_bezier_exec (bContext *C, wmOperator *op)
void CURVE_OT_primitive_bezier_curve_add (wmOperatorType *ot)
static int add_primitive_bezier_circle_exec (bContext *C, wmOperator *op)
void CURVE_OT_primitive_bezier_circle_add (wmOperatorType *ot)
static int add_primitive_nurbs_curve_exec (bContext *C, wmOperator *op)
void CURVE_OT_primitive_nurbs_curve_add (wmOperatorType *ot)
static int add_primitive_nurbs_circle_exec (bContext *C, wmOperator *op)
void CURVE_OT_primitive_nurbs_circle_add (wmOperatorType *ot)
static int add_primitive_curve_path_exec (bContext *C, wmOperator *op)
void CURVE_OT_primitive_nurbs_path_add (wmOperatorType *ot)
static int add_primitive_nurbs_surface_curve_exec (bContext *C, wmOperator *op)
void SURFACE_OT_primitive_nurbs_surface_curve_add (wmOperatorType *ot)
static int add_primitive_nurbs_surface_circle_exec (bContext *C, wmOperator *op)
void SURFACE_OT_primitive_nurbs_surface_circle_add (wmOperatorType *ot)
static int add_primitive_nurbs_surface_surface_exec (bContext *C, wmOperator *op)
void SURFACE_OT_primitive_nurbs_surface_surface_add (wmOperatorType *ot)
static int add_primitive_nurbs_surface_cylinder_exec (bContext *C, wmOperator *op)
void SURFACE_OT_primitive_nurbs_surface_cylinder_add (wmOperatorType *ot)
static int add_primitive_nurbs_surface_sphere_exec (bContext *C, wmOperator *op)
void SURFACE_OT_primitive_nurbs_surface_sphere_add (wmOperatorType *ot)
static int add_primitive_nurbs_surface_torus_exec (bContext *C, wmOperator *op)
void SURFACE_OT_primitive_nurbs_surface_torus_add (wmOperatorType *ot)
static int clear_tilt_exec (bContext *C, wmOperator *UNUSED(op))
void CURVE_OT_tilt_clear (wmOperatorType *ot)
static void * undo_check_lastsel (void *lastsel, Nurb *nu, Nurb *newnu)
static void undoCurve_to_editCurve (void *ucu, void *obe)
static void * editCurve_to_undoCurve (void *obe)
static void free_undoCurve (void *ucv)
static void * get_data (bContext *C)
void undo_push_curve (bContext *C, const char *name)
void ED_curve_beztcpy (EditNurb *editnurb, BezTriple *dst, BezTriple *src, int count)
void ED_curve_bpcpy (EditNurb *editnurb, BPoint *dst, BPoint *src, int count)
int ED_curve_actSelection (Curve *cu, float center[3])

Variables

static float nurbcircle [8][2]
static ListBase nsortbase = {NULL, NULL}

Detailed Description

Definition in file editcurve.c.


Define Documentation

#define callocstructN (   x,
  y,
  name 
)    (x*)MEM_callocN((y)* sizeof(x),name)

Definition at line 111 of file editcurve.c.

#define FIRST   1

Definition at line 153 of file editcurve.c.

Referenced by CU_deselect_all(), CU_select_all(), and de_select_first_exec().

#define HIDDEN   1
#define LAST   0

Definition at line 154 of file editcurve.c.

Referenced by de_select_last_exec().

#define VISIBLE   0

Typedef Documentation

typedef struct NurbSort NurbSort

Function Documentation

Nurb* add_nurbs_primitive ( bContext C,
float  mat[4][4],
int  type,
int  newob 
) [read]
static int add_primitive_bezier_circle_exec ( bContext C,
wmOperator op 
) [static]

Definition at line 6559 of file editcurve.c.

References CU_BEZIER, CU_PRIM_CIRCLE, and curve_prim_add().

Referenced by CURVE_OT_primitive_bezier_circle_add().

static int add_primitive_bezier_exec ( bContext C,
wmOperator op 
) [static]

Definition at line 6536 of file editcurve.c.

References CU_BEZIER, CU_PRIM_CURVE, and curve_prim_add().

Referenced by CURVE_OT_primitive_bezier_curve_add().

static int add_primitive_curve_path_exec ( bContext C,
wmOperator op 
) [static]

Definition at line 6628 of file editcurve.c.

References CU_NURBS, CU_PRIM_PATH, and curve_prim_add().

Referenced by CURVE_OT_primitive_nurbs_path_add().

static int add_primitive_nurbs_circle_exec ( bContext C,
wmOperator op 
) [static]

Definition at line 6605 of file editcurve.c.

References CU_NURBS, CU_PRIM_CIRCLE, and curve_prim_add().

Referenced by CURVE_OT_primitive_nurbs_circle_add().

static int add_primitive_nurbs_curve_exec ( bContext C,
wmOperator op 
) [static]

Definition at line 6582 of file editcurve.c.

References CU_NURBS, CU_PRIM_CURVE, and curve_prim_add().

Referenced by CURVE_OT_primitive_nurbs_curve_add().

static int add_primitive_nurbs_surface_circle_exec ( bContext C,
wmOperator op 
) [static]

Definition at line 6675 of file editcurve.c.

References CU_NURBS, CU_PRIM_CIRCLE, and surf_prim_add().

Referenced by SURFACE_OT_primitive_nurbs_surface_circle_add().

static int add_primitive_nurbs_surface_curve_exec ( bContext C,
wmOperator op 
) [static]

Definition at line 6652 of file editcurve.c.

References CU_NURBS, CU_PRIM_CURVE, and surf_prim_add().

Referenced by SURFACE_OT_primitive_nurbs_surface_curve_add().

static int add_primitive_nurbs_surface_cylinder_exec ( bContext C,
wmOperator op 
) [static]

Definition at line 6721 of file editcurve.c.

References CU_NURBS, CU_PRIM_TUBE, and surf_prim_add().

Referenced by SURFACE_OT_primitive_nurbs_surface_cylinder_add().

static int add_primitive_nurbs_surface_sphere_exec ( bContext C,
wmOperator op 
) [static]

Definition at line 6744 of file editcurve.c.

References CU_NURBS, CU_PRIM_SPHERE, and surf_prim_add().

Referenced by SURFACE_OT_primitive_nurbs_surface_sphere_add().

static int add_primitive_nurbs_surface_surface_exec ( bContext C,
wmOperator op 
) [static]

Definition at line 6698 of file editcurve.c.

References CU_NURBS, CU_PRIM_PATCH, and surf_prim_add().

Referenced by SURFACE_OT_primitive_nurbs_surface_surface_add().

static int add_primitive_nurbs_surface_torus_exec ( bContext C,
wmOperator op 
) [static]

Definition at line 6767 of file editcurve.c.

References CU_NURBS, CU_PRIM_DONUT, and surf_prim_add().

Referenced by SURFACE_OT_primitive_nurbs_surface_torus_add().

static int add_vertex_exec ( bContext C,
wmOperator op 
) [static]

Definition at line 4567 of file editcurve.c.

References addvert_Nurb(), wmOperator::ptr, and RNA_float_get_array().

Referenced by add_vertex_invoke(), and CURVE_OT_vertex_add().

static int add_vertex_invoke ( bContext C,
wmOperator op,
wmEvent event 
) [static]
static void adduplicateflagNurb ( Object obedit,
short  flag 
) [static]
static int addvert_Nurb ( bContext C,
short  mode,
float  location[3] 
) [static]
static void bezt_to_key ( BezTriple bezt,
float *  key 
) [static]

Definition at line 689 of file editcurve.c.

References BezTriple::alfa, and BezTriple::vec.

Referenced by calc_keyHandles().

static void calc_keyHandles ( ListBase nurb,
float *  key 
) [static]
static void calc_shapeKeys ( Object obedit) [static]
static int clear_tilt_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int convertspline ( short  type,
Nurb nu 
) [static]
void CU_deselect_all ( Object obedit)
void CU_select_all ( Object obedit)

Definition at line 1287 of file editcurve.c.

References FIRST, object_editcurve_get(), SELECT, select_adjacent_cp(), and selectend_nurb().

Referenced by de_select_all_exec().

int CU_select_nth ( Object obedit,
int  nth 
)
void CU_select_swap ( Object obedit)
static int curve_is_animated ( Object ob) [static]

Definition at line 1003 of file editcurve.c.

References BKE_animdata_from_id(), Object::data, and Curve::id.

Referenced by ED_curve_updateAnimPaths().

void CURVE_OT_cyclic_toggle ( wmOperatorType ot)
void CURVE_OT_de_select_first ( wmOperatorType ot)
void CURVE_OT_de_select_last ( wmOperatorType ot)
void CURVE_OT_delete ( wmOperatorType ot)
void CURVE_OT_duplicate ( wmOperatorType ot)
void CURVE_OT_extrude ( wmOperatorType ot)
void CURVE_OT_handle_type_set ( wmOperatorType ot)
void CURVE_OT_hide ( wmOperatorType ot)
void CURVE_OT_make_segment ( wmOperatorType ot)
void CURVE_OT_primitive_bezier_circle_add ( wmOperatorType ot)
void CURVE_OT_primitive_bezier_curve_add ( wmOperatorType ot)
void CURVE_OT_primitive_nurbs_circle_add ( wmOperatorType ot)
void CURVE_OT_primitive_nurbs_curve_add ( wmOperatorType ot)
void CURVE_OT_primitive_nurbs_path_add ( wmOperatorType ot)
void CURVE_OT_radius_set ( wmOperatorType ot)
void CURVE_OT_reveal ( wmOperatorType ot)
void CURVE_OT_select_all ( wmOperatorType ot)
void CURVE_OT_select_less ( wmOperatorType ot)
void CURVE_OT_select_linked ( wmOperatorType ot)
void CURVE_OT_select_linked_pick ( wmOperatorType ot)
void CURVE_OT_select_more ( wmOperatorType ot)
void CURVE_OT_select_next ( wmOperatorType ot)
void CURVE_OT_select_nth ( wmOperatorType ot)
void CURVE_OT_select_previous ( wmOperatorType ot)
void CURVE_OT_select_random ( wmOperatorType ot)
void CURVE_OT_select_row ( wmOperatorType ot)
void CURVE_OT_separate ( wmOperatorType ot)
void CURVE_OT_shade_flat ( wmOperatorType ot)
void CURVE_OT_shade_smooth ( wmOperatorType ot)
void CURVE_OT_smooth ( wmOperatorType ot)
void CURVE_OT_smooth_radius ( wmOperatorType ot)
void CURVE_OT_spin ( wmOperatorType ot)
void CURVE_OT_spline_type_set ( wmOperatorType ot)
void CURVE_OT_spline_weight_set ( wmOperatorType ot)
void CURVE_OT_subdivide ( wmOperatorType ot)
void CURVE_OT_switch_direction ( wmOperatorType ot)
void CURVE_OT_tilt_clear ( wmOperatorType ot)
void CURVE_OT_vertex_add ( wmOperatorType ot)
static int curve_prim_add ( bContext C,
wmOperator op,
int  type 
) [static]
static void curve_rename_fcurves ( Object obedit,
ListBase orig_curves 
) [static]
static int curvesurf_prim_add ( bContext C,
wmOperator op,
int  type,
int  isSurf 
) [static]
static int de_select_all_exec ( bContext C,
wmOperator op 
) [static]
static int de_select_first_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int de_select_last_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int delete_exec ( bContext C,
wmOperator op 
) [static]
static int delete_invoke ( bContext C,
wmOperator op,
wmEvent UNUSEDevent 
) [static]
static int deleteflagNurb ( bContext C,
wmOperator UNUSEDop,
int  flag 
) [static]
static GHash* dupli_keyIndexHash ( GHash keyindex) [static]
static int duplicate_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
int ED_curve_actSelection ( Curve cu,
float  center[3] 
)
void ED_curve_beztcpy ( EditNurb editnurb,
BezTriple dst,
BezTriple src,
int  count 
)

Definition at line 6983 of file editcurve.c.

References keyIndex_updateBezt().

Referenced by addvert_Nurb(), delete_exec(), and make_segment_exec().

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

Definition at line 6989 of file editcurve.c.

References keyIndex_updateBP().

Referenced by addvert_Nurb(), delete_exec(), extrudeflagNurb(), and make_segment_exec().

int ED_curve_updateAnimPaths ( Object obedit)
void ED_nurb_set_spline_type ( Nurb nu,
int  type 
)

Definition at line 3446 of file editcurve.c.

References convertspline().

static void* editCurve_to_undoCurve ( void *  obe) [static]
static int extrude_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static short extrudeflagNurb ( EditNurb editnurb,
int  flag 
) [static]
static void fcurve_path_rename ( AnimData ad,
char *  orig_rna_path,
char *  rna_path,
ListBase orig_curves,
ListBase curves 
) [static]
static void fcurve_remove ( AnimData ad,
ListBase orig_curves,
FCurve fcu 
) [static]
static short findnearestNurbvert ( ViewContext vc,
short  sel,
const int  mval[2],
Nurb **  nurb,
BezTriple **  bezt,
BPoint **  bp 
) [static]
static void findnearestNurbvert__doClosest ( void *  userData,
Nurb nu,
BPoint bp,
BezTriple bezt,
int  beztindex,
int  x,
int  y 
) [static]

Definition at line 3191 of file editcurve.c.

References abs(), data, BezTriple::f1, BPoint::f1, BezTriple::f2, and BezTriple::f3.

Referenced by findnearestNurbvert().

static void findselectedNurbvert ( ListBase editnurb,
Nurb **  nu,
BezTriple **  bezt,
BPoint **  bp 
) [static]
void free_editNurb ( Object obedit)

Definition at line 1270 of file editcurve.c.

References Object::data, and free_curve_editNurb().

Referenced by ED_object_exit_editmode(), and separate_exec().

static void free_undoCurve ( void *  ucv) [static]
static Nurb* get_actNurb ( Object obedit) [static]

Definition at line 140 of file editcurve.c.

References Curve::actnu, BLI_findlink(), curve_editnurbs(), and Object::data.

Referenced by mouse_nurb().

static const char* get_curve_defname ( int  type) [static]

Definition at line 6051 of file editcurve.c.

References CU_BEZIER, CU_PRIM_CIRCLE, CU_PRIM_CURVE, CU_PRIM_PATH, CU_PRIMITIVE, and CU_TYPE.

Referenced by curvesurf_prim_add().

static void* get_data ( bContext C) [static]

Definition at line 6971 of file editcurve.c.

References CTX_data_edit_object().

Referenced by undo_push_curve().

static Nurb* get_lastsel_nurb ( Curve cu) [static]
static const char* get_surf_defname ( int  type) [static]
static CVKeyIndex* getCVKeyIndex ( EditNurb editnurb,
void *  cv 
) [static]
static BezTriple* getKeyIndexOrig_bezt ( EditNurb editnurb,
BezTriple bezt 
) [static]

Definition at line 359 of file editcurve.c.

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

Referenced by calc_shapeKeys(), and switch_keys_direction().

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

Definition at line 370 of file editcurve.c.

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

Referenced by calc_shapeKeys(), and switch_keys_direction().

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

Definition at line 381 of file editcurve.c.

References getCVKeyIndex(), and CVKeyIndex::key_index.

Referenced by calc_shapeKeys().

static int hide_exec ( bContext C,
wmOperator op 
) [static]
static CVKeyIndex* init_cvKeyIndex ( void *  cv,
int  key_index,
int  nu_index,
int  pt_index,
Nurb orig_nu 
) [static]
static void init_editNurb_keyIndex ( EditNurb editnurb,
ListBase origBase 
) [static]
static int is_u_selected ( Nurb nu,
int  u 
) [static]

Definition at line 3626 of file editcurve.c.

References Nurb::bp, Nurb::pntsu, Nurb::pntsv, and SELECT.

Referenced by merge_2_nurb().

int isNurbsel ( Nurb nu)
static int isNurbsel_count ( Curve cu,
Nurb nu 
) [static]
static short isNurbselUV ( Nurb nu,
int *  u,
int *  v,
int  flag 
) [static]

Definition at line 1416 of file editcurve.c.

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

Referenced by extrudeflagNurb().

int join_curve_exec ( bContext C,
wmOperator UNUSEDop 
)
static void key_to_bezt ( float *  key,
BezTriple basebezt,
BezTriple bezt 
) [static]

Definition at line 682 of file editcurve.c.

References BezTriple::alfa, and BezTriple::vec.

Referenced by calc_keyHandles().

static void keyData_switchDirectionNurb ( Curve cu,
Nurb nu 
) [static]
static void keyIndex_delBezt ( EditNurb editnurb,
BezTriple bezt 
) [static]

Definition at line 401 of file editcurve.c.

References keyIndex_delCV().

Referenced by delete_exec().

static void keyIndex_delBP ( EditNurb editnurb,
BPoint bp 
) [static]

Definition at line 406 of file editcurve.c.

References keyIndex_delCV().

Referenced by delete_exec(), and deleteflagNurb().

static void keyIndex_delCV ( EditNurb editnurb,
void *  cv 
) [static]

Definition at line 392 of file editcurve.c.

References BLI_ghash_remove(), EditNurb::keyindex, MEM_freeN(), and NULL.

Referenced by keyIndex_delBezt(), and keyIndex_delBP().

static void keyIndex_delNurb ( EditNurb editnurb,
Nurb nu 
) [static]
static void keyIndex_delNurbList ( EditNurb editnurb,
ListBase nubase 
) [static]

Definition at line 438 of file editcurve.c.

References ListBase::first, keyIndex_delNurb(), and Nurb::next.

Referenced by delete_exec().

static void keyIndex_swap ( EditNurb editnurb,
void *  a,
void *  b 
) [static]
static void keyIndex_switchDirection ( EditNurb editnurb,
Nurb nu 
) [static]
static void keyIndex_updateBezt ( EditNurb editnurb,
BezTriple bezt,
BezTriple newbezt,
int  count 
) [static]

Definition at line 474 of file editcurve.c.

References keyIndex_updateCV().

Referenced by delete_exec(), ED_curve_beztcpy(), keyIndex_updateNurb(), and subdividenurb().

static void keyIndex_updateBP ( EditNurb editnurb,
BPoint bp,
BPoint newbp,
int  count 
) [static]
static void keyIndex_updateCV ( EditNurb editnurb,
char *  cv,
char *  newcv,
int  count,
int  size 
) [static]
static void keyIndex_updateNurb ( EditNurb editnurb,
Nurb nu,
Nurb newnu 
) [static]
void load_editNurb ( Object obedit)
void make_editNurb ( Object obedit)
static int make_segment_exec ( bContext C,
wmOperator op 
) [static]
static void make_selection_list_nurb ( ListBase editnurb) [static]
static void merge_2_nurb ( wmOperator op,
ListBase editnurb,
Nurb nu1,
Nurb nu2 
) [static]
static int merge_nurb ( bContext C,
wmOperator op 
) [static]
int mouse_nurb ( bContext C,
const int  mval[2],
int  extend 
)
static short nurb_has_selected_cps ( ListBase editnurb) [static]
ListBase* object_editcurve_get ( Object ob)
static int point_on_nurb ( Nurb nu,
void *  point 
) [static]

Definition at line 5387 of file editcurve.c.

References Nurb::bezt, Nurb::bp, Nurb::pntsu, and Nurb::pntsv.

Referenced by get_lastsel_nurb().

void printknots ( Object obedit)
static int reveal_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static void rotate_direction_nurb ( Nurb nu) [static]
static void rotateflagNurb ( ListBase editnurb,
short  flag,
float *  cent,
float  rotmat[][3] 
) [static]
static void select_adjacent_cp ( ListBase editnurb,
short  next,
short  cont,
short  selstatus 
) [static]
static short select_beztriple ( BezTriple bezt,
short  selstatus,
short  flag,
short  hidden 
) [static]
static short select_bpoint ( BPoint bp,
short  selstatus,
short  flag,
short  hidden 
) [static]
static int select_less_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int select_linked_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int select_linked_invoke ( bContext C,
wmOperator op,
wmEvent UNUSEDevent 
) [static]

Definition at line 4859 of file editcurve.c.

References select_linked_exec().

Referenced by CURVE_OT_select_linked().

static int select_linked_pick_invoke ( bContext C,
wmOperator op,
wmEvent event 
) [static]
static int select_more_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int select_next_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static void select_nth_bezt ( Nurb nu,
BezTriple bezt,
int  nth 
) [static]

Definition at line 5416 of file editcurve.c.

References abs(), Nurb::bezt, DESELECT, HIDDEN, Nurb::pntsu, and select_beztriple().

Referenced by CU_select_nth().

static void select_nth_bp ( Nurb nu,
BPoint bp,
int  nth 
) [static]

Definition at line 5433 of file editcurve.c.

References abs(), Nurb::bp, DESELECT, HIDDEN, Nurb::pntsu, Nurb::pntsv, and select_bpoint().

Referenced by CU_select_nth().

static int select_nth_exec ( bContext C,
wmOperator op 
) [static]
static int select_previous_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int select_random_exec ( bContext C,
wmOperator op 
) [static]
static int select_row_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
void selectend_nurb ( Object obedit,
short  selfirst,
short  doswap,
short  selstatus 
)
static void selectrandom_curve ( ListBase editnurb,
float  randfac 
) [static]
static int separate_exec ( bContext C,
wmOperator op 
) [static]
static void set_actNurb ( Object obedit,
Nurb nu 
) [static]
static int set_goal_weight_exec ( bContext C,
wmOperator op 
) [static]
static int set_handle_type_exec ( bContext C,
wmOperator op 
) [static]
static int set_radius_exec ( bContext C,
wmOperator op 
) [static]
static int set_spline_type_exec ( bContext C,
wmOperator op 
) [static]
static void setflagsNurb ( ListBase editnurb,
short  flag 
) [static]
static int shade_smooth_exec ( bContext C,
wmOperator op 
) [static]
static int smooth_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int smooth_radius_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static int spin_exec ( bContext C,
wmOperator op 
) [static]
static int spin_invoke ( bContext C,
wmOperator op,
wmEvent UNUSEDevent 
) [static]
static int spin_nurb ( float  viewmat[][4],
Object obedit,
float *  axis,
float *  cent 
) [static]
static int subdivide_exec ( bContext C,
wmOperator op 
) [static]
static void subdividenurb ( Object obedit,
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 opration. Degree is a property shared by all controlpoints 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 controlpoints 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 2758 of file editcurve.c.

References BEZSELECTED_HIDDENHANDLES, Nurb::bezt, Nurb::bp, calchandlesNurb(), copy_v3_v3(), CU_BEZIER, CU_NURB_CYCLIC, CU_NURBS, Object::data, Curve::editnurb, BPoint::f1, ListBase::first, Nurb::flagu, i, interp_v3_v3v3(), interp_v4_v4v4(), keyIndex_updateBezt(), keyIndex_updateBP(), MEM_callocN(), MEM_freeN(), MEM_mallocN(), Nurb::next, EditNurb::nurbs, nurbs_knot_calc_u(), nurbs_knot_calc_v(), Nurb::pntsu, Nurb::pntsv, BezTriple::radius, SELECT, Nurb::type, BezTriple::vec, BPoint::vec, and BezTriple::weight.

Referenced by subdivide_exec().

static int surf_prim_add ( bContext C,
wmOperator op,
int  type 
) [static]
void SURFACE_OT_primitive_nurbs_surface_circle_add ( wmOperatorType ot)
void SURFACE_OT_primitive_nurbs_surface_curve_add ( wmOperatorType ot)
void SURFACE_OT_primitive_nurbs_surface_cylinder_add ( wmOperatorType ot)
void SURFACE_OT_primitive_nurbs_surface_sphere_add ( wmOperatorType ot)
void SURFACE_OT_primitive_nurbs_surface_surface_add ( wmOperatorType ot)
void SURFACE_OT_primitive_nurbs_surface_torus_add ( wmOperatorType ot)
static short swap_selection_beztriple ( BezTriple bezt) [static]

Definition at line 199 of file editcurve.c.

References DESELECT, BezTriple::f2, SELECT, select_beztriple(), and VISIBLE.

Referenced by selectend_nurb().

static short swap_selection_bpoint ( BPoint bp) [static]

Definition at line 207 of file editcurve.c.

References DESELECT, BPoint::f1, SELECT, select_bpoint(), and VISIBLE.

Referenced by CU_select_swap(), and selectend_nurb().

static int switch_direction_exec ( bContext C,
wmOperator UNUSEDop 
) [static]
static void switch_keys_direction ( Curve cu,
Nurb actnu 
) [static]
static void switchdirection_knots ( float *  base,
int  tot 
) [static]

Definition at line 3560 of file editcurve.c.

References fabs(), MEM_freeN(), MEM_mallocN(), NULL, and SWAP.

Referenced by rotate_direction_nurb().

static int toggle_cyclic_exec ( bContext C,
wmOperator op 
) [static]
static int toggle_cyclic_invoke ( bContext C,
wmOperator op,
wmEvent UNUSEDevent 
) [static]
static void translateflagNurb ( ListBase editnurb,
short  flag,
float *  vec 
) [static]
static void* undo_check_lastsel ( void *  lastsel,
Nurb nu,
Nurb newnu 
) [static]

Definition at line 6843 of file editcurve.c.

References Nurb::bezt, Nurb::bp, NULL, Nurb::pntsu, and Nurb::pntsv.

Referenced by editCurve_to_undoCurve(), and undoCurve_to_editCurve().

void undo_push_curve ( bContext C,
const char *  name 
)
static void undoCurve_to_editCurve ( void *  ucu,
void *  obe 
) [static]
static void weightflagNurb ( ListBase editnurb,
short  flag,
float  w 
) [static]

Variable Documentation

ListBase nsortbase = {NULL, NULL} [static]

Definition at line 3646 of file editcurve.c.

float nurbcircle[8][2] [static]
Initial value:
 {
    {0.0, -1.0}, {-1.0, -1.0}, {-1.0, 0.0}, {-1.0,  1.0},
    {0.0,  1.0}, { 1.0,  1.0}, { 1.0, 0.0}, { 1.0, -1.0}
}

Definition at line 113 of file editcurve.c.