Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-03-02 19:34:47 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-03-02 19:34:47 +0400
commit723e231ce0c92d72bb959096613e901ea781d84a (patch)
tree75fea604d961444f0b1223422596a58a840f1dbc /source/blender/editors
parentd17a8639e411a217c08e3ff1a93037c9350d5ec6 (diff)
fix [#34486] Selection of bones in armature edit mode only toggles between two bones
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/armature/armature_select.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c
index 87eea4780bb..b7a436cc209 100644
--- a/source/blender/editors/armature/armature_select.c
+++ b/source/blender/editors/armature/armature_select.c
@@ -260,6 +260,9 @@ void ARMATURE_OT_select_linked(wmOperatorType *ot)
static EditBone *get_nearest_editbonepoint(ViewContext *vc, const int mval[2],
ListBase *edbo, int findunsel, int *selmask)
{
+ bArmature *arm = (bArmature *)vc->obedit->data;
+ EditBone *ebone_next_act = arm->act_edbone;
+
EditBone *ebone;
rcti rect;
unsigned int buffer[MAXPICKBUF];
@@ -269,6 +272,18 @@ static EditBone *get_nearest_editbonepoint(ViewContext *vc, const int mval[2],
glInitNames();
+ /* find the bone after the current active bone, so as to bump up its chances in selection.
+ * this way overlapping bones will cycle selection state as with objects. */
+ if (ebone_next_act &&
+ EBONE_VISIBLE(arm, ebone_next_act) &&
+ ebone_next_act->flag & (BONE_SELECTED | BONE_ROOTSEL | BONE_TIPSEL))
+ {
+ ebone_next_act = ebone_next_act->next ? ebone_next_act->next : arm->edbo->first;
+ }
+ else {
+ ebone_next_act = NULL;
+ }
+
rect.xmin = mval[0] - 5;
rect.xmax = mval[0] + 5;
rect.ymin = mval[1] - 5;
@@ -320,6 +335,11 @@ static EditBone *get_nearest_editbonepoint(ViewContext *vc, const int mval[2],
}
else dep = 3;
}
+
+ if (ebone == ebone_next_act) {
+ dep -= 1;
+ }
+
if (dep < mindep) {
mindep = dep;
besthitresult = hitresult;