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/space_nla | |
parent | 1c24d954f4ac63f22b703756b6664a4ad1b363d4 (diff) |
ListBase API: add utility api funcs for clearing and checking empty
Diffstat (limited to 'source/blender/editors/space_nla')
-rw-r--r-- | source/blender/editors/space_nla/nla_channels.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_nla/nla_edit.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index c0e559a34cf..1f2fe6b1ecf 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -464,7 +464,7 @@ bool nlaedit_add_tracks_empty(bAnimContext *ac) BLI_assert(adt->flag & ADT_UI_SELECTED); /* ensure it is empty */ - if (adt->nla_tracks.first == NULL) { + if (BLI_listbase_is_empty(&adt->nla_tracks)) { /* add new track to this AnimData block then */ add_nlatrack(adt, NULL); added = true; diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 37efd52f246..f54ceeeb702 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -121,7 +121,7 @@ static int nlaedit_enable_tweakmode_exec(bContext *C, wmOperator *op) ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); /* if no blocks, popup error? */ - if (anim_data.first == NULL) { + if (BLI_listbase_is_empty(&anim_data)) { BKE_report(op->reports, RPT_ERROR, "No AnimData blocks to enter tweak mode for"); return OPERATOR_CANCELLED; } @@ -185,7 +185,7 @@ bool nlaedit_disable_tweakmode(bAnimContext *ac) ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* if no blocks, popup error? */ - if (anim_data.first == NULL) { + if (BLI_listbase_is_empty(&anim_data)) { BKE_report(ac->reports, RPT_ERROR, "No AnimData blocks in tweak mode to exit from"); return false; } @@ -1304,7 +1304,7 @@ static int nlaedit_swap_exec(bContext *C, wmOperator *op) /* special case: if there is only 1 island (i.e. temp meta BUT NOT unselected/normal/normal-meta strips) left after this, * and this island has two strips inside it, then we should be able to just swap these still... */ - if ((nlt->strips.first == nlt->strips.last) && (nlt->strips.first != NULL)) { + if (BLI_listbase_is_empty(&nlt->strips) == false) { NlaStrip *mstrip = (NlaStrip *)nlt->strips.first; if ((mstrip->flag & NLASTRIP_FLAG_TEMP_META) && (BLI_countlist(&mstrip->strips) == 2)) { |