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:
authorAntonio Vazquez <blendergit@gmail.com>2022-01-14 15:51:30 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2022-01-18 12:46:31 +0300
commit6ea0ecdc51cb826dbda7bd49d0ce11b87385cbe8 (patch)
tree6d3745c20097f159116226d8aa8591fc354bfbe3
parent05ca297596a8988fc4137017a9777a32ee04f48c (diff)
Fix T94089: GPencil Drawing don't Update after paste in Dopesheet
When paste new frames, the datablock need to be tagged to update the drawings.
-rw-r--r--source/blender/editors/gpencil/editaction_gpencil.c5
-rw-r--r--source/blender/editors/space_action/action_edit.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/editaction_gpencil.c b/source/blender/editors/gpencil/editaction_gpencil.c
index eb41961b66e..4369d3ce26f 100644
--- a/source/blender/editors/gpencil/editaction_gpencil.c
+++ b/source/blender/editors/gpencil/editaction_gpencil.c
@@ -46,6 +46,8 @@
#include "WM_api.h"
+#include "DEG_depsgraph.h"
+
/* ***************************************** */
/* NOTE ABOUT THIS FILE:
* This file contains code for editing Grease Pencil data in the Action Editor
@@ -499,6 +501,9 @@ bool ED_gpencil_anim_copybuf_paste(bAnimContext *ac, const short offset_mode)
/* unapply offset from buffer-frame */
gpfs->framenum -= offset;
}
+
+ /* Tag destination datablock. */
+ DEG_id_tag_update(ale->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
}
/* clean up */
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c
index 927e51a3e04..31b57ede43a 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -643,6 +643,10 @@ static int actkeys_paste_exec(bContext *C, wmOperator *op)
}
}
+ /* Grease Pencil needs extra update to refresh the added keyframes. */
+ if (ac.datatype == ANIMCONT_GPENCIL) {
+ WM_event_add_notifier(C, NC_GPENCIL | ND_DATA, NULL);
+ }
/* set notifier that keyframes have changed */
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);