Blender  V3.3
tree_element_nla.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
8 
9 #include "DNA_anim_types.h"
10 #include "DNA_listBase.h"
11 #include "DNA_space_types.h"
12 
13 #include "BLT_translation.h"
14 
15 #include "../outliner_intern.hh"
16 
17 #include "tree_element_nla.hh"
18 
19 namespace blender::ed::outliner {
20 
22  : AbstractTreeElement(legacy_te), anim_data_(anim_data)
23 {
24  BLI_assert(legacy_te.store_elem->type == TSE_NLA);
25  legacy_te.name = IFACE_("NLA Tracks");
26  legacy_te.directdata = &anim_data;
27 }
28 
29 void TreeElementNLA::expand(SpaceOutliner &space_outliner) const
30 {
31  int a = 0;
32  for (NlaTrack *nlt : ListBaseWrapper<NlaTrack>(anim_data_.nla_tracks)) {
34  a++;
35  }
36 }
37 
38 /* -------------------------------------------------------------------- */
39 
41  : AbstractTreeElement(legacy_te), track_(track)
42 {
43  BLI_assert(legacy_te.store_elem->type == TSE_NLA_TRACK);
44  legacy_te.name = track.name;
45 }
46 
47 void TreeElementNLATrack::expand(SpaceOutliner &space_outliner) const
48 {
49  int a = 0;
50  for (NlaStrip *strip : ListBaseWrapper<NlaStrip>(track_.strips)) {
52  &space_outliner, &legacy_te_.subtree, strip->act, &legacy_te_, TSE_NLA_ACTION, a);
53  a++;
54  }
55 }
56 
57 /* -------------------------------------------------------------------- */
58 
60  : AbstractTreeElement(legacy_te)
61 {
63  legacy_te.name = action.id.name + 2;
64 }
65 
66 } // namespace blender::ed::outliner
#define BLI_assert(a)
Definition: BLI_assert.h:46
#define IFACE_(msgid)
These structs are the foundation for all linked lists in the library system.
@ TSE_NLA_TRACK
@ TSE_NLA
@ TSE_NLA_ACTION
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)
static unsigned a[3]
Definition: RandGen.cpp:78
TreeElement * outliner_add_element(SpaceOutliner *space_outliner, ListBase *lb, void *idv, TreeElement *parent, short type, short index, const bool expand)
ListBase nla_tracks
char name[66]
Definition: DNA_ID.h:378
ListBase strips
char name[64]
ListBase subtree
TreeStoreElem * store_elem
const char * name