[Bf-blender-cvs] [fa24ec41aaf] master: Outliner: Fix drawing of collection with disabled parent
Dalai Felinto
noreply at git.blender.org
Wed Jun 5 00:21:36 CEST 2019
Commit: fa24ec41aafb89c3d8c29034f2da97fde7507e78
Author: Dalai Felinto
Date: Tue Jun 4 18:28:47 2019 -0300
Branches: master
https://developer.blender.org/rBfa24ec41aafb89c3d8c29034f2da97fde7507e78
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.
===================================================================
M source/blender/editors/space_outliner/outliner_tree.c
===================================================================
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(
More information about the Bf-blender-cvs
mailing list