Blender V4.3
tree_element_defgroup.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 "BLI_listbase.h"
10
11#include "DNA_object_types.h"
12#include "DNA_outliner_types.h"
13
14#include "BKE_deform.hh"
15
16#include "BLT_translation.hh"
17
18#include "../outliner_intern.hh"
19
21
22namespace blender::ed::outliner {
23
25 : AbstractTreeElement(legacy_te), object_(object)
26{
28 legacy_te.name = IFACE_("Vertex Groups");
29}
30
31void TreeElementDeformGroupBase::expand(SpaceOutliner & /*space_outliner*/) const
32{
33 const ListBase *defbase = BKE_object_defgroup_list(&object_);
34
35 int index;
36 LISTBASE_FOREACH_INDEX (bDeformGroup *, defgroup, defbase, index) {
37 add_element(&legacy_te_.subtree, &object_.id, defgroup, &legacy_te_, TSE_DEFGROUP, index);
38 }
39}
40
42 Object & /*object*/,
43 bDeformGroup &defgroup)
44 : AbstractTreeElement(legacy_te), /* object_(object), */ defgroup_(defgroup)
45{
47 legacy_te.name = defgroup_.name;
48 legacy_te.directdata = &defgroup_;
49}
50
51} // namespace blender::ed::outliner
support for deformation groups and hooks.
const ListBase * BKE_object_defgroup_list(const Object *ob)
Definition deform.cc:579
#define BLI_assert(a)
Definition BLI_assert.h:50
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
#define IFACE_(msgid)
Object is a sort of wrapper for general info.
@ TSE_DEFGROUP_BASE
@ TSE_DEFGROUP
TreeElement * add_element(ListBase *lb, ID *owner_id, void *create_data, TreeElement *parent, short type, short index, const bool expand=true) const
TreeElementDeformGroupBase(TreeElement &legacy_te, Object &object)
TreeElementDeformGroup(TreeElement &legacy_te, Object &object, bDeformGroup &defgroup)