Blender V4.3
tree_element_bone_collection.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
9#include "DNA_action_types.h"
10#include "DNA_outliner_types.h"
11
12#include "BLT_translation.hh"
13
14#include "../outliner_intern.hh"
15
17
18namespace blender::ed::outliner {
19
21 bArmature &armature)
22 : AbstractTreeElement(legacy_te), armature_(armature)
23{
25 legacy_te.name = IFACE_("Bone Collections");
26}
27
29{
30 int index = 0;
31 for (BoneCollection *bcoll : armature_.collections_roots()) {
33 &legacy_te_.subtree, &armature_.id, bcoll, &legacy_te_, TSE_BONE_COLLECTION, index);
34 index++;
35 }
36}
37
39 bArmature &armature,
40 BoneCollection &bcoll)
41 : AbstractTreeElement(legacy_te), armature_(armature), bcoll_(bcoll)
42{
44 legacy_te.name = bcoll_.name;
45 legacy_te.directdata = &bcoll_;
46}
47
48void TreeElementBoneCollection::expand(SpaceOutliner & /*space_outliner*/) const
49{
50 int index = 0;
51 for (BoneCollection *child_bcoll : armature_.collection_children(&bcoll_)) {
53 &legacy_te_.subtree, &armature_.id, child_bcoll, &legacy_te_, TSE_BONE_COLLECTION, index);
54 index++;
55 }
56}
57
58} // namespace blender::ed::outliner
#define BLI_assert(a)
Definition BLI_assert.h:50
#define IFACE_(msgid)
@ TSE_BONE_COLLECTION
@ TSE_BONE_COLLECTION_BASE
TreeElement * add_element(ListBase *lb, ID *owner_id, void *create_data, TreeElement *parent, short type, short index, const bool expand=true) const
TreeElementBoneCollectionBase(TreeElement &legacy_te, bArmature &armature)
TreeElementBoneCollection(TreeElement &legacy_te, bArmature &armature, BoneCollection &bcoll)