Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2019-06-05 00:28:47 +0300
committerDalai Felinto <dfelinto@gmail.com>2019-06-05 01:21:23 +0300
commitfa24ec41aafb89c3d8c29034f2da97fde7507e78 (patch)
treede74b78a95059a5f60a5ed0b4026cc474f66ef0e /source/blender/editors/space_outliner/outliner_tree.c
parent1324659dee4981bce37557febb446710547fb646 (diff)
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.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_tree.c')
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index ee00c267352..4e07be7d915 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -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(