Outliner: Fix drawing of collection with disabled parent

If the layer collection had a parent that was disabled we wouldn't draw
it altogether.

Note: In this case I'm moving any enabled collection with a disabled
parent up in the hierarchy.

All in all I'm happy with this but I would like us to tackle the 1-20
shortcut, Ctrl+H menu and Collections viewport panel to do something
similar.
This commit is contained in:
Dalai Felinto 2019-06-04 18:28:47 -03:00
parent 1324659dee
commit fa24ec41aa

@ -1380,25 +1380,27 @@ static void outliner_add_layer_collections_recursive(SpaceOutliner *soops,
{
for (LayerCollection *lc = layer_collections->first; lc; lc = lc->next) {
const bool exclude = (lc->flag & LAYER_COLLECTION_EXCLUDE) != 0;
TreeElement *ten;
if (exclude && ((soops->show_restrict_flags & SO_RESTRICT_ENABLE) == 0)) {
continue;
ten = parent_ten;
}
else {
ID *id = &lc->collection->id;
ten = outliner_add_element(soops, tree, id, parent_ten, TSE_LAYER_COLLECTION, 0);
ID *id = &lc->collection->id;
TreeElement *ten = outliner_add_element(soops, tree, id, parent_ten, TSE_LAYER_COLLECTION, 0);
ten->name = id->name + 2;
ten->directdata = lc;
ten->name = id->name + 2;
ten->directdata = lc;
/* Open by default. */
TreeStoreElem *tselem = TREESTORE(ten);
if (!tselem->used) {
tselem->flag &= ~TSE_CLOSED;
}
/* Open by default. */
TreeStoreElem *tselem = TREESTORE(ten);
if (!tselem->used) {
tselem->flag &= ~TSE_CLOSED;
}
if (exclude || (lc->runtime_flag & LAYER_COLLECTION_VISIBLE) == 0) {
ten->flag |= TE_DISABLED;
if (exclude || (lc->runtime_flag & LAYER_COLLECTION_VISIBLE) == 0) {
ten->flag |= TE_DISABLED;
}
}
outliner_add_layer_collections_recursive(