diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-05-18 18:24:45 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-05-18 18:24:45 +0400 |
commit | 193e77cc673e6836525ab1a0bad0ff5491e04d23 (patch) | |
tree | ef97381949b0b9bfd5156158d001d0e0a6c51248 /source/blender/editors/animation/anim_deps.c | |
parent | e8630bdccf545f6945b0f64db588168e69cc91a7 (diff) |
Fix T40201: Keyframe edits fail to update the viewport
Diffstat (limited to 'source/blender/editors/animation/anim_deps.c')
-rw-r--r-- | source/blender/editors/animation/anim_deps.c | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c index c0543862265..5bffdfbcc4b 100644 --- a/source/blender/editors/animation/anim_deps.c +++ b/source/blender/editors/animation/anim_deps.c @@ -45,6 +45,7 @@ #include "BKE_animsys.h" #include "BKE_action.h" +#include "BKE_fcurve.h" #include "BKE_context.h" #include "BKE_depsgraph.h" #include "BKE_global.h" @@ -341,5 +342,49 @@ void ANIM_sync_animchannels_to_data(const bContext *C) } } - BLI_freelistN(&anim_data); + ANIM_animdata_freelist(&anim_data); +} + +void ANIM_animdata_update(bAnimContext *ac, ListBase *anim_data) +{ + bAnimListElem *ale; + + if (ELEM(ac->datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK)) + return; + + for (ale = anim_data->first; ale; ale = ale->next) { + FCurve *fcu = ale->key_data; + + if (ale->update & ANIM_UPDATE_ORDER) { + ale->update &= ~ANIM_UPDATE_ORDER; + sort_time_fcurve(fcu); + } + + if (ale->update & ANIM_UPDATE_HANDLES) { + ale->update &= ~ANIM_UPDATE_HANDLES; + calchandles_fcurve(fcu); + } + + if (ale->update & ANIM_UPDATE_DEPS) { + ale->update &= ~ANIM_UPDATE_DEPS; + ANIM_list_elem_update(ac->scene, ale); + } + + BLI_assert(ale->update == 0); + } +} + +void ANIM_animdata_freelist(ListBase *anim_data) +{ +#ifndef NDEBUG + bAnimListElem *ale, *ale_next; + for (ale = anim_data->first; ale; ale = ale_next) { + ale_next = ale->next; + BLI_assert(ale->update == 0); + MEM_freeN(ale); + } + BLI_listbase_clear(anim_data); +#else + BLI_freelistN(anim_data); +#endif } |