Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_convert_nla.c
| Show All 30 Lines | |||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_nla.h" | #include "BKE_nla.h" | ||||
| #include "ED_anim_api.h" | #include "ED_anim_api.h" | ||||
| #include "ED_markers.h" | #include "ED_markers.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | |||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "transform.h" | #include "transform.h" | ||||
| #include "transform_convert.h" | #include "transform_convert.h" | ||||
| /** Used for NLA transform (stored in #TransData.extra pointer). */ | /** Used for NLA transform (stored in #TransData.extra pointer). */ | ||||
| typedef struct TransDataNla { | typedef struct TransDataNla { | ||||
| ▲ Show 20 Lines • Show All 475 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Special After Transform NLA | /** \name Special After Transform NLA | ||||
| * \{ */ | * \{ */ | ||||
| void special_aftertrans_update__nla(bContext *C, TransInfo *UNUSED(t)) | void special_aftertrans_update__nla(bContext *C, TransInfo *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 10 Lines | for (ale = anim_data.first; ale; ale = ale->next) { | ||||
| /* make sure strips are in order again */ | /* make sure strips are in order again */ | ||||
| BKE_nlatrack_sort_strips(nlt); | BKE_nlatrack_sort_strips(nlt); | ||||
| /* remove the temp metas */ | /* remove the temp metas */ | ||||
| BKE_nlastrips_clear_metas(&nlt->strips, 0, 1); | BKE_nlastrips_clear_metas(&nlt->strips, 0, 1); | ||||
| } | } | ||||
| #if 0 | |||||
| /* Refresh outliner in case we moved strips between tracks. */ | |||||
| TransDataContainer *tc = TRANS_DATA_CONTAINER_FIRST_SINGLE(t); | |||||
| TransDataNla *tdn = tc->custom.type.data; | |||||
| for (int i = 0; i < tc->data_len; i++, tdn++) { | |||||
| if (tdn->oldTrack != tdn->nlt) { | |||||
| WM_event_add_notifier(C, NC_SPACE | ND_SPACE_OUTLINER, NULL); | |||||
| } | |||||
| } | |||||
| #endif | |||||
Severin: Wouldn't keep this in. | |||||
| /* General refresh for the outliner because the following might have happened: | |||||
| * - strips moved between tracks | |||||
| * - stripes swapped order | |||||
GuiltyGhostUnsubmitted Not Done Inline Actionsstripe GuiltyGhost: stripe | |||||
| * - duplicate-move moves to different track. */ | |||||
| WM_event_add_notifier(C, NC_SPACE | ND_SPACE_OUTLINER, NULL); | |||||
| /* free temp memory */ | /* free temp memory */ | ||||
| ANIM_animdata_freelist(&anim_data); | ANIM_animdata_freelist(&anim_data); | ||||
| /* perform after-transfrom validation */ | /* perform after-transfrom validation */ | ||||
| ED_nla_postop_refresh(&ac); | ED_nla_postop_refresh(&ac); | ||||
| } | } | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
Wouldn't keep this in.