diff options
author | Joshua Leung <aligorith@gmail.com> | 2010-02-08 14:00:43 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2010-02-08 14:00:43 +0300 |
commit | 2adf6c977fe2a08f35bacf227810639d25d5df9b (patch) | |
tree | 2ce82324096f3d11d0226e95fc498881a1ebf29d /source/blender/editors | |
parent | 5e9b5ddfc10c3ced34f09a0b066c1d6493e976a3 (diff) |
Bugfix: Toggle Select All behaviour in PoseMode was not correctly taking the active bone into account
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/armature/editarmature.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 496e9a0d4d7..b68bd88abac 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -5114,11 +5114,20 @@ static int pose_de_select_all_exec(bContext *C, wmOperator *op) int action = RNA_enum_get(op->ptr, "action"); if (action == SEL_TOGGLE) { - action = SEL_SELECT; - /* Determine if there are any selected bones and therefore whether we are selecting or deselecting */ - // NOTE: we have to check for > 1 not > 0, since there is almost always an active bone that can't be cleared... - if (CTX_DATA_COUNT(C, selected_pose_bones) > 1) + bPoseChannel *pchan= CTX_data_active_pose_bone(C); + int num_sel = CTX_DATA_COUNT(C, selected_pose_bones); + + /* cases for deselect: + * 1) there's only one bone selected, and that is the active one + * 2) there's more than one bone selected + */ + if ( ((num_sel == 1) && (pchan) && (pchan->bone->flag & BONE_SELECTED)) || + (num_sel > 1) ) + { action = SEL_DESELECT; + } + else + action = SEL_SELECT; } /* Set the flags */ |