Commit: 84ccdceb15058c9de1ae8ee1392ed49ff796522b
Author: Antonio Vazquez
Date:   Fri Mar 6 11:57:29 2020 +0100
Branches: greasepencil-object
https://developer.blender.org/rB84ccdceb15058c9de1ae8ee1392ed49ff796522b

GPencil: Fix segment fault in Noise modifier

The random noise table used was wrong.

===================================================================

M       source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c

===================================================================

diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c 
b/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
index 7cf6fbfbd84..9b3d37bf11f 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
@@ -219,19 +219,19 @@ static void deformStroke(GpencilModifierData *md,
     }
 
     if (mmd->factor_thickness > 0.0f) {
-      float noise = table_sample(noise_table_position, i * noise_scale);
+      float noise = table_sample(noise_table_thickness, i * noise_scale);
       pt->pressure *= max_ff(1.0f + (noise * 2.0f - 1.0f) * weight * 
mmd->factor_thickness, 0.0f);
       CLAMP_MIN(pt->pressure, GPENCIL_STRENGTH_MIN);
     }
 
     if (mmd->factor_strength > 0.0f) {
-      float noise = table_sample(noise_table_position, i * noise_scale);
+      float noise = table_sample(noise_table_strength, i * noise_scale);
       pt->strength *= max_ff(1.0f - noise * weight * mmd->factor_strength, 
0.0f);
       CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
     }
 
     if (mmd->factor_uvs > 0.0f) {
-      float noise = table_sample(noise_table_position, i * noise_scale);
+      float noise = table_sample(noise_table_uvs, i * noise_scale);
       pt->uv_rot += (noise * 2.0f - 1.0f) * weight * mmd->factor_uvs * M_PI_2;
       CLAMP(pt->uv_rot, -M_PI_2, M_PI_2);
     }

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to