diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2019-08-30 12:57:47 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2019-08-30 12:58:02 +0300 |
commit | f033fa0fbcfb78fe08f8eb8ee7ca90eebce3df81 (patch) | |
tree | 4b67dba7aa01d4b3e9457b411a79672ce1c23a53 /source/blender/editors/space_action | |
parent | e33b4572af45aac41ba6b7a59175972ff504daff (diff) |
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
Diffstat (limited to 'source/blender/editors/space_action')
-rw-r--r-- | source/blender/editors/space_action/action_select.c | 9 |
1 files changed, 6 insertions, 3 deletions
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); } } } |