Fix #36384: Inconsistent curve fill behaviour
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 15 Aug 2013 07:59:32 +0000 (07:59 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 15 Aug 2013 07:59:32 +0000 (07:59 +0000)
Creating new splines via Python API didn't take
curve dimension into account.

Now adding new splines will set 2D/3D flag for
spline according to curve's dimension.

source/blender/makesrna/intern/rna_curve.c

index 21bf2ec6719a09e3cab3f1a696f446fff37e1234..9773e7a340b6b4f3e6b212e4bac771bc04b4c938 100644 (file)
@@ -568,6 +568,10 @@ static Nurb *rna_Curve_spline_new(Curve *cu, int type)
        nu->resolu = nu->resolv = 12;
        nu->flag = CU_SMOOTH;
 
+       if ((cu->flag & CU_3D) == 0) {
+               nu->flag |= CU_2D;
+       }
+
        BLI_addtail(BKE_curve_nurbs_get(cu), nu);
 
        return nu;