Blender  V2.93
tree_element_nla.cc
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #include "BLI_listbase_wrapper.hh"
22 
23 #include "DNA_anim_types.h"
24 #include "DNA_listBase.h"
25 
26 #include "BLT_translation.h"
27 
28 #include "../outliner_intern.h"
29 #include "tree_display.h"
30 
31 #include "tree_element_nla.hh"
32 
33 namespace blender::ed::outliner {
34 
36  : AbstractTreeElement(legacy_te), anim_data_(anim_data)
37 {
38  BLI_assert(legacy_te.store_elem->type == TSE_NLA);
39  legacy_te.name = IFACE_("NLA Tracks");
40  legacy_te.directdata = &anim_data;
41 }
42 
43 void TreeElementNLA::expand(SpaceOutliner &space_outliner) const
44 {
45  int a = 0;
46  for (NlaTrack *nlt : ListBaseWrapper<NlaTrack>(anim_data_.nla_tracks)) {
48  a++;
49  }
50 }
51 
52 /* -------------------------------------------------------------------- */
53 
55  : AbstractTreeElement(legacy_te), track_(track)
56 {
57  BLI_assert(legacy_te.store_elem->type == TSE_NLA_TRACK);
58  legacy_te.name = track.name;
59 }
60 
61 void TreeElementNLATrack::expand(SpaceOutliner &space_outliner) const
62 {
63  int a = 0;
64  for (NlaStrip *strip : ListBaseWrapper<NlaStrip>(track_.strips)) {
66  &space_outliner, &legacy_te_.subtree, strip->act, &legacy_te_, TSE_NLA_ACTION, a);
67  a++;
68  }
69 }
70 
71 /* -------------------------------------------------------------------- */
72 
74  : AbstractTreeElement(legacy_te)
75 {
77  legacy_te.name = action.id.name + 2;
78 }
79 
80 } // namespace blender::ed::outliner
#define BLI_assert(a)
Definition: BLI_assert.h:58
#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:92
TreeElement * outliner_add_element(SpaceOutliner *space_outliner, ListBase *lb, void *idv, TreeElement *parent, short type, short index)
ListBase nla_tracks
char name[66]
Definition: DNA_ID.h:283
ListBase strips
char name[64]
ListBase subtree
TreeStoreElem * store_elem
void * directdata
const char * name