Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_convert_curve.c
| Show All 19 Lines | |||||
| /** \file | /** \file | ||||
| * \ingroup edtransform | * \ingroup edtransform | ||||
| */ | */ | ||||
| #include "DNA_curve_types.h" | #include "DNA_curve_types.h" | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "BLI_listbase.h" | |||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_curve.h" | #include "BKE_curve.h" | ||||
| #include "transform.h" | #include "transform.h" | ||||
| #include "transform_convert.h" | #include "transform_convert.h" | ||||
| ▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | FOREACH_TRANS_DATA_CONTAINER (t, tc) { | ||||
| const bool is_prop_edit = (t->flag & T_PROP_EDIT) != 0; | const bool is_prop_edit = (t->flag & T_PROP_EDIT) != 0; | ||||
| View3D *v3d = t->view; | View3D *v3d = t->view; | ||||
| short hide_handles = (v3d != NULL) ? | short hide_handles = (v3d != NULL) ? | ||||
| ((v3d->overlay.edit_flag & V3D_OVERLAY_EDIT_CU_HANDLES) == 0) : | ((v3d->overlay.edit_flag & V3D_OVERLAY_EDIT_CU_HANDLES) == 0) : | ||||
| false; | false; | ||||
| /* count total of vertices, check identical as in 2nd loop for making transdata! */ | /* count total of vertices, check identical as in 2nd loop for making transdata! */ | ||||
| ListBase *nurbs = BKE_curve_editNurbs_get(cu); | ListBase *nurbs = BKE_curve_editNurbs_get(cu); | ||||
| for (Nurb *nu = nurbs->first; nu; nu = nu->next) { | LISTBASE_FOREACH (Nurb *, nu, nurbs) { | ||||
| if (nu->type == CU_BEZIER) { | if (nu->type == CU_BEZIER) { | ||||
| for (a = 0, bezt = nu->bezt; a < nu->pntsu; a++, bezt++) { | for (a = 0, bezt = nu->bezt; a < nu->pntsu; a++, bezt++) { | ||||
| if (bezt->hide == 0) { | if (bezt->hide == 0) { | ||||
| const int bezt_tx = bezt_select_to_transform_triple_flag(bezt, hide_handles); | const int bezt_tx = bezt_select_to_transform_triple_flag(bezt, hide_handles); | ||||
| if (bezt_tx & SEL_F1) { | if (bezt_tx & SEL_F1) { | ||||
| countsel++; | countsel++; | ||||
| } | } | ||||
| if (bezt_tx & SEL_F2) { | if (bezt_tx & SEL_F2) { | ||||
| ▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | FOREACH_TRANS_DATA_CONTAINER (t, tc) { | ||||
| float mtx[3][3], smtx[3][3]; | float mtx[3][3], smtx[3][3]; | ||||
| copy_m3_m4(mtx, tc->obedit->obmat); | copy_m3_m4(mtx, tc->obedit->obmat); | ||||
| pseudoinverse_m3_m3(smtx, mtx, PSEUDOINVERSE_EPSILON); | pseudoinverse_m3_m3(smtx, mtx, PSEUDOINVERSE_EPSILON); | ||||
| TransData *td = tc->data; | TransData *td = tc->data; | ||||
| ListBase *nurbs = BKE_curve_editNurbs_get(cu); | ListBase *nurbs = BKE_curve_editNurbs_get(cu); | ||||
| for (Nurb *nu = nurbs->first; nu; nu = nu->next) { | LISTBASE_FOREACH (Nurb *, nu, nurbs) { | ||||
| if (nu->type == CU_BEZIER) { | if (nu->type == CU_BEZIER) { | ||||
| TransData *head, *tail; | TransData *head, *tail; | ||||
| head = tail = td; | head = tail = td; | ||||
| for (a = 0, bezt = nu->bezt; a < nu->pntsu; a++, bezt++) { | for (a = 0, bezt = nu->bezt; a < nu->pntsu; a++, bezt++) { | ||||
| if (bezt->hide == 0) { | if (bezt->hide == 0) { | ||||
| TransDataCurveHandleFlags *hdata = NULL; | TransDataCurveHandleFlags *hdata = NULL; | ||||
| float axismtx[3][3]; | float axismtx[3][3]; | ||||
| ▲ Show 20 Lines • Show All 237 Lines • Show Last 20 Lines | |||||