diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c index 5dd1cb50405..aa033dd36e0 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.c +++ b/source/blender/draw/engines/gpencil/gpencil_engine.c @@ -42,6 +42,8 @@ #include "gpencil_engine.h" +#include "DEG_depsgraph_query.h" + #include "ED_screen.h" #include "ED_gpencil.h" @@ -381,9 +383,11 @@ void GPENCIL_cache_init(void *vedata) (obact_gpd->flag & GP_DATA_STROKE_PAINTMODE) && (stl->storage->is_playing == false)) { - if (((obact_gpd->runtime.sbuffer_sflag & GP_STROKE_ERASER) == 0) && - (obact_gpd->runtime.sbuffer_size > 0) && - ((obact_gpd->flag & GP_DATA_STROKE_POLYGON) == 0)) + /* need the original to avoid cow overhead while drawing */ + bGPdata *gpd_orig = (bGPdata *)DEG_get_original_id(&obact_gpd->id); + if (((gpd_orig->runtime.sbuffer_sflag & GP_STROKE_ERASER) == 0) && + (gpd_orig->runtime.sbuffer_size > 0) && + ((gpd_orig->flag & GP_DATA_STROKE_POLYGON) == 0)) { stl->g_data->session_flag |= GP_DRW_PAINT_PAINTING; }