Blender V5.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
8
9#include "DNA_anim_types.h"
10#include "DNA_outliner_types.h"
11
12#include "BLI_listbase.hh"
13
14#include "BLT_translation.hh"
15
16#include "../outliner_intern.hh"
17
18#include "tree_display.hh"
21#include "tree_element_nla.hh"
22
23namespace blender::ed::outliner {
24
26 : AbstractTreeElement(legacy_te), anim_data_(anim_data)
27{
29 /* this element's info */
30 legacy_te.name = IFACE_("Animation");
31 legacy_te.directdata = &anim_data_;
32}
33
34void TreeElementAnimData::expand(SpaceOutliner & /*space_outliner*/) const
35{
36
37 if (anim_data_.action) {
38 /* Animation data-block itself. */
39 add_id_element({}, reinterpret_cast<ID *>(anim_data_.action));
40 }
41
42 expand_drivers();
43 expand_NLA_tracks();
44}
45
47{
48 return this->anim_data_.slot_handle;
49}
50
51void TreeElementAnimData::expand_drivers() const
52{
53 if (anim_data_.drivers.is_empty()) {
54 return;
55 }
57}
58
59void TreeElementAnimData::expand_NLA_tracks() const
60{
61 if (anim_data_.nla_tracks.is_empty()) {
62 return;
63 }
64 add_element<TreeElementNLA>({}, anim_data_);
65}
66
67} // namespace blender::ed::outliner
#define IFACE_(msgid)
TreeElement * add_element(const TreeElementAddParams &params, Args &&...args) const
TreeElement * add_id_element(const TreeElementAddParams &params, ID *id) const
void expand(SpaceOutliner &space_outliner) const override
TreeElementAnimData(TreeElement &legacy_te, AnimData &anim_data)
decltype(blender::ActionSlot::handle) slot_handle_t
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
ListBaseT< FCurve > drivers
ListBaseT< NlaTrack > nla_tracks
Establish and manage Outliner trees for different display modes.