Fix T75144 Grease Pencil: Python generated strokes flicker and crash

This was caused by a flag not being reset in time, causing discard of
batches already queued to be drawn.
This commit is contained in:
Clément Foucault 2020-03-30 18:37:48 +02:00
parent 100896e080
commit 2c9e27f209
Notes: blender-bot 2023-02-14 07:47:59 +01:00
Referenced by issue #75144, Grease Pencil: python generated strokes flicker and crash
1 changed files with 7 additions and 4 deletions

View File

@ -71,6 +71,13 @@ typedef struct GpencilBatchCache {
static bool gpencil_batch_cache_valid(GpencilBatchCache *cache, bGPdata *gpd, int cfra)
{
bool valid = true;
/* Needs to be first to consume the flag. */
if (gpd->flag & GP_DATA_PYTHON_UPDATED) {
gpd->flag &= ~GP_DATA_PYTHON_UPDATED;
valid = false;
}
if (cache == NULL) {
return false;
}
@ -82,10 +89,6 @@ static bool gpencil_batch_cache_valid(GpencilBatchCache *cache, bGPdata *gpd, in
else if (gpd->flag & GP_DATA_CACHE_IS_DIRTY) {
valid = false;
}
else if (gpd->flag & GP_DATA_PYTHON_UPDATED) {
gpd->flag &= ~GP_DATA_PYTHON_UPDATED;
valid = false;
}
else if (cache->is_dirty) {
valid = false;
}