Blender
V4.3
source
blender
editors
space_outliner
tree
tree_element_bone_collection.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_action_types.h
"
10
#include "
DNA_outliner_types.h
"
11
12
#include "
BLT_translation.hh
"
13
14
#include "
../outliner_intern.hh
"
15
16
#include "
tree_element_bone_collection.hh
"
17
18
namespace
blender::ed::outliner
{
19
20
TreeElementBoneCollectionBase::TreeElementBoneCollectionBase
(
TreeElement
&legacy_te,
21
bArmature
&armature)
22
:
AbstractTreeElement
(legacy_te), armature_(armature)
23
{
24
BLI_assert
(legacy_te.
store_elem
->
type
==
TSE_BONE_COLLECTION_BASE
);
25
legacy_te.
name
=
IFACE_
(
"Bone Collections"
);
26
}
27
28
void
TreeElementBoneCollectionBase::expand
(
SpaceOutliner
&
/*space_outliner*/
)
const
29
{
30
int
index = 0;
31
for
(
BoneCollection
*bcoll : armature_.collections_roots()) {
32
add_element
(
33
&
legacy_te_
.
subtree
, &armature_.
id
, bcoll, &
legacy_te_
,
TSE_BONE_COLLECTION
, index);
34
index++;
35
}
36
}
37
38
TreeElementBoneCollection::TreeElementBoneCollection
(
TreeElement
&legacy_te,
39
bArmature
&armature,
40
BoneCollection
&bcoll)
41
:
AbstractTreeElement
(legacy_te), armature_(armature), bcoll_(bcoll)
42
{
43
BLI_assert
(legacy_te.
store_elem
->
type
==
TSE_BONE_COLLECTION
);
44
legacy_te.
name
= bcoll_.
name
;
45
legacy_te.
directdata
= &bcoll_;
46
}
47
48
void
TreeElementBoneCollection::expand
(
SpaceOutliner
&
/*space_outliner*/
)
const
49
{
50
int
index = 0;
51
for
(
BoneCollection
*child_bcoll : armature_.collection_children(&bcoll_)) {
52
add_element
(
53
&
legacy_te_
.
subtree
, &armature_.
id
, child_bcoll, &
legacy_te_
,
TSE_BONE_COLLECTION
, index);
54
index++;
55
}
56
}
57
58
}
// namespace blender::ed::outliner
BLI_assert
#define BLI_assert(a)
Definition
BLI_assert.h:50
BLT_translation.hh
IFACE_
#define IFACE_(msgid)
Definition
BLT_translation.hh:41
DNA_action_types.h
DNA_outliner_types.h
TSE_BONE_COLLECTION
@ TSE_BONE_COLLECTION
Definition
DNA_outliner_types.h:93
TSE_BONE_COLLECTION_BASE
@ TSE_BONE_COLLECTION_BASE
Definition
DNA_outliner_types.h:92
blender::ed::outliner::AbstractTreeElement
Definition
tree_element.hh:29
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::TreeElementBoneCollectionBase::expand
void expand(SpaceOutliner &) const override
Definition
tree_element_bone_collection.cc:28
blender::ed::outliner::TreeElementBoneCollectionBase::TreeElementBoneCollectionBase
TreeElementBoneCollectionBase(TreeElement &legacy_te, bArmature &armature)
Definition
tree_element_bone_collection.cc:20
blender::ed::outliner::TreeElementBoneCollection::expand
void expand(SpaceOutliner &) const override
Definition
tree_element_bone_collection.cc:48
blender::ed::outliner::TreeElementBoneCollection::TreeElementBoneCollection
TreeElementBoneCollection(TreeElement &legacy_te, bArmature &armature, BoneCollection &bcoll)
Definition
tree_element_bone_collection.cc:38
blender::ed::outliner
Definition
outliner_collections.cc:42
outliner_intern.hh
BoneCollection
Definition
DNA_armature_types.h:251
BoneCollection::name
char name[64]
Definition
DNA_armature_types.h:255
SpaceOutliner
Definition
DNA_space_types.h:289
TreeStoreElem::type
short type
Definition
DNA_outliner_types.h:16
bArmature
Definition
DNA_armature_types.h:157
bArmature::id
ID id
Definition
DNA_armature_types.h:158
blender::ed::outliner::TreeElement
Definition
outliner_intern.hh:84
blender::ed::outliner::TreeElement::subtree
ListBase subtree
Definition
outliner_intern.hh:95
blender::ed::outliner::TreeElement::name
const char * name
Definition
outliner_intern.hh:102
blender::ed::outliner::TreeElement::store_elem
TreeStoreElem * store_elem
Definition
outliner_intern.hh:97
blender::ed::outliner::TreeElement::directdata
void * directdata
Definition
outliner_intern.hh:103
tree_element_bone_collection.hh
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0