Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2019-08-08 18:16:06 +0300
committerAntonioya <blendergit@gmail.com>2019-08-08 18:16:17 +0300
commit45ec08dc991c29f60d1ec4a39df7c7364cde631c (patch)
tree30ad952c6b76eff8770d42aa97032511bd568935 /source/blender/gpencil_modifiers
parent179e886ab3d6f8b762ff66c5bb2cb203a4adcb62 (diff)
GPencil: Add mode Merge to Simplify modifier
This option uses the same logic of the merge by distance but as an option of modifier to allow dynamic merge. This option will be very useful for LANPR generated strokes.
Diffstat (limited to 'source/blender/gpencil_modifiers')
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c7
1 files changed, 6 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;
}