[Bf-blender-cvs] [b6732c47c1c] temp-lineart-contained: GPencil: Fix bug in previous commit with Scale

Antonio Vazquez noreply at git.blender.org
Sat Jul 3 17:15:34 CEST 2021


Commit: b6732c47c1c2cad79c2035591ec10e12926b0b81
Author: Antonio Vazquez
Date:   Sat Jul 3 17:15:28 2021 +0200
Branches: temp-lineart-contained
https://developer.blender.org/rBb6732c47c1c2cad79c2035591ec10e12926b0b81

GPencil: Fix bug in previous commit with Scale

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

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

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

diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c b/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c
index 35b4efe1e0f..1a38b91a18b 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c
@@ -145,12 +145,17 @@ static void deformStroke(GpencilModifierData *md,
 
     /* Calculate Random matrix. */
     float mat_rnd[4][4];
-    float rnd_loc[3] = {rand[0][0] * weight, rand[0][1] * weight, rand[0][2] * weight};
-    float rnd_rot[3] = {rand[1][0] * weight, rand[1][1] * weight, rand[1][2] * weight};
-    float rnd_scale[3] = {rand[2][0] * weight, rand[2][1] * weight, rand[2][2] * weight};
+    float rnd_loc[3], rnd_rot[3], rnd_scale_weight[3];
+    float rnd_scale[3] = {1.0f, 1.0f, 1.0f};
+
+    mul_v3_v3fl(rnd_loc, rand[0], weight);
+    mul_v3_v3fl(rnd_rot, rand[1], weight);
+    mul_v3_v3fl(rnd_scale_weight, rand[2], weight);
+
     mul_v3_v3v3(rnd_loc, mmd->rnd_offset, rnd_loc);
     mul_v3_v3v3(rnd_rot, mmd->rnd_rot, rnd_rot);
-    madd_v3_v3v3(rnd_scale, mmd->rnd_scale, rnd_scale);
+    madd_v3_v3v3(rnd_scale, mmd->rnd_scale, rnd_scale_weight);
+
     loc_eul_size_to_mat4(mat_rnd, rnd_loc, rnd_rot, rnd_scale);
     /* Apply randomness matrix. */
     mul_m4_v3(mat_rnd, &pt->x);



More information about the Bf-blender-cvs mailing list