Blender V4.3
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
10
11#include "DNA_anim_types.h"
12#include "DNA_listBase.h"
13#include "DNA_outliner_types.h"
14
15#include "BLT_translation.hh"
16
17#include "../outliner_intern.hh"
18
20
21namespace blender::ed::outliner {
22
24 : AbstractTreeElement(legacy_te), anim_data_(anim_data)
25{
27 /* this element's info */
28 legacy_te.name = IFACE_("Animation");
29 legacy_te.directdata = &anim_data_;
30}
31
32void TreeElementAnimData::expand(SpaceOutliner & /*space_outliner*/) const
33{
34
35 if (anim_data_.action) {
36 /* Animation data-block itself. */
38 reinterpret_cast<ID *>(anim_data_.action),
39 nullptr,
42 0);
43 }
44
45 expand_drivers();
46 expand_NLA_tracks();
47}
48
49void TreeElementAnimData::expand_drivers() const
50{
51 if (BLI_listbase_is_empty(&anim_data_.drivers)) {
52 return;
53 }
54 add_element(&legacy_te_.subtree, nullptr, &anim_data_, &legacy_te_, TSE_DRIVER_BASE, 0);
55}
56
57void TreeElementAnimData::expand_NLA_tracks() const
58{
59 if (BLI_listbase_is_empty(&anim_data_.nla_tracks)) {
60 return;
61 }
62 add_element(&legacy_te_.subtree, nullptr, &anim_data_, &legacy_te_, TSE_NLA, 0);
63}
64
65} // namespace blender::ed::outliner
#define BLI_assert(a)
Definition BLI_assert.h:50
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define IFACE_(msgid)
These structs are the foundation for all linked lists in the library system.
@ TSE_ANIM_DATA
@ TSE_NLA
@ TSE_SOME_ID
@ TSE_DRIVER_BASE
TreeElement * add_element(ListBase *lb, ID *owner_id, void *create_data, TreeElement *parent, short type, short index, const bool expand=true) const
void expand(SpaceOutliner &space_outliner) const override
TreeElementAnimData(TreeElement &legacy_te, AnimData &anim_data)
bAction * action
ListBase drivers
ListBase nla_tracks
Definition DNA_ID.h:413