Blender  V3.3
tree_element_anim_data.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_outliner_types.h"
12 
13 #include "BLT_translation.h"
14 
15 #include "../outliner_intern.hh"
16 
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_ANIM_DATA);
25  /* this element's info */
26  legacy_te.name = IFACE_("Animation");
27  legacy_te.directdata = &anim_data_;
28 }
29 
30 void TreeElementAnimData::expand(SpaceOutliner &space_outliner) const
31 {
32  /* Animation data-block itself. */
34  &space_outliner, &legacy_te_.subtree, anim_data_.action, &legacy_te_, TSE_SOME_ID, 0);
35 
36  expand_drivers(space_outliner);
37  expand_NLA_tracks(space_outliner);
38 }
39 
40 void TreeElementAnimData::expand_drivers(SpaceOutliner &space_outliner) const
41 {
42  if (BLI_listbase_is_empty(&anim_data_.drivers)) {
43  return;
44  }
46  &space_outliner, &legacy_te_.subtree, &anim_data_, &legacy_te_, TSE_DRIVER_BASE, 0);
47 }
48 
49 void TreeElementAnimData::expand_NLA_tracks(SpaceOutliner &space_outliner) const
50 {
51  if (BLI_listbase_is_empty(&anim_data_.nla_tracks)) {
52  return;
53  }
54  outliner_add_element(&space_outliner, &legacy_te_.subtree, &anim_data_, &legacy_te_, TSE_NLA, 0);
55 }
56 
57 } // namespace blender::ed::outliner
#define BLI_assert(a)
Definition: BLI_assert.h:46
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
Definition: BLI_listbase.h:269
#define IFACE_(msgid)
These structs are the foundation for all linked lists in the library system.
@ TSE_ANIM_DATA
@ TSE_NLA
@ TSE_SOME_ID
@ TSE_DRIVER_BASE
void expand(SpaceOutliner &space_outliner) const override
TreeElementAnimData(TreeElement &legacy_te, AnimData &anim_data)
TreeElement * outliner_add_element(SpaceOutliner *space_outliner, ListBase *lb, void *idv, TreeElement *parent, short type, short index, const bool expand)
bAction * action
ListBase drivers
ListBase nla_tracks
ListBase subtree
TreeStoreElem * store_elem
const char * name