Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_convert_nla.c
| Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | typedef struct TransDataNla { | ||||
| /** handle-index: 0 for dummy entry, -1 for start, 1 for end, 2 for both ends. */ | /** handle-index: 0 for dummy entry, -1 for start, 1 for end, 2 for both ends. */ | ||||
| int handle; | int handle; | ||||
| } TransDataNla; | } TransDataNla; | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name NLA Transform Creation | /** \name NLA Transform Creation | ||||
| * \{ */ | * \{ */ | ||||
| void createTransNlaData(bContext *C, TransInfo *t) | static void createTransNlaData(bContext *C, TransInfo *t) | ||||
| { | { | ||||
| Scene *scene = t->scene; | Scene *scene = t->scene; | ||||
| SpaceNla *snla = NULL; | SpaceNla *snla = NULL; | ||||
| TransData *td = NULL; | TransData *td = NULL; | ||||
| TransDataNla *tdn = NULL; | TransDataNla *tdn = NULL; | ||||
| bAnimContext ac; | bAnimContext ac; | ||||
| ListBase anim_data = {NULL, NULL}; | ListBase anim_data = {NULL, NULL}; | ||||
| ▲ Show 20 Lines • Show All 173 Lines • ▼ Show 20 Lines | if (ale->type == ANIMTYPE_NLATRACK) { | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* cleanup temp list */ | /* cleanup temp list */ | ||||
| ANIM_animdata_freelist(&anim_data); | ANIM_animdata_freelist(&anim_data); | ||||
| } | } | ||||
| void recalcData_nla(TransInfo *t) | static void recalcData_nla(TransInfo *t) | ||||
| { | { | ||||
| SpaceNla *snla = (SpaceNla *)t->area->spacedata.first; | SpaceNla *snla = (SpaceNla *)t->area->spacedata.first; | ||||
| TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_SINGLE(t); | TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_SINGLE(t); | ||||
| /* handle auto-snapping | /* handle auto-snapping | ||||
| * NOTE: only do this when transform is still running, or we can't restore | * NOTE: only do this when transform is still running, or we can't restore | ||||
| */ | */ | ||||
| ▲ Show 20 Lines • Show All 198 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Special After Transform NLA | /** \name Special After Transform NLA | ||||
| * \{ */ | * \{ */ | ||||
| void special_aftertrans_update__nla(bContext *C, TransInfo *UNUSED(t)) | static void special_aftertrans_update__nla(bContext *C, TransInfo *UNUSED(t)) | ||||
| { | { | ||||
| bAnimContext ac; | bAnimContext ac; | ||||
| /* initialize relevant anim-context 'context' data */ | /* initialize relevant anim-context 'context' data */ | ||||
| if (ANIM_animdata_get_context(C, &ac) == 0) { | if (ANIM_animdata_get_context(C, &ac) == 0) { | ||||
| return; | return; | ||||
| } | } | ||||
| Show All 25 Lines | if (ac.datatype) { | ||||
| ANIM_animdata_freelist(&anim_data); | ANIM_animdata_freelist(&anim_data); | ||||
| /* Perform after-transform validation. */ | /* Perform after-transform validation. */ | ||||
| ED_nla_postop_refresh(&ac); | ED_nla_postop_refresh(&ac); | ||||
| } | } | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| TransConvertTypeInfo TransConvertType_NLA = { | |||||
| /* flags */ (T_POINTS | T_2D_EDIT), | |||||
| /* createTransData */ createTransNlaData, | |||||
| /* recalcData */ recalcData_nla, | |||||
| /* special_aftertrans_update */ special_aftertrans_update__nla, | |||||
| }; | |||||