[Bf-blender-cvs] [bafd64cbd9a] greasepencil-object: Draw solid area while drawing for non solid colors
Antonio Vazquez
noreply at git.blender.org
Thu Apr 27 19:04:20 CEST 2017
Commit: bafd64cbd9ad0788ceb33b3854b1a1fe7783b939
Author: Antonio Vazquez
Date: Thu Apr 27 19:04:03 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rBbafd64cbd9ad0788ceb33b3854b1a1fe7783b939
Draw solid area while drawing for non solid colors
For these styles, the fill is simulated with a solid color that will be replaced when the stroke is completed
===================================================================
M source/blender/draw/engines/gpencil/gpencil_engine.c
===================================================================
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index cbf3b545948..1b196b4cef4 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -475,7 +475,11 @@ static void gpencil_draw_buffer_strokes(void *vedata, ToolSettings *ts, bGPdata
struct Batch *drawing_stroke_geom = gpencil_get_buffer_stroke_geom(gpd, lthick);
DRW_shgroup_call_add(stl->g_data->shgrps_drawing_stroke, drawing_stroke_geom, matrix);
- if ((gpd->sbuffer_size >= 3) && (gpd->sfill[3] > GPENCIL_ALPHA_OPACITY_THRESH)) {
+ if ((gpd->sbuffer_size >= 3) && ((gpd->sfill[3] > GPENCIL_ALPHA_OPACITY_THRESH) || (gpd->bfill_style > 0))) {
+ /* if not solid, fill is simulated with solid color */
+ if (gpd->bfill_style > 0) {
+ gpd->sfill[3] = 0.5f;
+ }
struct Batch *drawing_fill_geom = gpencil_get_buffer_fill_geom(gpd->sbuffer, gpd->sbuffer_size, gpd->sfill);
DRW_shgroup_call_add(stl->g_data->shgrps_drawing_fill, drawing_fill_geom, matrix);
}
More information about the Bf-blender-cvs
mailing list