Blender  V3.3
tree_element_driver.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
8 
9 #include "BKE_fcurve_driver.h"
10 
11 #include "DNA_anim_types.h"
12 #include "DNA_listBase.h"
13 #include "DNA_space_types.h"
14 
15 #include "BLT_translation.h"
16 
17 #include "../outliner_intern.hh"
18 
19 #include "tree_element_driver.hh"
20 
21 namespace blender::ed::outliner {
22 
24  : AbstractTreeElement(legacy_te), anim_data_(anim_data)
25 {
27  legacy_te.name = IFACE_("Drivers");
28 }
29 
30 void TreeElementDriverBase::expand(SpaceOutliner &space_outliner) const
31 {
32  ID *lastadded = nullptr;
33 
34  for (FCurve *fcu : blender::ListBaseWrapper<FCurve>(anim_data_.drivers)) {
35  if (fcu->driver && fcu->driver->variables.first) {
36  ChannelDriver *driver = fcu->driver;
37 
39  /* loop over all targets used here */
41  if (lastadded != dtar->id) {
42  /* XXX this lastadded check is rather lame, and also fails quite badly... */
44  &space_outliner, &legacy_te_.subtree, dtar->id, &legacy_te_, TSE_LINKED_OB, 0);
45  lastadded = dtar->id;
46  }
47  }
49  }
50  }
51  }
52 }
53 
54 } // namespace blender::ed::outliner
#define DRIVER_TARGETS_USED_LOOPER_BEGIN(dvar)
#define DRIVER_TARGETS_LOOPER_END
#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_LINKED_OB
@ TSE_DRIVER_BASE
TreeElementDriverBase(TreeElement &legacy_te, AnimData &anim_data)
void expand(SpaceOutliner &space_outliner) const override
TreeElement * outliner_add_element(SpaceOutliner *space_outliner, ListBase *lb, void *idv, TreeElement *parent, short type, short index, const bool expand)
ListBase drivers
ListBase variables
Definition: DNA_ID.h:368
ListBase subtree
TreeStoreElem * store_elem
const char * name