Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_convert_paintcurve.c
| Show First 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | else { | ||||
| } | } | ||||
| if (bezt->f1 & SELECT) { | if (bezt->f1 & SELECT) { | ||||
| PaintCurveConvertHandle(pcp, 0, td2d, tdpc, td); | PaintCurveConvertHandle(pcp, 0, td2d, tdpc, td); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void createTransPaintCurveVerts(bContext *C, TransInfo *t) | static void createTransPaintCurveVerts(bContext *C, TransInfo *t) | ||||
| { | { | ||||
| Paint *paint = BKE_paint_get_active_from_context(C); | Paint *paint = BKE_paint_get_active_from_context(C); | ||||
| PaintCurve *pc; | PaintCurve *pc; | ||||
| PaintCurvePoint *pcp; | PaintCurvePoint *pcp; | ||||
| Brush *br; | Brush *br; | ||||
| TransData *td = NULL; | TransData *td = NULL; | ||||
| TransData2D *td2d = NULL; | TransData2D *td2d = NULL; | ||||
| TransDataPaintCurve *tdpc = NULL; | TransDataPaintCurve *tdpc = NULL; | ||||
| ▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Paint Curve Transform Flush | /** \name Paint Curve Transform Flush | ||||
| * \{ */ | * \{ */ | ||||
| void flushTransPaintCurve(TransInfo *t) | static void flushTransPaintCurve(TransInfo *t) | ||||
| { | { | ||||
| int i; | int i; | ||||
| TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_SINGLE(t); | TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_SINGLE(t); | ||||
| TransData2D *td2d = tc->data_2d; | TransData2D *td2d = tc->data_2d; | ||||
| TransDataPaintCurve *tdpc = tc->custom.type.data; | TransDataPaintCurve *tdpc = tc->custom.type.data; | ||||
| for (i = 0; i < tc->data_len; i++, tdpc++, td2d++) { | for (i = 0; i < tc->data_len; i++, tdpc++, td2d++) { | ||||
| PaintCurvePoint *pcp = tdpc->pcp; | PaintCurvePoint *pcp = tdpc->pcp; | ||||
| copy_v2_v2(pcp->bez.vec[tdpc->id], td2d->loc); | copy_v2_v2(pcp->bez.vec[tdpc->id], td2d->loc); | ||||
| } | } | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| TransConvertTypeInfo TransConvertType_PaintCurve = { | |||||
| /* flags */ (T_POINTS | T_2D_EDIT), | |||||
| /* createTransData */ createTransPaintCurveVerts, | |||||
| /* recalcData */ flushTransPaintCurve, | |||||
| /* special_aftertrans_update */ NULL, | |||||
| }; | |||||