Commit: cd3ff68df3a4955561d6bf71606e518239b20b19
Author: Antonio Vazquez
Date:   Tue Aug 8 16:40:38 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rBcd3ff68df3a4955561d6bf71606e518239b20b19

Fix opacity modifier problem with 2.0 value

When the value is set to 2.0, the stroke opacity must be set to 1.0 to force a 
complete solid drawing.

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

M       source/blender/blenkernel/intern/gpencil_modifier.c

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

diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c 
b/source/blender/blenkernel/intern/gpencil_modifier.c
index 6b67b895bac..1c10833e404 100644
--- a/source/blender/blenkernel/intern/gpencil_modifier.c
+++ b/source/blender/blenkernel/intern/gpencil_modifier.c
@@ -466,16 +466,18 @@ void BKE_gpencil_opacity_modifier(int UNUSED(id), 
GpencilOpacityModifierData *mm
        CLAMP(gps->palcolor->rgb[3], 0.0f, 1.0f);
        CLAMP(gps->palcolor->fill[3], 0.0f, 1.0f);
 
-       /* if opacity < 1.0, affect the strength of the stroke */
-       if (mmd->factor < 1.0f) {
+       /* if opacity < 1.0 or > 1.0, affect the strength of the stroke */
+       if ((mmd->factor < 1.0f) || (mmd->factor > 1.0f)) {
                for (int i = 0; i < gps->totpoints; ++i) {
                        pt = &gps->points[i];
                        /* verify vertex group */
                        weight = is_point_affected_by_modifier(pt, 
(int)(!(mmd->flag & GP_OPACITY_INVERSE_VGROUP) == 0), vindex);
                        if (weight < 0) {
-                               continue;
+                               pt->strength += mmd->factor - 1.0f;
+                       }
+                       else {
+                               pt->strength += ((mmd->factor * weight) - 1.0f);
                        }
-                       pt->strength += ((mmd->factor * weight) - 1.0f);
                        CLAMP(pt->strength, 0.0f, 1.0f);
                }
        }

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

Reply via email to