[Bf-blender-cvs] [092f9ead204] greasepencil-object: GPencil: Apply opacity only to vertex with weights

Antonioya noreply at git.blender.org
Thu Jul 18 20:23:06 CEST 2019


Commit: 092f9ead204286ab6a804ea3ff25e625681280fb
Author: Antonioya
Date:   Thu Jul 18 20:22:54 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rB092f9ead204286ab6a804ea3ff25e625681280fb

GPencil: Apply opacity only to vertex with weights

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

M	source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c

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

diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c
index f11079b34df..a67567be3be 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c
@@ -113,7 +113,10 @@ static void deformStroke(GpencilModifierData *md,
         /* verify vertex group */
         const float weight = get_modifier_point_weight(
             dvert, (mmd->flag & GP_OPACITY_INVERT_VGROUP) != 0, def_nr);
-        if ((def_nr < 0) || (weight < 0.0f)) {
+        if (weight < 0.0f) {
+          continue;
+        }
+        if (def_nr < 0) {
           pt->strength += mmd->factor - 1.0f;
         }
         else {
@@ -132,7 +135,10 @@ static void deformStroke(GpencilModifierData *md,
       /* verify vertex group */
       float weight = get_modifier_point_weight(
           dvert, (mmd->flag & GP_OPACITY_INVERT_VGROUP) != 0, def_nr);
-      if ((def_nr < 0) || (weight < 0.0f)) {
+      if (weight < 0.0f) {
+        continue;
+      }
+      if (def_nr < 0) {
         pt->strength += mmd->factor - 1.0f;
       }
       else {



More information about the Bf-blender-cvs mailing list