[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31959] trunk/blender/source/blender/ editors/armature/editarmature.c: armature selection when entering editmode wasnt working well (in 2.4x too)

Campbell Barton ideasman42 at gmail.com
Thu Sep 16 08:28:11 CEST 2010


Revision: 31959
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31959
Author:   campbellbarton
Date:     2010-09-16 08:28:11 +0200 (Thu, 16 Sep 2010)

Log Message:
-----------
armature selection when entering editmode wasnt working well (in 2.4x too)
root bone selections were cleared if there was no connected parent. Now only set the root selection state if there is a connected parent.

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

Modified: trunk/blender/source/blender/editors/armature/editarmature.c
===================================================================
--- trunk/blender/source/blender/editors/armature/editarmature.c	2010-09-16 06:04:47 UTC (rev 31958)
+++ trunk/blender/source/blender/editors/armature/editarmature.c	2010-09-16 06:28:11 UTC (rev 31959)
@@ -178,19 +178,33 @@
 		eBone->flag = curBone->flag;
 		
 		/* fix selection flags */
+
 		if (eBone->flag & BONE_SELECTED) {
+			/* if the bone is selected the copy its root selection to the parents tip */
 			eBone->flag |= BONE_TIPSEL;
-			if (eBone->parent && (eBone->flag & BONE_CONNECTED))
+			if (eBone->parent && (eBone->flag & BONE_CONNECTED)) {
 				eBone->parent->flag |= BONE_TIPSEL;
-			else 
+				eBone->flag &= ~BONE_ROOTSEL; /* this is ignored when there is a connected parent, so unset it */
+			}
+			else {
 				eBone->flag |= BONE_ROOTSEL;
+			}
 		}
 		else {
-			/* selecting with the mouse gives this behavior */
-			if(eBone->parent && (eBone->flag & BONE_CONNECTED) && (eBone->parent->flag & BONE_SELECTED))
-				eBone->flag |= BONE_ROOTSEL;
-			else
-				eBone->flag &= ~BONE_ROOTSEL;
+			/* if the bone is not selected, but connected to its parent
+			 *  copy the parents tip selection state */
+			if(eBone->parent &&  (eBone->flag & BONE_CONNECTED)) {
+				/* selecting with the mouse gives this behavior */
+				if(eBone->parent->flag & BONE_TIPSEL) {
+					eBone->flag |= BONE_ROOTSEL;
+				}
+				else {
+					eBone->flag &= ~BONE_ROOTSEL;
+				}
+
+				/* probably not selected but just incase */
+				eBone->flag &= ~BONE_TIPSEL;
+			}
 		}
 
 		copy_v3_v3(eBone->head, curBone->arm_head);





More information about the Bf-blender-cvs mailing list