Fix dope-sheet exiting edit-mode when activating an object

Regression from d8992192e5
The original code relied on having a separate edit-object pointer
than the active object.
This commit is contained in:
Campbell Barton 2021-01-22 16:00:31 +11:00
parent 1a30687c24
commit 141f17eaf4
1 changed files with 5 additions and 7 deletions

View File

@ -2988,18 +2988,16 @@ static int click_select_channel_object(bContext *C,
}
}
/* change active object - regardless of whether it is now selected [T37883] */
ED_object_base_activate(C, base); /* adds notifier */
/* Change active object - regardless of whether it is now selected, see: T37883.
*
* Ensure we exit edit-mode on whatever object was active before
* to avoid getting stuck there, see: T48747. */
ED_object_base_activate_with_mode_exit_if_needed(C, base); /* adds notifier */
if ((adt) && (adt->flag & ADT_UI_SELECTED)) {
adt->flag |= ADT_UI_ACTIVE;
}
/* Ensure we exit editmode on whatever object was active before
* to avoid getting stuck there - T48747. */
if (ob != CTX_data_edit_object(C)) {
ED_object_editmode_exit(C, EM_FREEDATA);
}
return (ND_ANIMCHAN | NA_SELECTED);
}