Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
| Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| NoiseGpencilModifierData *gpmd = (NoiseGpencilModifierData *)md; | NoiseGpencilModifierData *gpmd = (NoiseGpencilModifierData *)md; | ||||
| gpmd->pass_index = 0; | gpmd->pass_index = 0; | ||||
| gpmd->flag |= GP_NOISE_MOD_LOCATION; | gpmd->flag |= GP_NOISE_MOD_LOCATION; | ||||
| gpmd->flag |= GP_NOISE_FULL_STROKE; | gpmd->flag |= GP_NOISE_FULL_STROKE; | ||||
| gpmd->flag |= GP_NOISE_USE_RANDOM; | gpmd->flag |= GP_NOISE_USE_RANDOM; | ||||
| gpmd->factor = 0.5f; | gpmd->factor = 0.5f; | ||||
| gpmd->layername[0] = '\0'; | gpmd->layername[0] = '\0'; | ||||
| gpmd->materialname[0] = '\0'; | |||||
| gpmd->vgname[0] = '\0'; | gpmd->vgname[0] = '\0'; | ||||
| gpmd->step = 1; | gpmd->step = 1; | ||||
| gpmd->seed = 0; | gpmd->seed = 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); | ||||
| Show All 21 Lines | static void deformStroke(GpencilModifierData *md, | ||||
| float vec1[3], vec2[3]; | float vec1[3], vec2[3]; | ||||
| int sc_frame = 0; | int sc_frame = 0; | ||||
| int stroke_seed = 0; | int stroke_seed = 0; | ||||
| const int def_nr = defgroup_name_index(ob, mmd->vgname); | const int def_nr = defgroup_name_index(ob, mmd->vgname); | ||||
| const float unit_v3[3] = {1.0f, 1.0f, 1.0f}; | const float unit_v3[3] = {1.0f, 1.0f, 1.0f}; | ||||
| 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_NOISE_INVERT_LAYER, | mmd->flag & GP_NOISE_INVERT_LAYER, | ||||
| mmd->flag & GP_NOISE_INVERT_PASS, | mmd->flag & GP_NOISE_INVERT_PASS, | ||||
| mmd->flag & GP_NOISE_INVERT_LAYERPASS)) { | mmd->flag & GP_NOISE_INVERT_LAYERPASS, | ||||
| mmd->flag & GP_NOISE_INVERT_MATERIAL)) { | |||||
| return; | return; | ||||
| } | } | ||||
| sc_frame = (int)DEG_get_ctime(depsgraph); | sc_frame = (int)DEG_get_ctime(depsgraph); | ||||
| zero_v3(vec2); | zero_v3(vec2); | ||||
| /* calculate stroke normal*/ | /* calculate stroke normal*/ | ||||
| ▲ Show 20 Lines • Show All 165 Lines • Show Last 20 Lines | |||||