diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 99aebfffaee..06d88b16fa8 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -3535,6 +3535,11 @@ static int convertspline(short type, Nurb *nu) return 0; } +void ED_nurb_set_spline_type(Nurb *nu, int type) +{ + convertspline(type, nu); +} + static int set_spline_type_exec(bContext *C, wmOperator *op) { Object *obedit= CTX_data_edit_object(C); diff --git a/source/blender/editors/include/ED_curve.h b/source/blender/editors/include/ED_curve.h index 6a92ee2e056..d78d2846572 100644 --- a/source/blender/editors/include/ED_curve.h +++ b/source/blender/editors/include/ED_curve.h @@ -71,6 +71,7 @@ int mouse_nurb (struct bContext *C, const int mval[2], int extend); struct Nurb *add_nurbs_primitive(struct bContext *C, float mat[4][4], int type, int newob); int isNurbsel (struct Nurb *nu); +void ED_nurb_set_spline_type(struct Nurb *nu, int type); int join_curve_exec (struct bContext *C, struct wmOperator *op); diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 594295ba817..f2811e7320b 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -281,8 +281,7 @@ static int rna_Nurb_length(PointerRNA *ptr) static void rna_Nurb_type_set(PointerRNA *ptr, int value) { Nurb *nu= (Nurb*)ptr->data; - nu->type = value; - // XXX - TODO change datatypes + ED_nurb_set_spline_type(nu, value); } static void rna_BPoint_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) @@ -1448,7 +1447,6 @@ static void rna_def_curve_nurb(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Radius Interpolation", "The type of radius interpolation for Bezier curves"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - // XXX - switching type probably needs comprehensive recalc of data like in 2.4x prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, curve_type_items); RNA_def_property_enum_funcs(prop, NULL, "rna_Nurb_type_set", NULL); diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index e496fa0fa8c..7bf5fe9dde3 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -68,6 +68,7 @@ struct Mesh; struct ModifierData; struct MultiresModifierData; struct NodeBlurData; +struct Nurb; struct Object; struct PBVHNode; struct Render; @@ -292,7 +293,8 @@ float ED_rollBoneToVector(struct EditBone *bone, float new_up_axis[3]){return 0. void ED_space_image_size(struct SpaceImage *sima, int *width, int *height){} struct ListBase *ED_curve_editnurbs(struct Curve *cu){return NULL;} -void free_curve_editNurb (struct Curve *cu){}; +void free_curve_editNurb (struct Curve *cu){} +void ED_nurb_set_spline_type(struct Nurb *nu, int type){} void EM_selectmode_set(struct EditMesh *em){} int EM_texFaceCheck(struct EditMesh *em){return 0;}