[Bf-blender-cvs] [3557fa69638] temp-lineart-contained: LineArt: Remove BINARY_WEIGHTS option.

YimingWu noreply at git.blender.org
Fri Mar 26 12:08:44 CET 2021


Commit: 3557fa69638d69e824dc63130d53f229e3912556
Author: YimingWu
Date:   Fri Mar 26 19:08:10 2021 +0800
Branches: temp-lineart-contained
https://developer.blender.org/rB3557fa69638d69e824dc63130d53f229e3912556

LineArt: Remove BINARY_WEIGHTS option.

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

M	source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
M	source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
M	source/blender/makesdna/DNA_gpencil_modifier_defaults.h
M	source/blender/makesdna/DNA_gpencil_modifier_types.h
M	source/blender/makesrna/intern/rna_gpencil_modifier.c

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

diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
index 35de9f45ba6..ff30d74c784 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
@@ -408,8 +408,6 @@ static void vgroup_panel_draw(const bContext *UNUSED(C), Panel *panel)
     uiItemPointerR(
         col, ptr, "vertex_group", &ob_ptr, "vertex_groups", IFACE_("Target"), ICON_NONE);
   }
-
-  uiItemR(col, ptr, "use_soft_selection", 0, NULL, ICON_NONE);
 }
 
 static void baking_panel_draw(const bContext *UNUSED(C), Panel *panel)
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index 980a148c11b..58cb57cc4c9 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -3923,7 +3923,6 @@ static void lineart_gpencil_generate(LineartRenderBuffer *rb,
   int enabled_types = lineart_rb_edge_types(rb);
   bool invert_input = modifier_flags & LRT_GPENCIL_INVERT_SOURCE_VGROUP;
   bool match_output = modifier_flags & LRT_GPENCIL_MATCH_OUTPUT_VGROUP;
-  bool preserve_weight = modifier_flags & LRT_GPENCIL_SOFT_SELECTION;
 
   LISTBASE_FOREACH (LineartLineChain *, rlc, &rb->chains) {
 
@@ -4007,18 +4006,13 @@ static void lineart_gpencil_generate(LineartRenderBuffer *rb,
                   }
                   MDeformWeight *mdw = BKE_defvert_ensure_index(&me->dvert[vindex], dindex);
                   MDeformWeight *gdw = BKE_defvert_ensure_index(&gps->dvert[sindex], gpdg);
-                  if (preserve_weight) {
-                    float use_weight = mdw->weight;
-                    if (invert_input) {
-                      use_weight = 1 - use_weight;
-                    }
-                    gdw->weight = MAX2(use_weight, gdw->weight);
-                  }
-                  else {
-                    if (mdw->weight > 0.999f) {
-                      gdw->weight = 1.0f;
-                    }
+
+                  float use_weight = mdw->weight;
+                  if (invert_input) {
+                    use_weight = 1 - use_weight;
                   }
+                  gdw->weight = MAX2(use_weight, gdw->weight);
+
                   sindex++;
                 }
               }
diff --git a/source/blender/makesdna/DNA_gpencil_modifier_defaults.h b/source/blender/makesdna/DNA_gpencil_modifier_defaults.h
index 2478bbe88ba..ea03789ddab 100644
--- a/source/blender/makesdna/DNA_gpencil_modifier_defaults.h
+++ b/source/blender/makesdna/DNA_gpencil_modifier_defaults.h
@@ -288,7 +288,7 @@
     .edge_types = LRT_EDGE_FLAG_ALL_TYPE, \
     .thickness = 25, \
     .opacity = 1.0f, \
-    .flags = LRT_GPENCIL_MATCH_OUTPUT_VGROUP | LRT_GPENCIL_SOFT_SELECTION, \
+    .flags = LRT_GPENCIL_MATCH_OUTPUT_VGROUP, \
     .crease_threshold = DEG2RAD(140.0f), \
     .calculation_flags = LRT_ALLOW_DUPLI_OBJECTS | LRT_ALLOW_CLIPPING_BOUNDARIES, \
     .angle_splitting_threshold = DEG2RAD(60.0f), \
diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h
index 0572bf41112..8d7b3896ef9 100644
--- a/source/blender/makesdna/DNA_gpencil_modifier_types.h
+++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h
@@ -819,7 +819,7 @@ typedef enum eLineartGpencilModifierSource {
 typedef enum eLineArtGPencilModifierFlags {
   LRT_GPENCIL_INVERT_SOURCE_VGROUP = (1 << 0),
   LRT_GPENCIL_MATCH_OUTPUT_VGROUP = (1 << 1),
-  LRT_GPENCIL_SOFT_SELECTION = (1 << 2),
+  LRT_GPENCIL_BINARY_WEIGHTS = (1 << 2) /* Deprecated, this is removed for lack of use case. */,
   LRT_GPENCIL_IS_BAKED = (1 << 3),
 } eLineArtGPencilModifierFlags;
 
diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c
index 1bddfb949a4..6f90b37d3fc 100644
--- a/source/blender/makesrna/intern/rna_gpencil_modifier.c
+++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c
@@ -2501,12 +2501,6 @@ static void rna_def_modifier_gpencillineart(BlenderRNA *brna)
   RNA_def_property_ui_text(prop, "Match Output", "Match output vertex group based on name");
   RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
 
-  prop = RNA_def_property(srna, "use_soft_selection", PROP_BOOLEAN, PROP_NONE);
-  RNA_def_property_boolean_sdna(prop, NULL, "flags", LRT_GPENCIL_SOFT_SELECTION);
-  RNA_def_property_ui_text(
-      prop, "Clip", "Preserve original vertex weight instead of clipping to 0/1");
-  RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
-
   prop = RNA_def_property(srna, "is_baked", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flags", LRT_GPENCIL_IS_BAKED);
   RNA_def_property_ui_text(prop, "Is Baked", "This modifier has baked data");



More information about the Bf-blender-cvs mailing list