Blender
V4.5
source
blender
editors
space_outliner
tree
tree_element_anim_data.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_anim_types.h
"
10
#include "
DNA_outliner_types.h
"
11
12
#include "
BLI_listbase.h
"
13
14
#include "
BLT_translation.hh
"
15
16
#include "
../outliner_intern.hh
"
17
18
#include "
tree_element_anim_data.hh
"
19
20
namespace
blender::ed::outliner
{
21
22
TreeElementAnimData::TreeElementAnimData
(
TreeElement
&legacy_te,
AnimData
&anim_data)
23
:
AbstractTreeElement
(legacy_te), anim_data_(anim_data)
24
{
25
BLI_assert
(legacy_te.
store_elem
->
type
==
TSE_ANIM_DATA
);
26
/* this element's info */
27
legacy_te.
name
=
IFACE_
(
"Animation"
);
28
legacy_te.
directdata
= &anim_data_;
29
}
30
31
void
TreeElementAnimData::expand
(
SpaceOutliner
&
/*space_outliner*/
)
const
32
{
33
34
if
(anim_data_.
action
) {
35
/* Animation data-block itself. */
36
add_element
(&
legacy_te_
.
subtree
,
37
reinterpret_cast<
ID
*
>
(anim_data_.
action
),
38
nullptr
,
39
&
legacy_te_
,
40
TSE_SOME_ID
,
41
0);
42
}
43
44
expand_drivers();
45
expand_NLA_tracks();
46
}
47
48
animrig::slot_handle_t
TreeElementAnimData::get_slot_handle
()
const
49
{
50
return
this->anim_data_.
slot_handle
;
51
}
52
53
void
TreeElementAnimData::expand_drivers()
const
54
{
55
if
(
BLI_listbase_is_empty
(&anim_data_.
drivers
)) {
56
return
;
57
}
58
add_element
(&
legacy_te_
.
subtree
,
nullptr
, &anim_data_, &
legacy_te_
,
TSE_DRIVER_BASE
, 0);
59
}
60
61
void
TreeElementAnimData::expand_NLA_tracks()
const
62
{
63
if
(
BLI_listbase_is_empty
(&anim_data_.
nla_tracks
)) {
64
return
;
65
}
66
add_element
(&
legacy_te_
.
subtree
,
nullptr
, &anim_data_, &
legacy_te_
,
TSE_NLA
, 0);
67
}
68
69
}
// namespace blender::ed::outliner
BLI_assert
#define BLI_assert(a)
Definition
BLI_assert.h:46
BLI_listbase.h
BLI_listbase_is_empty
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
Definition
BLI_listbase.h:289
BLT_translation.hh
IFACE_
#define IFACE_(msgid)
Definition
BLT_translation.hh:48
DNA_anim_types.h
DNA_outliner_types.h
TSE_ANIM_DATA
@ TSE_ANIM_DATA
Definition
DNA_outliner_types.h:81
TSE_NLA
@ TSE_NLA
Definition
DNA_outliner_types.h:67
TSE_SOME_ID
@ TSE_SOME_ID
Definition
DNA_outliner_types.h:65
TSE_DRIVER_BASE
@ TSE_DRIVER_BASE
Definition
DNA_outliner_types.h:82
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:243
blender::ed::outliner::AbstractTreeElement::legacy_te_
TreeElement & legacy_te_
Definition
tree_element.hh:36
blender::ed::outliner::TreeElementAnimData::expand
void expand(SpaceOutliner &space_outliner) const override
Definition
tree_element_anim_data.cc:31
blender::ed::outliner::TreeElementAnimData::get_slot_handle
animrig::slot_handle_t get_slot_handle() const
Definition
tree_element_anim_data.cc:48
blender::ed::outliner::TreeElementAnimData::TreeElementAnimData
TreeElementAnimData(TreeElement &legacy_te, AnimData &anim_data)
Definition
tree_element_anim_data.cc:22
blender::animrig::slot_handle_t
decltype(::ActionSlot::handle) slot_handle_t
Definition
ANIM_action_iterators.hh:26
blender::ed::outliner
Definition
outliner_collections.cc:44
outliner_intern.hh
AnimData
Definition
DNA_anim_types.h:651
AnimData::action
bAction * action
Definition
DNA_anim_types.h:661
AnimData::slot_handle
int32_t slot_handle
Definition
DNA_anim_types.h:673
AnimData::drivers
ListBase drivers
Definition
DNA_anim_types.h:709
AnimData::nla_tracks
ListBase nla_tracks
Definition
DNA_anim_types.h:693
ID
Definition
DNA_ID.h:404
SpaceOutliner
Definition
DNA_space_types.h:187
TreeStoreElem::type
short type
Definition
DNA_outliner_types.h:16
blender::ed::outliner::TreeElement
Definition
outliner_intern.hh:86
blender::ed::outliner::TreeElement::subtree
ListBase subtree
Definition
outliner_intern.hh:97
blender::ed::outliner::TreeElement::name
const char * name
Definition
outliner_intern.hh:104
blender::ed::outliner::TreeElement::store_elem
TreeStoreElem * store_elem
Definition
outliner_intern.hh:99
blender::ed::outliner::TreeElement::directdata
void * directdata
Definition
outliner_intern.hh:105
tree_element_anim_data.hh
Generated on Fri Apr 3 2026 06:33:18 for Blender by
doxygen
1.11.0