From 48b96805789958318938f9032ae89d1f947c2811 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 20 Dec 2013 15:30:00 +1300 Subject: Fix T37883: Dope Sheet - Selecting object channels in AnimEditors doesn't make them active There was probably a reason in the past why this wasn't desirable, but since we allow bones to be properly selected when clicking on corresponding channels here, we may as well allow this case too. --- source/blender/editors/animation/anim_channels_edit.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (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 861998c15f3..338ee646b03 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -60,6 +60,7 @@ #include "ED_anim_api.h" #include "ED_armature.h" #include "ED_keyframes_edit.h" // XXX move the select modes out of there! +#include "ED_object.h" #include "ED_screen.h" #include "WM_api.h" @@ -2308,7 +2309,7 @@ static void ANIM_OT_channels_rename(wmOperatorType *ot) /* ******************** Mouse-Click Operator *********************** */ /* Handle selection changes due to clicking on channels. Settings will get caught by UI code... */ -static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_index, short selectmode) +static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index, short selectmode) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; @@ -2394,6 +2395,9 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in if (adt) adt->flag |= ADT_UI_SELECTED; } + /* change active object - regardless of whether it is now selected [T37883] */ + ED_base_object_activate(C, base); /* adds notifier */ + if ((adt) && (adt->flag & ADT_UI_SELECTED)) adt->flag |= ADT_UI_ACTIVE; @@ -2662,7 +2666,7 @@ static int animchannels_mouseclick_invoke(bContext *C, wmOperator *op, const wmE UI_view2d_listview_view_to_cell(v2d, ACHANNEL_NAMEWIDTH, ACHANNEL_STEP, 0, (float)ACHANNEL_HEIGHT_HALF, x, y, NULL, &channel_index); /* handle mouse-click in the relevant channel then */ - notifierFlags = mouse_anim_channels(&ac, x, channel_index, selectmode); + notifierFlags = mouse_anim_channels(C, &ac, channel_index, selectmode); /* set notifier that things have changed */ WM_event_add_notifier(C, NC_ANIMATION | notifierFlags, NULL); -- cgit v1.2.3