[Bf-blender-cvs] [afe954e] master: Fix T48839: Selection from pose mode gives wrong snap results

Campbell Barton noreply at git.blender.org
Wed Jul 13 14:24:53 CEST 2016


Commit: afe954e64c4999c7aacefc68035b97d483574953
Author: Campbell Barton
Date:   Wed Jul 13 22:22:37 2016 +1000
Branches: master
https://developer.blender.org/rBafe954e64c4999c7aacefc68035b97d483574953

Fix T48839: Selection from pose mode gives wrong snap results

Current code changes the selection then then runs ED_armature_sync_selection
to copy to the bones rootsel flag from the parents tipsel.

Use this logic for entering edit-mode too.

===================================================================

M	source/blender/editors/armature/armature_utils.c

===================================================================

diff --git a/source/blender/editors/armature/armature_utils.c b/source/blender/editors/armature/armature_utils.c
index 6306926..6979a32 100644
--- a/source/blender/editors/armature/armature_utils.c
+++ b/source/blender/editors/armature/armature_utils.c
@@ -424,7 +424,9 @@ EditBone *make_boneList(ListBase *edbo, ListBase *bones, EditBone *parent, Bone
 	for (curBone = bones->first; curBone; curBone = curBone->next) {
 		eBone = MEM_callocN(sizeof(EditBone), "make_editbone");
 		
-		/*	Copy relevant data from bone to eBone */
+		/* Copy relevant data from bone to eBone
+		 * Keep selection logic in sync with ED_armature_sync_selection.
+		 */
 		eBone->parent = parent;
 		BLI_strncpy(eBone->name, curBone->name, sizeof(eBone->name));
 		eBone->flag = curBone->flag;
@@ -435,11 +437,11 @@ EditBone *make_boneList(ListBase *edbo, ListBase *bones, EditBone *parent, Bone
 			eBone->flag |= BONE_TIPSEL;
 			if (eBone->parent && (eBone->flag & BONE_CONNECTED)) {
 				eBone->parent->flag |= BONE_TIPSEL;
-				eBone->flag &= ~BONE_ROOTSEL; /* this is ignored when there is a connected parent, so unset it */
-			}
-			else {
-				eBone->flag |= BONE_ROOTSEL;
 			}
+
+			/* For connected bones, take care when changing the selection when we have a connected parent,
+			 * this flag is a copy of '(eBone->parent->flag & BONE_TIPSEL)'. */
+			eBone->flag |= BONE_ROOTSEL;
 		}
 		else {
 			/* if the bone is not selected, but connected to its parent




More information about the Bf-blender-cvs mailing list