[Bf-blender-cvs] [e38b5adc4fd] greasepencil-object: Change minimum alpha value for Onion

Antonio Vazquez noreply at git.blender.org
Fri Jan 26 16:07:38 CET 2018


Commit: e38b5adc4fd56673fb1318454d103cd45c3d6155
Author: Antonio Vazquez
Date:   Fri Jan 26 16:07:29 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rBe38b5adc4fd56673fb1318454d103cd45c3d6155

Change minimum alpha value for Onion

Sometimes is necessary to make transprarent and before it was not possible using opacity slider.

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

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 96e34a9b7e7..c3705c5e317 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -886,6 +886,8 @@ static void gpencil_draw_onionskins(
         GpencilBatchCache *cache, GPENCIL_e_data *e_data, void *vedata,
         Object *ob, bGPdata *gpd, bGPDlayer *gpl, bGPDframe *gpf)
 {
+	#define MIN_ALPHA_VALUE 0.01f
+
 	const float default_color[3] = { UNPACK3(U.gpencil_new_layer_col) };
 	const float alpha = 1.0f;
 	float color[4];
@@ -981,7 +983,7 @@ static void gpencil_draw_onionskins(
 			color[3] += gpd->onion_factor - 0.5f;
 		}
 
-		CLAMP(color[3], 0.3f, 1.0f);
+		CLAMP(color[3], MIN_ALPHA_VALUE, 1.0f);
 		gpencil_draw_onion_strokes(cache, e_data, vedata, ob, gpd, gpl, gf, color[3], color, colflag);
 	}
 	/* -------------------------------
@@ -1061,7 +1063,7 @@ static void gpencil_draw_onionskins(
 			color[3] += gpd->onion_factor - 0.5f;
 		}
 
-		CLAMP(color[3], 0.3f, 1.0f);
+		CLAMP(color[3], MIN_ALPHA_VALUE, 1.0f);
 		gpencil_draw_onion_strokes(cache, e_data, vedata, ob, gpd, gpl, gf, color[3], color, colflag);
 	}
 }



More information about the Bf-blender-cvs mailing list