Page MenuHome

Fix T89559: Outliner shows extra view layer column when it shouldn't
ClosedPublic

Authored by Dalai Felinto (dfelinto) on Jul 6 2021, 6:35 PM.

Diff Detail

Repository
rB Blender

Event Timeline

Dalai Felinto (dfelinto) requested review of this revision.Jul 6 2021, 6:35 PM
Dalai Felinto (dfelinto) created this revision.

Looks good with the suggested change made.

Personally I think combining add_view_layer_content into add_view_layer would be nice as well, since that's the only place it's called and the distinction is a bit odd. But I don't feel strongly about that.

source/blender/editors/space_outliner/tree/tree_display_view_layer.cc
76–95

This is much simpler I think:

if (space_outliner_.filter & SO_FILTER_NO_VIEW_LAYERS) {
  view_layer_ = source_data.view_layer;
  add_view_layer(scene, &tree, nullptr);
}
else {
  for (auto *view_layer : ListBaseWrapper<ViewLayer>(scene->view_layers)) {
    view_layer_ = view_layer;
    TreeElement &te_view_layer = *outliner_add_element(
        &space_outliner_, &tree, scene, nullptr, TSE_R_LAYER, 0);
    TREESTORE(&te_view_layer)->flag &= ~TSE_CLOSED;
    te_view_layer.name = view_layer->name;
    te_view_layer.directdata = view_layer;

    add_view_layer(scene, &te_view_layer.subtree, &te_view_layer);
  }
}
100

In other functions in this file, the parameters that aren't expected to be null are passed as references, we should do that here too.

This revision is now accepted and ready to land.Jul 6 2021, 6:48 PM