[Bf-blender-cvs] [d4744d120e4] greasepencil-object: Fix T74477: Onion opacity not working
Antonio Vazquez
noreply at git.blender.org
Sat Mar 7 11:13:07 CET 2020
Commit: d4744d120e407f0e60dfa601063401dcbe254f75
Author: Antonio Vazquez
Date: Sat Mar 7 11:12:33 2020 +0100
Branches: greasepencil-object
https://developer.blender.org/rBd4744d120e407f0e60dfa601063401dcbe254f75
Fix T74477: Onion opacity not working
Also adjust the low limit when opacity is > 0. This allows to see all frames when the opacity is very low.
===================================================================
M source/blender/draw/engines/gpencil/gpencil_cache_utils.c
===================================================================
diff --git a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
index 9ae273adcd0..743171b09fb 100644
--- a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
@@ -219,8 +219,9 @@ static void gpencil_layer_final_tint_and_alpha_get(const GPENCIL_PrivateData *pd
copy_v4_fl4(r_tint, UNPACK3(onion_col_custom), 1.0f);
*r_alpha = use_onion_fade ? (1.0f / abs(gpf->runtime.onion_id)) : 0.5f;
- *r_alpha += (gpd->onion_factor * 2.0f - 1.0f);
- *r_alpha = clamp_f(*r_alpha, 0.01f, 1.0f);
+ *r_alpha *= gpd->onion_factor;
+ *r_alpha = (gpd->onion_factor > 0.0f) ? clamp_f(*r_alpha, 0.1f, 1.0f) :
+ clamp_f(*r_alpha, 0.01f, 1.0f);
}
else {
copy_v4_v4(r_tint, gpl->tintcolor);
More information about the Bf-blender-cvs
mailing list