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:
authorJoshua Leung <aligorith@gmail.com>2013-12-20 06:30:00 +0400
committerJoshua Leung <aligorith@gmail.com>2013-12-20 14:55:44 +0400
commit48b96805789958318938f9032ae89d1f947c2811 (patch)
treefbfce2304cdbfab68bbbefa4b8b56be84aa2ef55
parentf55eba54627359b8da6008a3bd6d5a8ca05fe977 (diff)
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.
-rw-r--r--source/blender/editors/animation/anim_channels_edit.c8
1 files changed, 6 insertions, 2 deletions
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);