[Bf-blender-cvs] [cd0f974ce3f] greasepencil-object: Fix segment fault when play with onion

Antonio Vazquez noreply at git.blender.org
Tue Dec 19 16:47:50 CET 2017


Commit: cd0f974ce3f72005fce028cd3ec1a52a9f0749a3
Author: Antonio Vazquez
Date:   Tue Dec 19 16:47:41 2017 +0100
Branches: greasepencil-object
https://developer.blender.org/rBcd0f974ce3f72005fce028cd3ec1a52a9f0749a3

Fix segment fault when play with onion

For some reason, when press play there is a delay in the animation flag check and this produces errors. To be sure, we set cache as dirty because the frame is changing.

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

M	source/blender/draw/engines/gpencil/gpencil_engine.c

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index dbed641863b..aed5dce4b76 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -308,6 +308,13 @@ static void GPENCIL_cache_init(void *vedata)
 		ob = draw_ctx->obact;
 		if ((ob) && (ob->type == OB_GPENCIL)) {
 			gpd = ob->data;
+			/* for some reason, when press play there is a delay in the animation flag check
+			* and this produces errors. To be sure, we set cache as dirty because the frame
+			* is changing.
+			*/
+			if (stl->storage->playing == 1) {
+				gpd->flag |= GP_DATA_CACHE_IS_DIRTY;
+			}
 		}
 		bGPDpaletteref *palslot = BKE_gpencil_paletteslot_get_active(gpd);
 		PaletteColor *palcolor = BKE_palette_color_get_active((palslot) ? palslot->palette : NULL);



More information about the Bf-blender-cvs mailing list