[Bf-blender-cvs] [9b293649ed5] greasepencil-object: Fix line removed by error
Antonio Vazquez
noreply at git.blender.org
Mon Jul 17 13:41:01 CEST 2017
Commit: 9b293649ed5fdf1a660673c63bcd00b362a064e8
Author: Antonio Vazquez
Date: Mon Jul 17 13:38:51 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB9b293649ed5fdf1a660673c63bcd00b362a064e8
Fix line removed by error
The cache must be checked
===================================================================
M source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.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 a4ad83bc5df..dca090f1f73 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -519,12 +519,14 @@ static void gpencil_add_stroke_shgroup(GpencilBatchCache *cache, DRWShadingGroup
sthickness = gps->thickness + gpl->thickness;
CLAMP_MIN(sthickness, 1);
- gpencil_batch_cache_check_free_slots(gpd);
- if ((gps->totpoints > 1) && (gps->palcolor->stroke_style != STROKE_STYLE_VOLUMETRIC)) {
- cache->batch_stroke[cache->cache_idx] = DRW_gpencil_get_stroke_geom(gpf, gps, sthickness, ink);
- }
- else {
- cache->batch_stroke[cache->cache_idx] = DRW_gpencil_get_point_geom(gps, sthickness, ink);
+ if (cache->is_dirty) {
+ gpencil_batch_cache_check_free_slots(gpd);
+ if ((gps->totpoints > 1) && (gps->palcolor->stroke_style != STROKE_STYLE_VOLUMETRIC)) {
+ cache->batch_stroke[cache->cache_idx] = DRW_gpencil_get_stroke_geom(gpf, gps, sthickness, ink);
+ }
+ else {
+ cache->batch_stroke[cache->cache_idx] = DRW_gpencil_get_point_geom(gps, sthickness, ink);
+ }
}
DRW_shgroup_call_add(strokegrp, cache->batch_stroke[cache->cache_idx], gpf->viewmatrix);
}
More information about the Bf-blender-cvs
mailing list