[Bf-blender-cvs] [3f00d9b8b8b] greasepencil-object: Add new data_size new parameter and avoid error with null gp
Antonio Vazquez
noreply at git.blender.org
Wed Apr 12 20:16:29 CEST 2017
Commit: 3f00d9b8b8b16e1e197ab13aaaaf9c852627900a
Author: Antonio Vazquez
Date: Wed Apr 12 20:15:34 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB3f00d9b8b8b16e1e197ab13aaaaf9c852627900a
Add new data_size new parameter and avoid error with null gp
===================================================================
M source/blender/draw/engines/gpencil/gpencil_mode.c
===================================================================
diff --git a/source/blender/draw/engines/gpencil/gpencil_mode.c b/source/blender/draw/engines/gpencil/gpencil_mode.c
index 5a590685e48..4b8d272bd10 100644
--- a/source/blender/draw/engines/gpencil/gpencil_mode.c
+++ b/source/blender/draw/engines/gpencil/gpencil_mode.c
@@ -297,18 +297,23 @@ static void GPENCIL_draw_scene(void *vedata)
{
GPENCIL_PassList *psl = ((GPENCIL_Data *)vedata)->psl;
GPENCIL_FramebufferList *fbl = ((GPENCIL_Data *)vedata)->fbl;
+ GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
/* Default framebuffer and texture */
DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get();
DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
UNUSED_VARS(fbl, dfbl, dtxl);
-
- DRW_draw_pass(psl->pass);
+ if (stl->storage->pal_id > 0) {
+ DRW_draw_pass(psl->pass);
+ }
}
+static const DrawEngineDataSize GPENCIL_data_size = DRW_VIEWPORT_DATA_SIZE(GPENCIL_Data);
+
DrawEngineType draw_engine_gpencil_type = {
NULL, NULL,
N_("GpencilMode"),
+ &GPENCIL_data_size,
&GPENCIL_engine_init,
&GPENCIL_engine_free,
&GPENCIL_cache_init,
More information about the Bf-blender-cvs
mailing list