Blender V4.5
ANIM_armature.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2025 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11#pragma once
12
14
15#include "DNA_armature_types.h"
16
17namespace blender::animrig {
18
22inline bool bone_is_visible(const bArmature *armature, const Bone *bone)
23{
24 const bool bone_itself_visible = (bone->flag & BONE_HIDDEN_P) == 0;
25 return bone_itself_visible && ANIM_bone_in_visible_collection(armature, bone);
26}
27
28inline bool bone_is_visible_pchan(const bArmature *armature, const bPoseChannel *pchan)
29{
30 return bone_is_visible(armature, pchan->bone);
31}
32
33inline bool bone_is_visible_editbone(const bArmature *armature, const EditBone *ebone)
34{
35 const bool bone_itself_visible = (ebone->flag & BONE_HIDDEN_A) == 0;
36 return bone_itself_visible && ANIM_bonecoll_is_visible_editbone(armature, ebone);
37}
38
39} // namespace blender::animrig
C++ functions to deal with Armature collections (i.e. the successor of bone layers).
bool ANIM_bonecoll_is_visible_editbone(const bArmature *armature, const EditBone *ebone)
bool ANIM_bone_in_visible_collection(const bArmature *armature, const Bone *bone)
@ BONE_HIDDEN_A
@ BONE_HIDDEN_P
bool bone_is_visible_editbone(const bArmature *armature, const EditBone *ebone)
bool bone_is_visible(const bArmature *armature, const Bone *bone)
bool bone_is_visible_pchan(const bArmature *armature, const bPoseChannel *pchan)
struct Bone * bone