Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpencil_modifiers/intern/MOD_gpencilsubdiv.c
| Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
| #include "MOD_gpencil_modifiertypes.h" | #include "MOD_gpencil_modifiertypes.h" | ||||
| static void initData(GpencilModifierData *md) | static void initData(GpencilModifierData *md) | ||||
| { | { | ||||
| SubdivGpencilModifierData *gpmd = (SubdivGpencilModifierData *)md; | SubdivGpencilModifierData *gpmd = (SubdivGpencilModifierData *)md; | ||||
| gpmd->pass_index = 0; | gpmd->pass_index = 0; | ||||
| gpmd->level = 1; | gpmd->level = 1; | ||||
| 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); | ||||
| } | } | ||||
| /* subdivide stroke to get more control points */ | /* subdivide stroke to get more control points */ | ||||
| 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 *UNUSED(gpf), | bGPDframe *UNUSED(gpf), | ||||
| bGPDstroke *gps) | bGPDstroke *gps) | ||||
| { | { | ||||
| SubdivGpencilModifierData *mmd = (SubdivGpencilModifierData *)md; | SubdivGpencilModifierData *mmd = (SubdivGpencilModifierData *)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, | ||||
| 3, | 3, | ||||
| gpl, | gpl, | ||||
| gps, | gps, | ||||
| mmd->flag & GP_SUBDIV_INVERT_LAYER, | mmd->flag & GP_SUBDIV_INVERT_LAYER, | ||||
| mmd->flag & GP_SUBDIV_INVERT_PASS, | mmd->flag & GP_SUBDIV_INVERT_PASS, | ||||
| mmd->flag & GP_SUBDIV_INVERT_LAYERPASS)) { | mmd->flag & GP_SUBDIV_INVERT_LAYERPASS, | ||||
| mmd->flag & GP_SUBDIV_INVERT_MATERIAL)) { | |||||
| return; | return; | ||||
| } | } | ||||
| BKE_gpencil_subdivide(gps, mmd->level, mmd->flag); | BKE_gpencil_subdivide(gps, mmd->level, mmd->flag); | ||||
| } | } | ||||
| static void bakeModifier(struct Main *UNUSED(bmain), | static void bakeModifier(struct Main *UNUSED(bmain), | ||||
| Depsgraph *depsgraph, | Depsgraph *depsgraph, | ||||
| ▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines | |||||