From a91f51b67b48c0a78032ed569d5a163718ec5cce Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 15 Jul 2013 02:03:31 +0000 Subject: allow deselection when bones BONE_UNSELECTABLE flag is set (lasso/box/circle select) --- source/blender/editors/armature/armature_select.c | 2 +- source/blender/editors/space_view3d/view3d_select.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c index 6a9036e75dc..d2d13ec8598 100644 --- a/source/blender/editors/armature/armature_select.c +++ b/source/blender/editors/armature/armature_select.c @@ -434,7 +434,7 @@ void ED_armature_deselect_all_visible(Object *obedit) for (ebone = arm->edbo->first; ebone; ebone = ebone->next) { /* first and foremost, bone must be visible and selected */ - if (EBONE_SELECTABLE(arm, ebone)) { + if (EBONE_VISIBLE(arm, ebone)) { ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL); } } diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index c119fe24210..96cd5a22f58 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -609,7 +609,7 @@ static void do_lasso_select_armature__doSelectBone(void *userData, struct EditBo LassoSelectUserData *data = userData; bArmature *arm = data->vc->obedit->data; - if (EBONE_SELECTABLE(arm, ebone)) { + if (data->select ? EBONE_SELECTABLE(arm, ebone) : EBONE_VISIBLE(arm, ebone)) { bool is_point_done = false; int points_proj_tot = 0; @@ -1907,7 +1907,7 @@ static int do_armature_box_select(ViewContext *vc, rcti *rect, bool select, bool int index = buffer[(4 * a) + 3]; if (index != -1) { ebone = BLI_findlink(arm->edbo, index & ~(BONESEL_ANY)); - if ((ebone->flag & BONE_UNSELECTABLE) == 0) { + if ((select == false) || ((ebone->flag & BONE_UNSELECTABLE) == 0)) { if (index & BONESEL_TIP) { ebone->flag |= BONE_DONE; if (select) ebone->flag |= BONE_TIPSEL; @@ -1937,7 +1937,7 @@ static int do_armature_box_select(ViewContext *vc, rcti *rect, bool select, bool if (index != -1) { ebone = BLI_findlink(arm->edbo, index & ~(BONESEL_ANY)); if (index & BONESEL_BONE) { - if ((ebone->flag & BONE_UNSELECTABLE) == 0) { + if ((select == false) || ((ebone->flag & BONE_UNSELECTABLE) == 0)) { if (!(ebone->flag & BONE_DONE)) { if (select) ebone->flag |= (BONE_ROOTSEL | BONE_TIPSEL | BONE_SELECTED); @@ -1974,7 +1974,7 @@ static int do_object_pose_box_select(bContext *C, ViewContext *vc, rcti *rect, b if (bone_only) { CTX_DATA_BEGIN (C, bPoseChannel *, pchan, visible_pose_bones) { - if ((pchan->bone->flag & BONE_UNSELECTABLE) == 0) { + if ((select == false) || ((pchan->bone->flag & BONE_UNSELECTABLE) == 0)) { pchan->bone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL); } } @@ -2622,7 +2622,7 @@ static void do_circle_select_armature__doSelectBone(void *userData, struct EditB CircleSelectUserData *data = userData; bArmature *arm = data->vc->obedit->data; - if (EBONE_SELECTABLE(arm, ebone)) { + if (data->select ? EBONE_SELECTABLE(arm, ebone) : EBONE_VISIBLE(arm, ebone)) { bool is_point_done = false; int points_proj_tot = 0; -- cgit v1.2.3