Blender V5.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
8
10#include "DNA_outliner_types.h"
11
12#include "BLT_translation.hh"
13
14#include "../outliner_intern.hh"
15
16#include "tree_display.hh"
18
19namespace blender::ed::outliner {
20
22 bArmature &armature)
23 : AbstractTreeElement(legacy_te), armature_(armature)
24{
26 legacy_te.name = IFACE_("Bone Collections");
27}
28
30{
31 return &armature.id;
32}
33
35{
36 int index = 0;
37 for (BoneCollection *bcoll : armature_.collections_roots()) {
38 add_element<TreeElementBoneCollection>({.index = index}, armature_, *bcoll);
39 index++;
40 }
41}
42
44 bArmature &armature,
45 BoneCollection &bcoll)
46 : AbstractTreeElement(legacy_te), armature_(armature), bcoll_(bcoll)
47{
49 legacy_te.name = bcoll_.name;
50 legacy_te.directdata = &bcoll_;
51}
52
54{
55 return &armature.id;
56}
57
58void TreeElementBoneCollection::expand(SpaceOutliner & /*space_outliner*/) const
59{
60 int index = 0;
61 for (BoneCollection *child_bcoll : armature_.collection_children(&bcoll_)) {
62 add_element<TreeElementBoneCollection>({.index = index}, armature_, *child_bcoll);
63 index++;
64 }
65}
66
67} // namespace blender::ed::outliner
#define IFACE_(msgid)
TreeElement * add_element(const TreeElementAddParams &params, Args &&...args) const
TreeElementBoneCollectionBase(TreeElement &legacy_te, bArmature &armature)
static ID * owner_id(bArmature &armature, BoneCollection &bcoll)
TreeElementBoneCollection(TreeElement &legacy_te, bArmature &armature, BoneCollection &bcoll)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
Establish and manage Outliner trees for different display modes.