[Bf-blender-cvs] [8eff6c4223d] greasepencil-object: GP: Fix problem with Onion Skin after last commit
Antonioya
noreply at git.blender.org
Fri Oct 19 12:13:49 CEST 2018
Commit: 8eff6c4223d550e7f90ebc351ae2912ea33d66d1
Author: Antonioya
Date: Fri Oct 19 12:13:38 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB8eff6c4223d550e7f90ebc351ae2912ea33d66d1
GP: Fix problem with Onion Skin after last commit
===================================================================
M source/blender/draw/engines/gpencil/gpencil_cache_utils.c
M source/blender/draw/engines/gpencil/gpencil_draw_utils.c
===================================================================
diff --git a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
index ffc121e06aa..9d8c4b6d0f8 100644
--- a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
@@ -357,7 +357,10 @@ void DRW_gpencil_freecache(struct Object *ob)
if ((ob) && (ob->type == OB_GPENCIL)) {
gpencil_batch_cache_clear(ob->runtime.gpencil_cache);
MEM_SAFE_FREE(ob->runtime.gpencil_cache);
+ bGPdata *gpd = (bGPdata *)ob->data;
+ if (gpd) {
+ gpd->flag |= GP_DATA_CACHE_IS_DIRTY;
+ }
}
-
}
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index a4b2d2b99cc..6d15c8145e1 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -1320,12 +1320,11 @@ void DRW_gpencil_populate_datablock(
/* draw onion skins */
if (!ID_IS_LINKED(&gpd->id)) {
- ID *orig_id = gpd->id.orig_id;
- if ((orig_id) && (!cache_ob->is_dup_data) &&
+ if ((!cache_ob->is_dup_data) &&
(gpd->flag & GP_DATA_SHOW_ONIONSKINS) &&
(do_onion) && (gpl->onion_flag & GP_LAYER_ONIONSKIN) &&
((!playing) || (gpd->onion_flag & GP_ONION_GHOST_ALWAYS)) &&
- (!cache_ob->is_dup_ob) && (orig_id->us <= 1))
+ (!cache_ob->is_dup_ob) && (gpd->id.us <= 1))
{
if (((!stl->storage->is_render) && (overlay)) ||
((stl->storage->is_render) && (gpd->onion_flag & GP_ONION_GHOST_ALWAYS)))
More information about the Bf-blender-cvs
mailing list