Blender V5.3
tree_element_id_gpencil_legacy.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
8
10#include "DNA_outliner_types.h"
11
12#include "BLI_listbase.hh"
13
14#include "../outliner_intern.hh"
15
16#include "tree_display.hh"
19
20namespace blender::ed::outliner {
21
23 : TreeElementID(legacy_te, gpd.id), gpd_(gpd)
24{
25}
26
27void TreeElementIDGPLegacy::expand(SpaceOutliner & /*space_outliner*/) const
28{
29 expand_animation_data(gpd_.adt);
30
31 expand_layers();
32}
33
34void TreeElementIDGPLegacy::expand_layers() const
35{
36 int index = 0;
37 for (bGPDlayer &gpl : gpd_.layers.items_reversed()) {
38 add_element<TreeElementGPencilLayer>({.index = index, .owner_id = &gpd_.id}, gpl);
39 index++;
40 }
41}
42
43} // namespace blender::ed::outliner
TreeElement * add_element(const TreeElementAddParams &params, Args &&...args) const
TreeElementIDGPLegacy(TreeElement &legacy_te, bGPdata &gpd)
TreeElementID(TreeElement &legacy_te, ID &id)
void expand_animation_data(AnimData *) const
ListBaseT< bGPDlayer > layers
Establish and manage Outliner trees for different display modes.