From ac30fd8b3e4aafe2cd2e009ad9735153b2f7e469 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Sat, 11 Jun 2005 02:01:26 +0000 Subject: Fixed crash on transform_conversion with PET and hidden CV in a curve. It now deals correctly with hidden CVs in Connected mode (creates a "segment" on each side of the hidden CV). --- source/blender/src/transform_conversions.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'source') diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c index b595bfc8667..4848fc0d5fd 100755 --- a/source/blender/src/transform_conversions.c +++ b/source/blender/src/transform_conversions.c @@ -733,6 +733,8 @@ static void createTransCurveVerts(TransInfo *t) td = t->data; for(nu= editNurb.first; nu; nu= nu->next) { if((nu->type & 7)==CU_BEZIER) { + TransData *head, *tail; + head = tail = td; for(a=0, bezt= nu->bezt; apntsu; a++, bezt++) { if(bezt->hide==0) { if(propmode || (bezt->f1 & 1)) { @@ -750,6 +752,7 @@ static void createTransCurveVerts(TransInfo *t) td++; count++; + tail++; } /* THIS IS THE CV, the other two are handles */ if(propmode || (bezt->f2 & 1)) { @@ -768,6 +771,7 @@ static void createTransCurveVerts(TransInfo *t) td++; count++; + tail++; } if(propmode || (bezt->f3 & 1)) { VECCOPY(td->iloc, bezt->vec[2]); @@ -784,13 +788,20 @@ static void createTransCurveVerts(TransInfo *t) td++; count++; + tail++; } } + else if (propmode && head != tail) { + calc_distanceCurveVerts(head, tail-1); + head = tail; + } } - if (propmode) - calc_distanceCurveVerts(td-(nu->pntsu*3), td-1); + if (propmode && head != tail) + calc_distanceCurveVerts(head, tail); } else { + TransData *head, *tail; + head = tail = td; for(a= nu->pntsu*nu->pntsv, bp= nu->bp; a>0; a--, bp++) { if(bp->hide==0) { if(propmode || (bp->f1 & 1)) { @@ -809,11 +820,16 @@ static void createTransCurveVerts(TransInfo *t) td++; count++; + tail++; } } + else if (propmode && head != tail) { + calc_distanceCurveVerts(head, tail-1); + head = tail; + } } - if (propmode) - calc_distanceCurveVerts(td-(nu->pntsu*nu->pntsv), td-1); + if (propmode && head != tail) + calc_distanceCurveVerts(head, tail-1); } } } -- cgit v1.2.3