Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c
| Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| SimplifyGpencilModifierData *gpmd = (SimplifyGpencilModifierData *)md; | SimplifyGpencilModifierData *gpmd = (SimplifyGpencilModifierData *)md; | ||||
| gpmd->pass_index = 0; | gpmd->pass_index = 0; | ||||
| gpmd->step = 1; | gpmd->step = 1; | ||||
| gpmd->factor = 0.0f; | gpmd->factor = 0.0f; | ||||
| gpmd->length = 0.1f; | gpmd->length = 0.1f; | ||||
| gpmd->distance = 0.1f; | gpmd->distance = 0.1f; | ||||
| gpmd->layername[0] = '\0'; | gpmd->layername[0] = '\0'; | ||||
| gpmd->materialname[0] = '\0'; | |||||
| } | } | ||||
| static void copyData(const GpencilModifierData *md, GpencilModifierData *target) | static void copyData(const GpencilModifierData *md, GpencilModifierData *target) | ||||
| { | { | ||||
| BKE_gpencil_modifier_copyData_generic(md, target); | BKE_gpencil_modifier_copyData_generic(md, target); | ||||
| } | } | ||||
| static void deformStroke(GpencilModifierData *md, | static void deformStroke(GpencilModifierData *md, | ||||
| Depsgraph *UNUSED(depsgraph), | Depsgraph *UNUSED(depsgraph), | ||||
| Object *ob, | Object *ob, | ||||
| bGPDlayer *gpl, | bGPDlayer *gpl, | ||||
| bGPDframe *gpf, | bGPDframe *gpf, | ||||
| bGPDstroke *gps) | bGPDstroke *gps) | ||||
| { | { | ||||
| SimplifyGpencilModifierData *mmd = (SimplifyGpencilModifierData *)md; | SimplifyGpencilModifierData *mmd = (SimplifyGpencilModifierData *)md; | ||||
| if (!is_stroke_affected_by_modifier(ob, | if (!is_stroke_affected_by_modifier(ob, | ||||
| mmd->layername, | mmd->layername, | ||||
| mmd->materialname, | |||||
| mmd->pass_index, | mmd->pass_index, | ||||
| mmd->layer_pass, | mmd->layer_pass, | ||||
| mmd->mode == GP_SIMPLIFY_SAMPLE ? 3 : 4, | mmd->mode == GP_SIMPLIFY_SAMPLE ? 3 : 4, | ||||
| gpl, | gpl, | ||||
| gps, | gps, | ||||
| mmd->flag & GP_SIMPLIFY_INVERT_LAYER, | mmd->flag & GP_SIMPLIFY_INVERT_LAYER, | ||||
| mmd->flag & GP_SIMPLIFY_INVERT_PASS, | mmd->flag & GP_SIMPLIFY_INVERT_PASS, | ||||
| mmd->flag & GP_SIMPLIFY_INVERT_LAYERPASS)) { | mmd->flag & GP_SIMPLIFY_INVERT_LAYERPASS, | ||||
| mmd->flag & GP_SIMPLIFY_INVERT_MATERIAL)) { | |||||
| return; | return; | ||||
| } | } | ||||
| /* Select simplification mode. */ | /* Select simplification mode. */ | ||||
| switch (mmd->mode) { | switch (mmd->mode) { | ||||
| case GP_SIMPLIFY_FIXED: { | case GP_SIMPLIFY_FIXED: { | ||||
| for (int i = 0; i < mmd->step; i++) { | for (int i = 0; i < mmd->step; i++) { | ||||
| BKE_gpencil_simplify_fixed(gps); | BKE_gpencil_simplify_fixed(gps); | ||||
| ▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines | |||||