Blender V5.0
tree_element_nla.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
10
11#include "DNA_anim_types.h"
12#include "DNA_space_types.h"
13
14#include "BLT_translation.hh"
15
16#include "../outliner_intern.hh"
17
18#include "tree_element_nla.hh"
19
20namespace blender::ed::outliner {
21
23 : AbstractTreeElement(legacy_te), anim_data_(anim_data)
24{
25 BLI_assert(legacy_te.store_elem->type == TSE_NLA);
26 legacy_te.name = IFACE_("NLA Tracks");
27 legacy_te.directdata = &anim_data;
28}
29
30void TreeElementNLA::expand(SpaceOutliner & /*space_outliner*/) const
31{
32 int a = 0;
33 for (NlaTrack *nlt : ListBaseWrapper<NlaTrack>(anim_data_.nla_tracks)) {
34 add_element(&legacy_te_.subtree, nullptr, nlt, &legacy_te_, TSE_NLA_TRACK, a);
35 a++;
36 }
37}
38
39/* -------------------------------------------------------------------- */
40
42 : AbstractTreeElement(legacy_te), track_(track)
43{
45 legacy_te.name = track.name;
46}
47
48void TreeElementNLATrack::expand(SpaceOutliner & /*space_outliner*/) const
49{
50 int a = 0;
51 for (NlaStrip *strip : ListBaseWrapper<NlaStrip>(track_.strips)) {
52 add_element(&legacy_te_.subtree,
53 reinterpret_cast<ID *>(strip->act),
54 nullptr,
57 a);
58 a++;
59 }
60}
61
62/* -------------------------------------------------------------------- */
63
65 : AbstractTreeElement(legacy_te)
66{
68 legacy_te.name = action.id.name + 2;
69}
70
71} // namespace blender::ed::outliner
#define BLI_assert(a)
Definition BLI_assert.h:46
#define IFACE_(msgid)
@ TSE_NLA_TRACK
@ TSE_NLA
@ TSE_NLA_ACTION
TreeElement * add_element(ListBase *lb, ID *owner_id, void *create_data, TreeElement *parent, short type, short index, const bool expand=true) const
TreeElementNLAAction(TreeElement &legacy_te, const bAction &action)
TreeElementNLATrack(TreeElement &legacy_te, NlaTrack &track)
void expand(SpaceOutliner &space_outliner) const override
void expand(SpaceOutliner &space_outliner) const override
TreeElementNLA(TreeElement &legacy_te, AnimData &anim_data)
ListBaseWrapperTemplate< ListBase, T > ListBaseWrapper
Definition DNA_ID.h:414
char name[258]
Definition DNA_ID.h:432
char name[64]