Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/curve.c
| Context not available. | |||||
| } | } | ||||
| } | } | ||||
| void BKE_nurbList_handles_recalculate(ListBase *editnurb) | |||||
| { | |||||
| Nurb *nu; | |||||
| BezTriple *bezt; | |||||
| short a, h1cache, h2cache; | |||||
| nu = editnurb->first; | |||||
| while (nu) { | |||||
| if (nu->type == CU_BEZIER) { | |||||
| bezt = nu->bezt; | |||||
| a = nu->pntsu; | |||||
| while (a--) { | |||||
| if ((bezt->f1 & SELECT) || (bezt->f3 & SELECT)) { | |||||
| // Remember original handle types | |||||
| h1cache = bezt->h1; | |||||
| h2cache = bezt->h2; | |||||
| // Override handle types to HD_AUTO and recalculate | |||||
| if (bezt->f1 & SELECT) | |||||
| bezt->h1 = HD_AUTO; | |||||
| if (bezt->f3 & SELECT) | |||||
| bezt->h2 = HD_AUTO; | |||||
| if (bezt->h1 != bezt->h2) { | |||||
| if (ELEM(bezt->h1, HD_ALIGN, HD_AUTO)) | |||||
| bezt->h1 = HD_FREE; | |||||
| if (ELEM(bezt->h2, HD_ALIGN, HD_AUTO)) | |||||
| bezt->h2 = HD_FREE; | |||||
| } | |||||
| BKE_nurb_handle_calc_simple(nu, bezt); | |||||
| // Restore original handle types | |||||
| bezt->h1 = h1cache; | |||||
| bezt->h2 = h2cache; | |||||
| } | |||||
| bezt++; | |||||
| } | |||||
| // Recalculate the whole curve | |||||
| BKE_nurb_handles_calc(nu); | |||||
| } | |||||
| nu = nu->next; | |||||
| } | |||||
| } | |||||
| void BKE_nurbList_handles_set(ListBase *editnurb, short code) | void BKE_nurbList_handles_set(ListBase *editnurb, short code) | ||||
| { | { | ||||
| /* code==1: set autohandle */ | /* code==1: set autohandle */ | ||||
| Context not available. | |||||