diff options
author | YimingWu <xp8110@outlook.com> | 2021-03-26 14:08:10 +0300 |
---|---|---|
committer | Sebastian Parborg <darkdefende@gmail.com> | 2021-04-01 13:36:23 +0300 |
commit | 496df39e6fd8f65e625db27d3bb63f90576cd30b (patch) | |
tree | 52af2c00c622335be84b08d7c589520937030526 /source | |
parent | e1b2cf887fdbf2897c59dd7d20ea1074f962d3ee (diff) |
LineArt: Remove "soft selection" option.
After some back and forth with the GP module and some artists, this
option was deemed not that useful. The use case was considered too
obscure so we'll remove it.
It is still posible to have this functionality by using the vertex
weight modiifers or manually clamping the weights.
Diffstat (limited to 'source')
5 files changed, 8 insertions, 22 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c index 22ba035be8a..eca82f4cb90 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 8bcf620a882..49e0d03c459 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c @@ -3801,7 +3801,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) { @@ -3885,18 +3884,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 3a889da754d..b13dada6bdf 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"); |