Blender V4.3
tree_display_scenes.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include "DNA_space_types.h"
10
12#include "BLI_mempool.h"
13
14#include "BKE_main.hh"
15
16#include "../outliner_intern.hh"
17#include "common.hh"
18#include "tree_display.hh"
19
20namespace blender::ed::outliner {
21
22template<typename T> using List = ListBaseWrapper<T>;
23
25 : AbstractTreeDisplay(space_outliner)
26{
27}
28
30{
31 return true;
32}
33
35{
36 /* On first view we open scenes. */
37 const int show_opened = !space_outliner_.treestore ||
39 ListBase tree = {nullptr};
40
41 for (ID *id : List<ID>(source_data.bmain->scenes)) {
42 Scene *scene = reinterpret_cast<Scene *>(id);
43 TreeElement *te = add_element(&tree, id, nullptr, nullptr, TSE_SOME_ID, 0);
44 TreeStoreElem *tselem = TREESTORE(te);
45
46 /* New scene elements open by default */
47 if ((scene == source_data.scene && show_opened) || !tselem->used) {
48 tselem->flag &= ~TSE_CLOSED;
49 }
50
52 }
53
54 return tree;
55}
56
57} // namespace blender::ed::outliner
int BLI_mempool_len(const BLI_mempool *pool) ATTR_NONNULL(1)
@ TSE_SOME_ID
Base Class For Tree-Displays.
static TreeElement * add_element(SpaceOutliner *space_outliner, ListBase *lb, ID *owner_id, void *create_data, TreeElement *parent, short type, short index, const bool expand=true)
TreeDisplayScenes(SpaceOutliner &space_outliner)
ListBase build_tree(const TreeSourceData &source_data) override
GPU_SHADER_INTERFACE_INFO(depth_2d_update_iface, "").smooth(Type fragColor push_constant(Type::VEC2, "extent") .push_constant(Type source_data
KDTree_3d * tree
void outliner_make_object_parent_hierarchy(ListBase *lb)
Definition common.cc:40
ListBaseWrapperTemplate< ListBase, T > ListBaseWrapper
#define TREESTORE(a)
Definition DNA_ID.h:413
struct BLI_mempool * treestore
The data to build the tree from.
Establish and manage Outliner trees for different display modes.