[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54969] trunk/blender/source/blender/ editors/armature/armature_select.c: fix [#34486] Selection of bones in armature edit mode only toggles between two bones

Campbell Barton ideasman42 at gmail.com
Sat Mar 2 16:34:48 CET 2013


Revision: 54969
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54969
Author:   campbellbarton
Date:     2013-03-02 15:34:47 +0000 (Sat, 02 Mar 2013)
Log Message:
-----------
fix [#34486] Selection of bones in armature edit mode only toggles between two bones

Modified Paths:
--------------
    trunk/blender/source/blender/editors/armature/armature_select.c

Modified: trunk/blender/source/blender/editors/armature/armature_select.c
===================================================================
--- trunk/blender/source/blender/editors/armature/armature_select.c	2013-03-02 12:16:23 UTC (rev 54968)
+++ trunk/blender/source/blender/editors/armature/armature_select.c	2013-03-02 15:34:47 UTC (rev 54969)
@@ -260,6 +260,9 @@
 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 @@
 
 	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 @@
 						}
 						else dep = 3;
 					}
+
+					if (ebone == ebone_next_act) {
+						dep -= 1;
+					}
+
 					if (dep < mindep) {
 						mindep = dep;
 						besthitresult = hitresult;




More information about the Bf-blender-cvs mailing list