Fix T38562: Wrong curve tilt after Switch Direction

This commit is contained in:
2014-02-14 14:58:52 +06:00
parent 7fb7ce789f
commit 54dd355cc8

View File

@@ -3519,6 +3519,9 @@ void BKE_nurb_direction_switch(Nurb *nu)
bezt1->alfa = -bezt1->alfa;
bezt2->alfa = -bezt2->alfa;
}
else {
bezt1->alfa = -bezt1->alfa;
}
a--;
bezt1++;
bezt2--;
@@ -3537,6 +3540,12 @@ void BKE_nurb_direction_switch(Nurb *nu)
bp1++;
bp2--;
}
/* If there're odd number of points no need to touch coord of middle one,
* but still need to change it's tilt.
*/
if (nu->pntsu & 1) {
bp1->alfa = -bp1->alfa;
}
if (nu->type == CU_NURBS) {
/* no knots for too short paths */
if (nu->knotsu) {