Blender V5.3
tree_element_driver.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
8
10
11#include "BKE_fcurve_driver.h"
12
13#include "DNA_anim_types.h"
14#include "DNA_listBase.h"
15#include "DNA_space_types.h"
16
17#include "BLT_translation.hh"
18
19#include "../outliner_intern.hh"
20
21#include "tree_display.hh"
24
25namespace blender::ed::outliner {
26
28 : AbstractTreeElement(legacy_te), anim_data_(anim_data)
29{
31 legacy_te.name = IFACE_("Drivers");
32}
33
34void TreeElementDriverBase::expand(SpaceOutliner & /*space_outliner*/) const
35{
36 ID *lastadded = nullptr;
37
38 for (FCurve *fcu : ListBaseWrapper<FCurve>(anim_data_.drivers)) {
39 if (fcu->driver && fcu->driver->variables.first_) {
40 ChannelDriver *driver = fcu->driver;
41
42 for (DriverVar *dvar : ListBaseWrapper<DriverVar>(driver->variables)) {
43 /* loop over all targets used here */
45 if (lastadded != dtar->id) {
46 /* XXX this lastadded check is rather lame, and also fails quite badly... */
47 if (dtar->id) {
49 }
50 lastadded = dtar->id;
51 }
52 }
54 }
55 }
56 }
57}
58
59} // namespace blender::ed::outliner
#define DRIVER_TARGETS_USED_LOOPER_BEGIN(dvar)
#define DRIVER_TARGETS_LOOPER_END
#define IFACE_(msgid)
These structs are the foundation for all linked lists in the library system.
TreeElement * add_element(const TreeElementAddParams &params, Args &&...args) const
TreeElementDriverBase(TreeElement &legacy_te, AnimData &anim_data)
void expand(SpaceOutliner &space_outliner) const override
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
ListBaseWrapperTemplate< ListBase, T > ListBaseWrapper
ListBaseT< DriverVar > variables
Establish and manage Outliner trees for different display modes.