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:
Diffstat (limited to 'source/blender/editors/space_action/action_edit.c')
-rw-r--r--source/blender/editors/space_action/action_edit.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c
index b390e4b56d6..aa784800be0 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -800,10 +800,17 @@ static void insert_gpencil_keys(bAnimContext *ac, short mode)
add_frame_mode = GP_GETFRAME_ADD_NEW;
}
- /* insert gp frames */
+ /* Insert gp frames. */
+ bGPdata *gpd_old = NULL;
for (ale = anim_data.first; ale; ale = ale->next) {
+ bGPdata *gpd = (bGPdata *)ale->id;
bGPDlayer *gpl = (bGPDlayer *)ale->data;
BKE_gpencil_layer_frame_get(gpl, CFRA, add_frame_mode);
+ /* Check if the gpd changes to tag only once. */
+ if (gpd != gpd_old) {
+ BKE_gpencil_tag(gpd);
+ gpd_old = gpd;
+ }
}
ANIM_animdata_update(ac, &anim_data);
@@ -839,6 +846,9 @@ static int actkeys_insertkey_exec(bContext *C, wmOperator *op)
}
/* set notifier that keyframes have changed */
+ if (ac.datatype == ANIMCONT_GPENCIL) {
+ WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
+ }
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_ADDED, NULL);
return OPERATOR_FINISHED;
@@ -888,7 +898,7 @@ static void duplicate_action_keys(bAnimContext *ac)
duplicate_fcurve_keys((FCurve *)ale->key_data);
}
else if (ale->type == ANIMTYPE_GPLAYER) {
- ED_gplayer_frames_duplicate((bGPDlayer *)ale->data);
+ ED_gpencil_layer_frames_duplicate((bGPDlayer *)ale->data);
}
else if (ale->type == ANIMTYPE_MASKLAYER) {
ED_masklayer_frames_duplicate((MaskLayer *)ale->data);
@@ -964,7 +974,7 @@ static bool delete_action_keys(bAnimContext *ac)
bool changed = false;
if (ale->type == ANIMTYPE_GPLAYER) {
- changed = ED_gplayer_frames_delete((bGPDlayer *)ale->data);
+ changed = ED_gpencil_layer_frames_delete((bGPDlayer *)ale->data);
}
else if (ale->type == ANIMTYPE_MASKLAYER) {
changed = ED_masklayer_frames_delete((MaskLayer *)ale->data);
@@ -1539,7 +1549,7 @@ static void setkeytype_gpencil_keys(bAnimContext *ac, short mode)
/* loop through each layer */
for (ale = anim_data.first; ale; ale = ale->next) {
if (ale->type == ANIMTYPE_GPLAYER) {
- ED_gplayer_frames_keytype_set(ale->data, mode);
+ ED_gpencil_layer_frames_keytype_set(ale->data, mode);
ale->update |= ANIM_UPDATE_DEPS;
}
}
@@ -1740,7 +1750,7 @@ static void snap_action_keys(bAnimContext *ac, short mode)
AnimData *adt = ANIM_nla_mapping_get(ac, ale);
if (ale->type == ANIMTYPE_GPLAYER) {
- ED_gplayer_snap_frames(ale->data, ac->scene, mode);
+ ED_gpencil_layer_snap_frames(ale->data, ac->scene, mode);
}
else if (ale->type == ANIMTYPE_MASKLAYER) {
ED_masklayer_snap_frames(ale->data, ac->scene, mode);
@@ -1870,7 +1880,7 @@ static void mirror_action_keys(bAnimContext *ac, short mode)
AnimData *adt = ANIM_nla_mapping_get(ac, ale);
if (ale->type == ANIMTYPE_GPLAYER) {
- ED_gplayer_mirror_frames(ale->data, ac->scene, mode);
+ ED_gpencil_layer_mirror_frames(ale->data, ac->scene, mode);
}
else if (ale->type == ANIMTYPE_MASKLAYER) {
/* TODO */