GPencil: Fix offset modifier negative scale thickness

If the scale in the offset modifier was set to a value lower than -1,
the object would get mirrored. The problem was, that the thickness
was set to 0 by that. This fix makes the thickness calculation only
use the absolute values.

Differential Revision: http://developer.blender.org/D14324
This commit is contained in:
Henrik Dick 2022-03-14 11:11:22 +01:00
parent bf5e9ef2df
commit 4045b3d7b6
1 changed files with 1 additions and 1 deletions

View File

@ -152,7 +152,7 @@ static void deformStroke(GpencilModifierData *md,
loc_eul_size_to_mat4(mat, loc, rot, scale);
/* Apply scale to thickness. */
float unit_scale = (scale[0] + scale[1] + scale[2]) / 3.0f;
float unit_scale = (fabsf(scale[0]) + fabsf(scale[1]) + fabsf(scale[2])) / 3.0f;
pt->pressure *= unit_scale;
mul_m4_v3(mat, &pt->x);