diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-03-13 14:24:49 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-03-13 14:24:49 +0300 |
commit | cf9b3310c032c4da46fde8e8b3a8ee5941472dfc (patch) | |
tree | 9b2160988506315f7b767d416fc7d90e8e442df6 /source/blender/blenloader/intern/versioning_280.c | |
parent | 91ca3c3c0b52a56865d3d704e4e9c6936e298610 (diff) |
GPencil: Fix Noise modifier versioning
The versioning was setting the factor for all modes without checking flags.
Also cleanup some unused code.
Diffstat (limited to 'source/blender/blenloader/intern/versioning_280.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 7d727e81882..4b591e0d508 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -4644,10 +4644,12 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } case eGpencilModifierType_Noise: { NoiseGpencilModifierData *mmd = (NoiseGpencilModifierData *)md; - mmd->factor /= 25.0f; - mmd->factor_thickness = mmd->factor; - mmd->factor_strength = mmd->factor; - mmd->factor_uvs = mmd->factor; + float factor = mmd->factor / 25.0f; + mmd->factor = (mmd->flag & GP_NOISE_MOD_LOCATION) ? factor : 0.0f; + mmd->factor_thickness = (mmd->flag & GP_NOISE_MOD_STRENGTH) ? factor : 0.0f; + mmd->factor_strength = (mmd->flag & GP_NOISE_MOD_THICKNESS) ? factor : 0.0f; + mmd->factor_uvs = (mmd->flag & GP_NOISE_MOD_UV) ? factor : 0.0f; + mmd->noise_scale = (mmd->flag & GP_NOISE_FULL_STROKE) ? 0.0f : 1.0f; if (mmd->curve_intensity == NULL) { |