From 4ff3ec835e321747880456e33cce261422bc05a7 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 22 Feb 2014 00:51:37 +1300 Subject: Fix T38737: Box select channels in dope sheet doesn't select corresponding bones in rig --- .../blender/editors/animation/anim_channels_edit.c | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'source/blender/editors/animation/anim_channels_edit.c') diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index efd057d4e76..ee8b5dcee67 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -2121,6 +2121,32 @@ static void borderselect_anim_channels(bAnimContext *ac, rcti *rect, short selec { bActionGroup *agrp = (bActionGroup *)ale->data; + /* Armatures-Specific Feature: + * See mouse_anim_channels() -> ANIMTYPE_GROUP case for more details (T38737) + */ + if ((ac->ads->filterflag & ADS_FILTER_ONLYSEL) == 0) { + if ((ale->id) && (GS(ale->id->name) == ID_OB)) { + Object *ob = (Object *)ale->id; + + if (ob->type == OB_ARMATURE) { + /* Assume for now that any group with corresponding name is what we want + * (i.e. for an armature whose location is animated, things would break + * if the user were to add a bone named "Location"). + * + * TODO: check the first F-Curve or so to be sure... + */ + bPoseChannel *pchan = BKE_pose_channel_find_name(ob->pose, agrp->name); + + if (agrp->flag & AGRP_SELECTED) { + ED_pose_bone_select(ob, pchan, true); + } + else { + ED_pose_bone_select(ob, pchan, false); + } + } + } + } + /* always clear active flag after doing this */ agrp->flag &= ~AGRP_ACTIVE; break; -- cgit v1.2.3