diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-04-04 11:34:04 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-04-05 11:36:14 +0300 |
commit | f615b5737935d8b1f504dd9989047ecc1a715e32 (patch) | |
tree | 331029a14d58e4f56bd7f227c58a3f56e61a5244 /source/blender | |
parent | a5cfe0f9dcb213d2f81eaebaff37aec6b8fb0c42 (diff) |
Fix curve editmode adding 3D primitives w/ 2D curves
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/curve/editcurve_add.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/curve/editcurve_add.c b/source/blender/editors/curve/editcurve_add.c index 246f089d77e..cc8e272d4f7 100644 --- a/source/blender/editors/curve/editcurve_add.c +++ b/source/blender/editors/curve/editcurve_add.c @@ -121,7 +121,6 @@ Nurb *ED_curve_add_nurbs_primitive(bContext *C, Object *obedit, float mat[4][4], const float grid = 1.0f; const int cutype = (type & CU_TYPE); // poly, bezier, nurbs, etc const int stype = (type & CU_PRIMITIVE); - const bool force_3d = (((Curve *)obedit->data)->flag & CU_3D) != 0; /* could be adding to an existing 3D curve */ unit_m4(umat); unit_m4(viewmat); @@ -145,7 +144,6 @@ Nurb *ED_curve_add_nurbs_primitive(bContext *C, Object *obedit, float mat[4][4], case CU_PRIM_CURVE: /* curve */ nu->resolu = cu->resolu; if (cutype == CU_BEZIER) { - if (!force_3d) nu->flag |= CU_2D; nu->pntsu = 2; nu->bezt = (BezTriple *)MEM_callocN(2 * sizeof(BezTriple), "addNurbprim1"); bezt = nu->bezt; @@ -247,7 +245,6 @@ Nurb *ED_curve_add_nurbs_primitive(bContext *C, Object *obedit, float mat[4][4], nu->resolu = cu->resolu; if (cutype == CU_BEZIER) { - if (!force_3d) nu->flag |= CU_2D; nu->pntsu = 4; nu->bezt = (BezTriple *)MEM_callocN(sizeof(BezTriple) * 4, "addNurbprim1"); nu->flagu = CU_NURB_CYCLIC; @@ -459,6 +456,10 @@ Nurb *ED_curve_add_nurbs_primitive(bContext *C, Object *obedit, float mat[4][4], BLI_assert(nu != NULL); if (nu) { /* should always be set */ + if ((obedit->type != OB_SURF) && ((cu->flag & CU_3D) == 0)) { + nu->flag |= CU_2D; + } + nu->flag |= CU_SMOOTH; cu->actnu = BLI_listbase_count(editnurb); cu->actvert = CU_ACT_NONE; |