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>2010-09-16 10:28:11 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-09-16 10:28:11 +0400
commit4a840db7e9987c3b8f09c0f1fbc7abd7e1a12e38 (patch)
treefeb4f72ab4e1ed23d23abf8c7da541681bf73170 /source/blender/editors/armature
parent26b41bd0b527b91374c1884dd1d541fabc3f04b3 (diff)
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.
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r--source/blender/editors/armature/editarmature.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index 97530dee978..f2bc4b3d46a 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -178,19 +178,33 @@ EditBone *make_boneList(ListBase *edbo, ListBase *bones, EditBone *parent, Bone
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);