Blender
V4.3
source
blender
editors
space_outliner
tree
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
9
#include "
DNA_listBase.h
"
10
#include "
DNA_mesh_types.h
"
11
#include "
DNA_outliner_types.h
"
12
13
#include "
../outliner_intern.hh
"
14
15
#include "
tree_element_id_mesh.hh
"
16
17
namespace
blender::ed::outliner
{
18
19
TreeElementIDMesh::TreeElementIDMesh
(
TreeElement
&legacy_te_,
Mesh
&mesh)
20
:
TreeElementID
(legacy_te_, mesh.id), mesh_(mesh)
21
{
22
}
23
24
void
TreeElementIDMesh::expand
(
SpaceOutliner
&
/*space_outliner*/
)
const
25
{
26
expand_animation_data
(mesh_.
adt
);
27
28
expand_key();
29
expand_materials();
30
}
31
32
void
TreeElementIDMesh::expand_key()
const
33
{
34
add_element
(&
legacy_te_
.
subtree
,
35
reinterpret_cast<
ID
*
>
(mesh_.
key
),
36
nullptr
,
37
&
legacy_te_
,
38
TSE_SOME_ID
,
39
0);
40
}
41
42
void
TreeElementIDMesh::expand_materials()
const
43
{
44
for
(
int
a = 0; a < mesh_.
totcol
; a++) {
45
add_element
(&
legacy_te_
.
subtree
,
46
reinterpret_cast<
ID
*
>
(mesh_.
mat
[a]),
47
nullptr
,
48
&
legacy_te_
,
49
TSE_SOME_ID
,
50
a);
51
}
52
}
53
54
}
// namespace blender::ed::outliner
DNA_listBase.h
These structs are the foundation for all linked lists in the library system.
DNA_mesh_types.h
DNA_outliner_types.h
TSE_SOME_ID
@ TSE_SOME_ID
Definition
DNA_outliner_types.h:65
blender::ed::outliner::AbstractTreeElement::add_element
TreeElement * add_element(ListBase *lb, ID *owner_id, void *create_data, TreeElement *parent, short type, short index, const bool expand=true) const
Definition
tree_element.cc:240
blender::ed::outliner::AbstractTreeElement::legacy_te_
TreeElement & legacy_te_
Definition
tree_element.hh:36
blender::ed::outliner::TreeElementIDMesh::expand
void expand(SpaceOutliner &) const override
Definition
tree_element_id_mesh.cc:24
blender::ed::outliner::TreeElementIDMesh::TreeElementIDMesh
TreeElementIDMesh(TreeElement &legacy_te_, Mesh &mesh)
Definition
tree_element_id_mesh.cc:19
blender::ed::outliner::TreeElementID
Definition
tree_element_id.hh:20
blender::ed::outliner::TreeElementID::expand_animation_data
void expand_animation_data(AnimData *) const
Definition
tree_element_id.cc:132
blender::ed::outliner
Definition
outliner_collections.cc:42
outliner_intern.hh
ID
Definition
DNA_ID.h:413
Mesh
Definition
DNA_mesh_types.h:56
Mesh::adt
struct AnimData * adt
Definition
DNA_mesh_types.h:61
Mesh::mat
struct Material ** mat
Definition
DNA_mesh_types.h:72
Mesh::totcol
short totcol
Definition
DNA_mesh_types.h:178
Mesh::key
struct Key * key
Definition
DNA_mesh_types.h:65
SpaceOutliner
Definition
DNA_space_types.h:289
blender::ed::outliner::TreeElement
Definition
outliner_intern.hh:84
blender::ed::outliner::TreeElement::subtree
ListBase subtree
Definition
outliner_intern.hh:95
tree_element_id_mesh.hh
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0