Fix #111545: Regression: Crash when drawing all view layers in outliner

Caused by d5c7608b39

view_layer is passed in outliner_add_element to fix the view layer
expansion (c2fdbcca3c). This result in crash after the recent refactor.
Use new struct to fix the crash and to maintain the fix of view
layer expansion.

Pull Request: https://projects.blender.org/blender/blender/pulls/111646
This commit is contained in:
Pratik Borhade
2023-08-29 14:11:23 +02:00
committed by Pratik Borhade
parent 7fb58a33f0
commit 1eea5ac82a

View File

@@ -80,8 +80,9 @@ ListBase TreeDisplayViewLayer::buildTree(const TreeSourceData &source_data)
add_view_layer(*scene, tree, (TreeElement *)nullptr);
}
else {
ViewLayerElementCreateData view_layer_data = {scene, view_layer};
TreeElement &te_view_layer = *outliner_add_element(
&space_outliner_, &tree, view_layer, nullptr, TSE_R_LAYER, 0);
&space_outliner_, &tree, &view_layer_data, nullptr, TSE_R_LAYER, 0);
TreeStoreElem *tselem = TREESTORE(&te_view_layer);