Correct bezier curve assert
authorCampbell Barton <ideasman42@gmail.com>
Sat, 14 Oct 2017 06:54:43 +0000 (17:54 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 14 Oct 2017 06:54:43 +0000 (17:54 +1100)
Bezier curves should have v-points zero'd.

source/blender/blenkernel/intern/curve.c
source/blender/editors/curve/editcurve_paint.c

index 9c7473f24d138926c8b0a86ba35e885d3a43885c..6c6019748d628902f9f861ad3921b5f2ba20641c 100644 (file)
@@ -741,7 +741,7 @@ BezTriple *BKE_nurb_bezt_get_prev(Nurb *nu, BezTriple *bezt)
        BezTriple *bezt_prev;
 
        BLI_assert(ARRAY_HAS_ITEM(bezt, nu->bezt, nu->pntsu));
-       BLI_assert(nu->pntsv == 1);
+       BLI_assert(nu->pntsv <= 1);
 
        if (bezt == nu->bezt) {
                if (nu->flagu & CU_NURB_CYCLIC) {
@@ -4139,6 +4139,7 @@ bool BKE_nurb_type_convert(Nurb *nu, const short type, const bool use_handles)
                        MEM_freeN(nu->bp);
                        nu->bp = NULL;
                        nu->pntsu = nr;
+                       nu->pntsv = 0;
                        nu->type = CU_BEZIER;
                        BKE_nurb_handles_calc(nu);
                }
index 5c3a694929e0a9d4afb9b921598ea810f1917913..4602945d11ce3ee33fc4e69c8e806a17c1cb9f86 100644 (file)
@@ -780,7 +780,7 @@ static int curve_draw_exec(bContext *C, wmOperator *op)
        const float radius_range = cps->radius_max - cps->radius_min;
 
        Nurb *nu = MEM_callocN(sizeof(Nurb), __func__);
-       nu->pntsv = 1;
+       nu->pntsv = 0;
        nu->resolu = cu->resolu;
        nu->resolv = cu->resolv;
        nu->flag |= CU_SMOOTH;