diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-09-23 11:18:50 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-09-23 11:18:50 +0400 |
commit | c574419049f2ff7dfc558304ea9097dcf2a282c3 (patch) | |
tree | 94b11e5d742535d58f010a46fc75f2c1d512974f /source/blender/editors/curve | |
parent | 7d1a36f8f4e928d8e2a3828d4def38251cdf9914 (diff) |
fix for crashes caused by mixups when adding objects when incompatible object types were already in editmode.
Diffstat (limited to 'source/blender/editors/curve')
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 39cb2d98783..9c13f4be6a9 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -6191,10 +6191,9 @@ static const char *get_surf_defname(int type) } -Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob) +Nurb *add_nurbs_primitive(bContext *C, Object *obedit, float mat[4][4], int type, int newob) { static int xzproj = 0; /* this function calls itself... */ - Object *obedit = CTX_data_edit_object(C); ListBase *editnurb = object_editcurve_get(obedit); View3D *v3d = CTX_wm_view3d(C); RegionView3D *rv3d = ED_view3d_context_rv3d(C); @@ -6431,7 +6430,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob) break; case CU_PRIM_TUBE: /* Cylinder */ if (cutype == CU_NURBS) { - nu = add_nurbs_primitive(C, mat, CU_NURBS | CU_PRIM_CIRCLE, 0); /* circle */ + nu = add_nurbs_primitive(C, obedit, mat, CU_NURBS | CU_PRIM_CIRCLE, 0); /* circle */ nu->resolu = cu->resolu; nu->flag = CU_SMOOTH; BLI_addtail(editnurb, nu); /* temporal for extrude and translate */ @@ -6510,7 +6509,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob) float tmp_vec[3] = {0.f, 0.f, 1.f}; xzproj = 1; - nu = add_nurbs_primitive(C, mat, CU_NURBS | CU_PRIM_CIRCLE, 0); /* circle */ + nu = add_nurbs_primitive(C, obedit, mat, CU_NURBS | CU_PRIM_CIRCLE, 0); /* circle */ xzproj = 0; nu->resolu = cu->resolu; nu->resolv = cu->resolv; @@ -6607,7 +6606,7 @@ static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf) ED_object_new_primitive_matrix(C, obedit, loc, rot, mat); - nu = add_nurbs_primitive(C, mat, type, newob); + nu = add_nurbs_primitive(C, obedit, mat, type, newob); editnurb = object_editcurve_get(obedit); BLI_addtail(editnurb, nu); |