Commit: e4ef59a6a38c4be32c0e2e780006123651f85962
Author: Antonio Vazquez
Date:   Thu Jun 1 10:20:29 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rBe4ef59a6a38c4be32c0e2e780006123651f85962

Fix error when drawing in an empty frame

If drawing new stroke in an empty frame, but the layer had previous frames, the 
cache must be set as dirty to avoid segment fault.

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

M       source/blender/editors/gpencil/gpencil_paint.c

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

diff --git a/source/blender/editors/gpencil/gpencil_paint.c 
b/source/blender/editors/gpencil/gpencil_paint.c
index 233645b2e29..fdf7b2fc95c 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1632,6 +1632,8 @@ static void gp_paint_initstroke(tGPsdata *p, 
eGPencil_PaintModes paintmode)
                        add_frame_mode = GP_GETFRAME_ADD_NEW;
                        
                p->gpf = BKE_gpencil_layer_getframe(p->gpl, CFRA, 
add_frame_mode);
+               /* set as dirty draw manager cache */
+               BKE_gpencil_batch_cache_dirty(p->gpd, 0);
                
                if (p->gpf == NULL) {
                        p->status = GP_STATUS_ERROR;

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to