forked from bartvdbraak/blender
Fix #27863: converting curve spline type from python crashes.
This commit is contained in:
parent
1ff54f91ff
commit
3d5ae95986
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;}
|
||||
|
Loading…
Reference in New Issue
Block a user