From b1ce4ca40c03ab2562863ef8056adc3b2aff5c10 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Fri, 19 Jun 2020 10:09:51 +0200 Subject: Fix T77997: GPencil insert keyframe on timeline doen't update viewport The reason was the datablock is changed but it was not tagged for depsgraph refresh. In some cases it could be possible to tag several times the same datablock, but as this is not the case all the times and the number of tags is always very small, it doesn't worth a complex code to keep a memory list of the datablocks to tag. --- source/blender/blenkernel/intern/gpencil.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/blender/blenkernel/intern/gpencil.c') diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index b460e6d6dc0..4f1ede432ea 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -289,6 +289,16 @@ void BKE_gpencil_eval_delete(bGPdata *gpd_eval) MEM_freeN(gpd_eval); } +/** + * Tag datablock for depsgraph update. + * Wrapper to avoid include Depsgraph tag functions in other modules. + * \param gpd Grease pencil datablock + */ +void BKE_gpencil_tag(bGPdata *gpd) +{ + DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); +} + /* ************************************************** */ /* Container Creation */ -- cgit v1.2.3