[Bf-blender-cvs] [c0432d5edb2] master: Fix T94089: GPencil Drawing don't Update after paste in Dopesheet

Antonio Vazquez noreply at git.blender.org
Fri Jan 14 13:51:38 CET 2022


Commit: c0432d5edb23e1c6b70862895efa0599c47ec301
Author: Antonio Vazquez
Date:   Fri Jan 14 13:51:30 2022 +0100
Branches: master
https://developer.blender.org/rBc0432d5edb23e1c6b70862895efa0599c47ec301

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.

===================================================================

M	source/blender/editors/gpencil/editaction_gpencil.c
M	source/blender/editors/space_action/action_edit.c

===================================================================

diff --git a/source/blender/editors/gpencil/editaction_gpencil.c b/source/blender/editors/gpencil/editaction_gpencil.c
index d250f3c44a2..e1907dd1514 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
@@ -481,6 +483,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 f68446b1cae..184d715a347 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -642,6 +642,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);



More information about the Bf-blender-cvs mailing list