Fix T103887: Line Art Vertex Weight Transfer to target group broken

Caused by {rB841df831e89d} and {rB3558bb8eae75}.

These commits moved flags from `eLineArtGPencilModifierFlags` to
`eLineartMainFlags`, but later on in code, these were still evaluated
from the modifiers `flags` (instead of `calculation_flags`).
This resulted in a false condition (`match_output` was assumed true but
it wasnt), leading to a wrong codepath taken.

This is now corrected (`calculation_flags` need to be passed around for
this as well).

Maniphest Tasks: T103887

Differential Revision: https://developer.blender.org/D17062
This commit is contained in:
Philipp Oeser 2023-01-20 11:51:43 +01:00
parent b5bb38400f
commit 6aa29549e8
Notes: blender-bot 2023-03-17 13:39:34 +01:00
Referenced by issue #100749, Blender LTS: Maintenance Task 3.3
Referenced by issue #103887, Regression: Line Art - Vertex Weight Transfer to a target group doesn't work
Referenced by issue #105640, Vertex Weight Proximity not working for Grease Pencil Thickness Modifier
Referenced by pull request #105852, Fix #105640: LineArt: versioning for LRT_GPENCIL_MATCH_OUTPUT_VGROUP flag.
4 changed files with 14 additions and 8 deletions

View File

@ -89,7 +89,8 @@ static void generate_strokes_actual(
lmd->silhouette_selection,
lmd->source_vertex_group,
lmd->vgname,
lmd->flags);
lmd->flags,
lmd->calculation_flags);
}
static bool isModifierDisabled(GpencilModifierData *md)

View File

@ -923,7 +923,8 @@ void MOD_lineart_gpencil_generate(LineartCache *cache,
uint8_t silhouette_mode,
const char *source_vgname,
const char *vgname,
int modifier_flags);
int modifier_flags,
int modifier_calculation_flags);
/**
* Length is in image space.

View File

@ -5156,7 +5156,8 @@ static void lineart_gpencil_generate(LineartCache *cache,
uchar silhouette_mode,
const char *source_vgname,
const char *vgname,
int modifier_flags)
int modifier_flags,
int modifier_calculation_flags)
{
if (cache == nullptr) {
if (G.debug_value == 4000) {
@ -5182,8 +5183,8 @@ static void lineart_gpencil_generate(LineartCache *cache,
/* (!orig_col && !orig_ob) means the whole scene is selected. */
int enabled_types = cache->all_enabled_edge_types;
bool invert_input = modifier_flags & LRT_GPENCIL_INVERT_SOURCE_VGROUP;
bool match_output = modifier_flags & LRT_GPENCIL_MATCH_OUTPUT_VGROUP;
bool invert_input = modifier_calculation_flags & LRT_GPENCIL_INVERT_SOURCE_VGROUP;
bool match_output = modifier_calculation_flags & LRT_GPENCIL_MATCH_OUTPUT_VGROUP;
bool inverse_silhouette = modifier_flags & LRT_GPENCIL_INVERT_SILHOUETTE_FILTER;
LISTBASE_FOREACH (LineartEdgeChain *, ec, &cache->chains) {
@ -5381,7 +5382,8 @@ void MOD_lineart_gpencil_generate(LineartCache *cache,
uchar silhouette_mode,
const char *source_vgname,
const char *vgname,
int modifier_flags)
int modifier_flags,
int modifier_calculation_flags)
{
if (!gpl || !gpf || !ob) {
@ -5427,5 +5429,6 @@ void MOD_lineart_gpencil_generate(LineartCache *cache,
silhouette_mode,
source_vgname,
vgname,
modifier_flags);
modifier_flags,
modifier_calculation_flags);
}

View File

@ -136,7 +136,8 @@ static bool bake_strokes(Object *ob,
lmd->silhouette_selection,
lmd->source_vertex_group,
lmd->vgname,
lmd->flags);
lmd->flags,
lmd->calculation_flags);
if (!(lmd->flags & LRT_GPENCIL_USE_CACHE)) {
/* Clear local cache. */