[Bf-blender-cvs] [48b9680] master: Fix T37883: Dope Sheet - Selecting object channels in AnimEditors doesn't make them active

Joshua Leung noreply at git.blender.org
Fri Dec 20 11:56:39 CET 2013


Commit: 48b96805789958318938f9032ae89d1f947c2811
Author: Joshua Leung
Date:   Fri Dec 20 15:30:00 2013 +1300
http://developer.blender.org/rB48b96805789958318938f9032ae89d1f947c2811

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.

===================================================================

M	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 861998c..338ee64 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);




More information about the Bf-blender-cvs mailing list