From 004a348efc8b6b8450ac65e31a43fcbc286556a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 21 Sep 2023 16:37:33 +0200 Subject: [PATCH] Anim, refactor the show/hide all bone collections functions Instead of setting flags directly, use the `ANIM_bonecoll_{show,hide}` functions. And introduce the `ANIM_bonecoll_show` function for symmetry. --- source/blender/animrig/intern/bone_collections.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/blender/animrig/intern/bone_collections.cc b/source/blender/animrig/intern/bone_collections.cc index a5489abc200..53ed2ef6c49 100644 --- a/source/blender/animrig/intern/bone_collections.cc +++ b/source/blender/animrig/intern/bone_collections.cc @@ -288,6 +288,11 @@ BoneCollection *ANIM_armature_bonecoll_get_by_name(bArmature *armature, const ch return nullptr; } +void ANIM_bonecoll_show(BoneCollection *bcoll) +{ + bcoll->flags |= BONE_COLLECTION_VISIBLE; +} + void ANIM_bonecoll_hide(BoneCollection *bcoll) { bcoll->flags &= ~BONE_COLLECTION_VISIBLE; @@ -458,14 +463,14 @@ bool ANIM_bonecoll_is_visible_editbone(const bArmature * /*armature*/, const Edi void ANIM_armature_bonecoll_show_all(bArmature *armature) { LISTBASE_FOREACH (BoneCollection *, bcoll, &armature->collections) { - bcoll->flags |= BONE_COLLECTION_VISIBLE; + ANIM_bonecoll_show(bcoll); } } void ANIM_armature_bonecoll_hide_all(bArmature *armature) { LISTBASE_FOREACH (BoneCollection *, bcoll, &armature->collections) { - bcoll->flags &= ~BONE_COLLECTION_VISIBLE; + ANIM_bonecoll_hide(bcoll); } }