Blender V5.3
ANIM_armature_iter.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11#pragma once
12
13#include "DNA_armature_types.h"
14
16
17namespace blender::animrig {
26template<typename CB> static void ANIM_armature_foreach_bone(ListBaseT<Bone> *bones, CB callback)
27{
28 for (Bone *bone : ListBaseWrapper<Bone>(bones)) {
29 callback(bone);
30 ANIM_armature_foreach_bone(&bone->childbase, callback);
31 }
32}
33
42template<typename CB>
43static void ANIM_armature_foreach_bone(const ListBaseT<Bone> *bones, CB callback)
44{
45 for (const Bone *bone : ConstListBaseWrapper<Bone>(bones)) {
46 callback(bone);
47 ANIM_armature_foreach_bone(&bone->childbase, callback);
48 }
49}
50
51}; // namespace blender::animrig
#define CB(a)
static void ANIM_armature_foreach_bone(ListBaseT< Bone > *bones, CB callback)
ListBaseWrapperTemplate< const ListBase, const T > ConstListBaseWrapper
ListBaseWrapperTemplate< ListBase, T > ListBaseWrapper