From f033fa0fbcfb78fe08f8eb8ee7ca90eebce3df81 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Fri, 30 Aug 2019 11:57:47 +0200 Subject: GPencil: Set active layer when click in Dopesheet keyframe area Now, when clicking in the keys area, the layer is synchronized, not only in the left area with the names. This is one of the most requested feature by artists. Also, removed some old comments. Reviewers: brecht, angavrilov Reviewed By: brecht Subscribers: pepeland, mendio Differential Revision: https://developer.blender.org/D5627 --- source/blender/editors/space_action/action_select.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/space_action/action_select.c') diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index 9e2634b183a..8504ab9f469 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -1717,22 +1717,25 @@ static void mouse_action_keys(bAnimContext *ac, /* Highlight GPencil Layer */ if (ale != NULL && ale->data != NULL && ale->type == ANIMTYPE_GPLAYER) { + bGPdata *gpd = (bGPdata *)ale->id; bGPDlayer *gpl = ale->data; gpl->flag |= GP_LAYER_SELECT; - // gpencil_layer_setactive(gpd, gpl); + /* Update other layer status. */ + if (BKE_gpencil_layer_getactive(gpd) != gpl) { + BKE_gpencil_layer_setactive(gpd, gpl); + WM_main_add_notifier(NC_GPENCIL | ND_DATA | NA_EDITED, NULL); + } } } else if (ac->datatype == ANIMCONT_MASK) { /* deselect all other channels first */ ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR); - /* Highlight GPencil Layer */ if (ale != NULL && ale->data != NULL && ale->type == ANIMTYPE_MASKLAYER) { MaskLayer *masklay = ale->data; masklay->flag |= MASK_LAYERFLAG_SELECT; - // gpencil_layer_setactive(gpd, gpl); } } } -- cgit v1.2.3