Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c
| Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
| #include "DEG_depsgraph_build.h" | #include "DEG_depsgraph_build.h" | ||||
| #include "DEG_depsgraph_query.h" | #include "DEG_depsgraph_query.h" | ||||
| static void initData(GpencilModifierData *md) | static void initData(GpencilModifierData *md) | ||||
| { | { | ||||
| LatticeGpencilModifierData *gpmd = (LatticeGpencilModifierData *)md; | LatticeGpencilModifierData *gpmd = (LatticeGpencilModifierData *)md; | ||||
| gpmd->pass_index = 0; | gpmd->pass_index = 0; | ||||
| gpmd->layername[0] = '\0'; | gpmd->layername[0] = '\0'; | ||||
| gpmd->materialname[0] = '\0'; | |||||
| gpmd->vgname[0] = '\0'; | gpmd->vgname[0] = '\0'; | ||||
| gpmd->object = NULL; | gpmd->object = NULL; | ||||
| gpmd->cache_data = NULL; | gpmd->cache_data = NULL; | ||||
| gpmd->strength = 1.0f; | gpmd->strength = 1.0f; | ||||
| } | } | ||||
| 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 *UNUSED(gpf), | bGPDframe *UNUSED(gpf), | ||||
| bGPDstroke *gps) | bGPDstroke *gps) | ||||
| { | { | ||||
| LatticeGpencilModifierData *mmd = (LatticeGpencilModifierData *)md; | LatticeGpencilModifierData *mmd = (LatticeGpencilModifierData *)md; | ||||
| const int def_nr = defgroup_name_index(ob, mmd->vgname); | const int def_nr = defgroup_name_index(ob, mmd->vgname); | ||||
| 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, | ||||
| 1, | 1, | ||||
| gpl, | gpl, | ||||
| gps, | gps, | ||||
| mmd->flag & GP_LATTICE_INVERT_LAYER, | mmd->flag & GP_LATTICE_INVERT_LAYER, | ||||
| mmd->flag & GP_LATTICE_INVERT_PASS, | mmd->flag & GP_LATTICE_INVERT_PASS, | ||||
| mmd->flag & GP_LATTICE_INVERT_LAYERPASS)) { | mmd->flag & GP_LATTICE_INVERT_LAYERPASS, | ||||
| mmd->flag & GP_LATTICE_INVERT_MATERIAL)) { | |||||
| return; | return; | ||||
| } | } | ||||
| if (mmd->cache_data == NULL) { | if (mmd->cache_data == NULL) { | ||||
| return; | return; | ||||
| } | } | ||||
| for (int i = 0; i < gps->totpoints; i++) { | for (int i = 0; i < gps->totpoints; i++) { | ||||
| ▲ Show 20 Lines • Show All 119 Lines • Show Last 20 Lines | |||||