diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-02-07 23:07:10 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-02-07 23:24:05 +0400 |
commit | b3afbcab8ff2330c1473647be330a3ffe9b11885 (patch) | |
tree | e86b9c7d9676e63b8da92da79889dee13b8be186 /source/blender/editors/animation/keyframes_general.c | |
parent | 1c24d954f4ac63f22b703756b6664a4ad1b363d4 (diff) |
ListBase API: add utility api funcs for clearing and checking empty
Diffstat (limited to 'source/blender/editors/animation/keyframes_general.c')
-rw-r--r-- | source/blender/editors/animation/keyframes_general.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index 0ead68c4d4a..6a359b0e6d0 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -505,7 +505,7 @@ void free_anim_copybuf(void) } /* restore initial state */ - animcopybuf.first = animcopybuf.last = NULL; + BLI_listbase_clear(&animcopybuf); animcopy_firstframe = 999999999.0f; animcopy_lastframe = -999999999.0f; } @@ -774,19 +774,19 @@ short paste_animedit_keys(bAnimContext *ac, ListBase *anim_data, const Scene *scene = (ac->scene); - const short from_single = (animcopybuf.first == animcopybuf.last); - const short to_simple = (anim_data->first == anim_data->last); + const bool from_single = BLI_listbase_is_single(&animcopybuf); + const bool to_simple = BLI_listbase_is_single(anim_data); float offset = 0.0f; int pass; /* check if buffer is empty */ - if (animcopybuf.first == NULL) { + if (BLI_listbase_is_empty(&animcopybuf)) { BKE_report(ac->reports, RPT_ERROR, "No animation data in buffer to paste"); return -1; } - if (anim_data->first == NULL) { + if (BLI_listbase_is_empty(anim_data)) { BKE_report(ac->reports, RPT_ERROR, "No selected F-Curves to paste into"); return -1; } |