diff options
author | Julian Eisel <julian@blender.org> | 2020-03-16 20:14:24 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-03-16 20:14:24 +0300 |
commit | ddbbd9928ec443f813ee4d46011288e360278e9f (patch) | |
tree | 91f50fc6e8e8b68be5686903aca191d43cdafae5 /source/blender/editors/animation/anim_filter.c | |
parent | b86be9b2145458037fd0b17433b7af0efa7b6472 (diff) | |
parent | d2ef342b2a50a7eac725889708fd689ffa126e25 (diff) |
Merge branch 'temp-openxr-ghostxr' into temp-openxr-blenderside
Diffstat (limited to 'source/blender/editors/animation/anim_filter.c')
-rw-r--r-- | source/blender/editors/animation/anim_filter.c | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 4b0a4bcf46b..8dfc9cd8d1a 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -1715,22 +1715,33 @@ static size_t animdata_filter_gpencil_layers_data(ListBase *anim_data, /* loop over layers as the conditions are acceptable (top-Down order) */ for (gpl = gpd->layers.last; gpl; gpl = gpl->prev) { /* only if selected */ - if (ANIMCHANNEL_SELOK(SEL_GPL(gpl))) { - /* only if editable */ - if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_GPL(gpl)) { - /* active... */ - if (!(filter_mode & ANIMFILTER_ACTIVE) || (gpl->flag & GP_LAYER_ACTIVE)) { - /* skip layer if the name doesn't match the filter string */ - if ((ads) && (ads->searchstr[0] != '\0')) { - if (name_matches_dopesheet_filter(ads, gpl->info) == false) { - continue; - } - } - /* add to list */ - ANIMCHANNEL_NEW_CHANNEL(gpl, ANIMTYPE_GPLAYER, gpd, NULL); - } - } + if (!ANIMCHANNEL_SELOK(SEL_GPL(gpl))) { + continue; + } + + /* only if editable */ + if ((filter_mode & ANIMFILTER_FOREDIT) && !EDITABLE_GPL(gpl)) { + continue; + } + + /* active... */ + if ((filter_mode & ANIMFILTER_ACTIVE) && (gpl->flag & GP_LAYER_ACTIVE) == 0) { + continue; } + + /* skip layer if the name doesn't match the filter string */ + if (ads != NULL && ads->searchstr[0] != '\0' && + name_matches_dopesheet_filter(ads, gpl->info) == false) { + continue; + } + + /* Skip empty layers. */ + if (BLI_listbase_is_empty(&gpl->frames)) { + continue; + } + + /* add to list */ + ANIMCHANNEL_NEW_CHANNEL(gpl, ANIMTYPE_GPLAYER, gpd, NULL); } return items; |