Blender V5.3
tree_element_id_mesh.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
9#include "DNA_mesh_types.h"
10#include "DNA_outliner_types.h"
11
12#include "../outliner_intern.hh"
13
14#include "tree_display.hh"
17
18namespace blender::ed::outliner {
19
24
25void TreeElementIDMesh::expand(SpaceOutliner & /*space_outliner*/) const
26{
27 expand_animation_data(mesh_.adt);
28
29 expand_key();
30 expand_materials();
31}
32
33void TreeElementIDMesh::expand_key() const
34{
35 /* Not every mesh has shape keys. */
36 if (mesh_.key) {
38 }
39}
40
41void TreeElementIDMesh::expand_materials() const
42{
43 for (int a = 0; a < mesh_.totcol; a++) {
44 add_id_element({.index = a}, reinterpret_cast<ID *>(mesh_.mat[a]));
45 }
46}
47
48} // namespace blender::ed::outliner
TreeElement * add_element(const TreeElementAddParams &params, Args &&...args) const
TreeElement * add_id_element(const TreeElementAddParams &params, ID *id) const
void expand(SpaceOutliner &) const override
TreeElementIDMesh(TreeElement &legacy_te_, Mesh &mesh)
TreeElementID(TreeElement &legacy_te, ID &id)
void expand_animation_data(AnimData *) const
struct Key * key
Establish and manage Outliner trees for different display modes.