diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-07-05 12:57:11 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-07-05 12:57:11 +0400 |
commit | 3d5ae95986268f693a0d3c98f875eb0c12b96be8 (patch) | |
tree | 785b025e996395143e06e98f23604db9701f5303 /source/blender | |
parent | 1ff54f91ff52c53d98cbecf9988ad051da10018d (diff) |
Fix #27863: converting curve spline type from python crashes.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 5 | ||||
-rw-r--r-- | source/blender/editors/include/ED_curve.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_curve.c | 4 |
3 files changed, 7 insertions, 3 deletions
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); |