Commit: 2ee74e94aaf24489cee77f151931398e85976d2f
Author: Antonio Vazquez
Date:   Thu Jun 1 15:46:40 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB2ee74e94aaf24489cee77f151931398e85976d2f

Fix error for ghost icon in palette

THe ghost icon was not working with new draw manager because the check was not 
migrated.

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

M       source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
M       source/blender/draw/engines/gpencil/gpencil_engine.h
M       source/blender/draw/engines/gpencil/gpencil_geom.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 f3a07f6bcf8..8c7e9bcf26b 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -455,7 +455,7 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache, 
GPENCIL_e_data *e_dat
 
        for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
                /* check if stroke can be drawn */
-               if (gpencil_can_draw_stroke(rv3d, gpf, gps) == false) {
+               if (gpencil_can_draw_stroke(rv3d, gpf, gps, onion) == false) {
                        continue;
                }
                /* limit the number of shading groups */
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h 
b/source/blender/draw/engines/gpencil/gpencil_engine.h
index cd173262ff8..09b56ddbe53 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.h
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.h
@@ -147,7 +147,7 @@ struct Batch *DRW_gpencil_get_buffer_point_geom(struct 
bGPdata *gpd, short thick
 
 void gpencil_batch_cache_clear(struct bGPdata *gpd);
 
-bool gpencil_can_draw_stroke(struct RegionView3D *rv3d, const struct bGPDframe 
*gpf, const struct bGPDstroke *gps);
+bool gpencil_can_draw_stroke(struct RegionView3D *rv3d, const struct bGPDframe 
*gpf, const struct bGPDstroke *gps, const bool onion);
 
 struct tGPencilObjectCache *gpencil_object_cache_allocate(struct 
tGPencilObjectCache *cache, int *gp_cache_size, int *gp_cache_used);
 void gpencil_object_cache_add(struct tGPencilObjectCache *cache, struct 
RegionView3D *rv3d, struct Object *ob, int *gp_cache_used);
diff --git a/source/blender/draw/engines/gpencil/gpencil_geom.c 
b/source/blender/draw/engines/gpencil/gpencil_geom.c
index 2ea30e3d77d..0c90d6f9569 100644
--- a/source/blender/draw/engines/gpencil/gpencil_geom.c
+++ b/source/blender/draw/engines/gpencil/gpencil_geom.c
@@ -364,7 +364,7 @@ Batch *DRW_gpencil_get_buffer_fill_geom(const tGPspoint 
*points, int totpoints,
 
 
 /* Helper for doing all the checks on whether a stroke can be drawn */
-bool gpencil_can_draw_stroke(RegionView3D *UNUSED(rv3d), const bGPDframe 
*UNUSED(gpf), const bGPDstroke *gps)
+bool gpencil_can_draw_stroke(RegionView3D *UNUSED(rv3d), const bGPDframe 
*UNUSED(gpf), const bGPDstroke *gps, const bool onion)
 {
        /* skip stroke if it doesn't have any valid data */
        if ((gps->points == NULL) || (gps->totpoints < 1))
@@ -373,7 +373,8 @@ bool gpencil_can_draw_stroke(RegionView3D *UNUSED(rv3d), 
const bGPDframe *UNUSED
        /* check if the color is visible */
        PaletteColor *palcolor = gps->palcolor;
        if ((palcolor == NULL) ||
-               (palcolor->flag & PC_COLOR_HIDE))
+               (palcolor->flag & PC_COLOR_HIDE) ||
+               (onion && (palcolor->flag & PC_COLOR_ONIONSKIN)))
        {
                return false;
        }

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

Reply via email to