Blender V4.3
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
10
11#include "DNA_anim_types.h"
12#include "DNA_listBase.h"
13#include "DNA_space_types.h"
14
15#include "BLT_translation.hh"
16
17#include "../outliner_intern.hh"
18
19#include "tree_element_nla.hh"
20
21namespace blender::ed::outliner {
22
24 : AbstractTreeElement(legacy_te), anim_data_(anim_data)
25{
26 BLI_assert(legacy_te.store_elem->type == TSE_NLA);
27 legacy_te.name = IFACE_("NLA Tracks");
28 legacy_te.directdata = &anim_data;
29}
30
31void TreeElementNLA::expand(SpaceOutliner & /*space_outliner*/) const
32{
33 int a = 0;
34 for (NlaTrack *nlt : ListBaseWrapper<NlaTrack>(anim_data_.nla_tracks)) {
36 a++;
37 }
38}
39
40/* -------------------------------------------------------------------- */
41
43 : AbstractTreeElement(legacy_te), track_(track)
44{
46 legacy_te.name = track.name;
47}
48
49void TreeElementNLATrack::expand(SpaceOutliner & /*space_outliner*/) const
50{
51 int a = 0;
52 for (NlaStrip *strip : ListBaseWrapper<NlaStrip>(track_.strips)) {
54 reinterpret_cast<ID *>(strip->act),
55 nullptr,
58 a);
59 a++;
60 }
61}
62
63/* -------------------------------------------------------------------- */
64
66 : AbstractTreeElement(legacy_te)
67{
69 legacy_te.name = action.id.name + 2;
70}
71
72} // namespace blender::ed::outliner
#define BLI_assert(a)
Definition BLI_assert.h:50
#define IFACE_(msgid)
These structs are the foundation for all linked lists in the library system.
@ 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
ListBase nla_tracks
Definition DNA_ID.h:413
char name[66]
Definition DNA_ID.h:425
ListBase strips
char name[64]