diff --git a/source/blender/editors/armature/armature_edit.cc b/source/blender/editors/armature/armature_edit.cc index a3f0ac90475..068b4b9a781 100644 --- a/source/blender/editors/armature/armature_edit.cc +++ b/source/blender/editors/armature/armature_edit.cc @@ -1253,7 +1253,7 @@ static int armature_delete_selected_exec(bContext *C, wmOperator * /*op*/) for (curBone = static_cast(arm->edbo->first); curBone; curBone = ebone_next) { ebone_next = curBone->next; - if (ANIM_bonecoll_is_visible_editbone(arm, curBone)) { + if (EBONE_VISIBLE(arm, curBone)) { if (curBone->flag & BONE_SELECTED) { if (curBone == arm->act_edbone) { arm->act_edbone = nullptr; @@ -1395,13 +1395,13 @@ static int armature_dissolve_selected_exec(bContext *C, wmOperator * /*op*/) LISTBASE_FOREACH (EditBone *, ebone, arm->edbo) { /* break connections for unseen bones */ - if ((ANIM_bonecoll_is_visible_editbone(arm, ebone) && + if ((EBONE_VISIBLE(arm, ebone) && (ED_armature_ebone_selectflag_get(ebone) & (BONE_TIPSEL | BONE_SELECTED))) == 0) { ebone->temp.ebone = nullptr; } - if ((ANIM_bonecoll_is_visible_editbone(arm, ebone) && + if ((EBONE_VISIBLE(arm, ebone) && (ED_armature_ebone_selectflag_get(ebone) & (BONE_ROOTSEL | BONE_SELECTED))) == 0) { if (ebone->parent && (ebone->flag & BONE_CONNECTED)) { diff --git a/source/blender/editors/armature/armature_utils.cc b/source/blender/editors/armature/armature_utils.cc index 20e336b1562..18961099c33 100644 --- a/source/blender/editors/armature/armature_utils.cc +++ b/source/blender/editors/armature/armature_utils.cc @@ -276,7 +276,7 @@ void armature_select_mirrored_ex(bArmature *arm, const int flag) /* Select mirrored bones */ if (arm->flag & ARM_MIRROR_EDIT) { LISTBASE_FOREACH (EditBone *, curBone, arm->edbo) { - if (ANIM_bonecoll_is_visible_editbone(arm, curBone)) { + if (EBONE_VISIBLE(arm, curBone)) { if (curBone->flag & flag) { EditBone *ebone_mirr = ED_armature_ebone_get_mirrored(arm->edbo, curBone); if (ebone_mirr) { @@ -303,7 +303,7 @@ void armature_tag_select_mirrored(bArmature *arm) /* Select mirrored bones */ if (arm->flag & ARM_MIRROR_EDIT) { LISTBASE_FOREACH (EditBone *, curBone, arm->edbo) { - if (ANIM_bonecoll_is_visible_editbone(arm, curBone)) { + if (EBONE_VISIBLE(arm, curBone)) { if (curBone->flag & (BONE_SELECTED | BONE_ROOTSEL | BONE_TIPSEL)) { EditBone *ebone_mirr = ED_armature_ebone_get_mirrored(arm->edbo, curBone); if (ebone_mirr && (ebone_mirr->flag & BONE_SELECTED) == 0) { diff --git a/source/blender/editors/space_outliner/outliner_select.cc b/source/blender/editors/space_outliner/outliner_select.cc index 8e6753a6b78..d8a1b0f3428 100644 --- a/source/blender/editors/space_outliner/outliner_select.cc +++ b/source/blender/editors/space_outliner/outliner_select.cc @@ -642,7 +642,7 @@ static void tree_element_active_ebone__sel(bContext *C, bArmature *arm, EditBone if (sel) { arm->act_edbone = ebone; } - if (ANIM_bone_is_visible_editbone(arm, ebone) && ((ebone->flag & BONE_UNSELECTABLE) == 0)) { + if (EBONE_SELECTABLE(arm, ebone)) { ED_armature_ebone_select_set(ebone, sel); } WM_event_add_notifier(C, NC_OBJECT | ND_BONE_ACTIVE, CTX_data_edit_object(C)); diff --git a/source/blender/editors/transform/transform_orientations.cc b/source/blender/editors/transform/transform_orientations.cc index 6406a72b117..2e8b1251581 100644 --- a/source/blender/editors/transform/transform_orientations.cc +++ b/source/blender/editors/transform/transform_orientations.cc @@ -1362,7 +1362,7 @@ int getTransformOrientation_ex(const Scene *scene, zero_v3(fallback_plane); LISTBASE_FOREACH (EditBone *, ebone, arm->edbo) { - if (ANIM_bonecoll_is_visible_editbone(arm, ebone)) { + if (EBONE_VISIBLE(arm, ebone)) { if (ebone->flag & BONE_SELECTED) { ED_armature_ebone_to_mat3(ebone, tmat); add_v3_v3(r_normal, tmat[2]); diff --git a/source/blender/editors/transform/transform_snap_object_armature.cc b/source/blender/editors/transform/transform_snap_object_armature.cc index f809335984f..bc7b123afba 100644 --- a/source/blender/editors/transform/transform_snap_object_armature.cc +++ b/source/blender/editors/transform/transform_snap_object_armature.cc @@ -9,6 +9,7 @@ #include "BKE_armature.hh" #include "DNA_armature_types.h" +#include "ED_armature.hh" #include "ED_transform_snap_object_context.hh" #include "ANIM_bone_collections.hh" @@ -45,12 +46,7 @@ eSnapMode snapArmature(SnapObjectContext *sctx, if (arm->edbo) { LISTBASE_FOREACH (EditBone *, eBone, arm->edbo) { - if (ANIM_bonecoll_is_visible_editbone(arm, eBone)) { - if (eBone->flag & BONE_HIDDEN_A) { - /* Skip hidden bones. */ - continue; - } - + if (EBONE_VISIBLE(arm, eBone)) { const bool is_selected = (eBone->flag & (BONE_ROOTSEL | BONE_TIPSEL)) != 0; if (is_selected && skip_selected) { continue;