[Bf-blender-cvs] [11dc55f3c6b] greasepencil-object: Fix segment Fault in Onion Skin after play

Antonio Vazquez noreply at git.blender.org
Mon Sep 11 16:17:11 CEST 2017


Commit: 11dc55f3c6b25e6118374495ad6d5b4c76dff76b
Author: Antonio Vazquez
Date:   Mon Sep 11 16:16:55 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB11dc55f3c6b25e6118374495ad6d5b4c76dff76b

Fix segment Fault in Onion Skin after play

Sometimes, after run animation or change the frame , the drawing cache was not set as invalid and produced a segment fault.

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

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

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index bf1c526919e..9585f123c4f 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -898,7 +898,6 @@ static void gpencil_draw_onionskins(GpencilBatchCache *cache, GPENCIL_e_data *e_
 		color[3] += gpl->onion_factor - 0.5f;
 
 		CLAMP(color[3], 0.3f, 1.0f);
-		cache->is_dirty = true;
 		gpencil_draw_onion_strokes(cache, e_data, vedata, ob, gpd, gpl, gf, color, gpl->flag & GP_LAYER_GHOST_PREVCOL);
 	}
 	/* -------------------------------
@@ -954,7 +953,6 @@ static void gpencil_draw_onionskins(GpencilBatchCache *cache, GPENCIL_e_data *e_
 		color[3] += gpl->onion_factor - 0.5f;
 
 		CLAMP(color[3], 0.3f, 1.0f);
-		cache->is_dirty = true;
 		gpencil_draw_onion_strokes(cache, e_data, vedata, ob, gpd, gpl, gf, color, gpl->flag & GP_LAYER_GHOST_NEXTCOL);
 	}
 }
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index 3d28034929f..d6dbf05cbfe 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -231,13 +231,11 @@ static void GPENCIL_cache_init(void *vedata)
 		if (draw_ctx->evil_C) {
 			if (ED_screen_animation_playing(CTX_wm_manager(draw_ctx->evil_C))) {
 				stl->storage->playing = 1;
+				BKE_gpencil_batch_cache_alldirty();
 			}
 			else {
-				/* if animation was active and simplify on play was enabled, cache is dirty */
-				if ((oldsts == 1) && (stl->storage->playing == 0) && 
-					(ts->gpencil_simplify & GP_TOOL_FLAG_SIMPLIFY) && 
-					(ts->gpencil_simplify & GP_TOOL_FLAG_SIMPLIFY_ON_PLAY)) 
-				{
+				/* if change animation status, cache is dirty */
+				if (oldsts != stl->storage->playing) {
 					BKE_gpencil_batch_cache_alldirty();
 				}
 			}



More information about the Bf-blender-cvs mailing list