diff options
Diffstat (limited to 'source')
3 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c index 06f6f012818..a27fb27d518 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c @@ -45,6 +45,7 @@ static void initData(GpencilModifierData *md) gpmd->pass_index = 0; gpmd->step = 1; gpmd->factor = 0.0f; + gpmd->length = 0.1f; gpmd->layername[0] = '\0'; } @@ -57,7 +58,7 @@ static void deformStroke(GpencilModifierData *md, Depsgraph *UNUSED(depsgraph), Object *ob, bGPDlayer *gpl, - bGPDframe *UNUSED(gpf), + bGPDframe *gpf, bGPDstroke *gps) { SimplifyGpencilModifierData *mmd = (SimplifyGpencilModifierData *)md; @@ -92,6 +93,10 @@ static void deformStroke(GpencilModifierData *md, BKE_gpencil_sample_stroke(gps, mmd->length, false); break; } + case GP_SIMPLIFY_MERGE: { + BKE_gpencil_merge_distance_stroke(gpf, gps, mmd->length, true); + break; + } default: break; } diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h index 3acd7d6de12..82628065014 100644 --- a/source/blender/makesdna/DNA_gpencil_modifier_types.h +++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h @@ -519,6 +519,8 @@ typedef enum eSimplifyGpencil_Mode { GP_SIMPLIFY_ADAPTIVE = 1, /* Sample the stroke using a fixed length */ GP_SIMPLIFY_SAMPLE = 2, + /* Sample the stroke doing vertex merge */ + GP_SIMPLIFY_MERGE = 3, } eSimplifyGpencil_Mode; typedef struct OffsetGpencilModifierData { diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c index ed23e603bec..dfe9e018e94 100644 --- a/source/blender/makesrna/intern/rna_gpencil_modifier.c +++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c @@ -622,6 +622,11 @@ static void rna_def_modifier_gpencilsimplify(BlenderRNA *brna) ICON_IPO_EASE_IN_OUT, "Sample", "Sample a curve using a fixed length"}, + {GP_SIMPLIFY_MERGE, + "MERGE", + ICON_IPO_EASE_IN_OUT, + "Merge", + "Sample a curve using doing merge of vertex"}, {0, NULL, 0, NULL, NULL}, }; |