Fix T95923: GPencil Array modifier constant offset works even disabled

The problem was when the Object Offset was enabled because the Constant Offset flag was not checked and the offset always was added to the transformation matrix.
This commit is contained in:
Antonio Vazquez 2022-02-21 19:48:11 +01:00
parent be6bcaa8c1
commit 49ae0b5b3c
Notes: blender-bot 2023-02-14 10:18:56 +01:00
Referenced by issue #95923, GPencil: Array modifier constant offset works even if disabled if object offset is enabled
1 changed files with 3 additions and 1 deletions

View File

@ -120,7 +120,9 @@ static void BKE_gpencil_instance_modifier_instance_tfm(Object *ob,
float obinv[4][4];
unit_m4(mat_offset);
add_v3_v3(mat_offset[3], mmd->offset);
if (mmd->flag & GP_ARRAY_USE_OFFSET) {
add_v3_v3(mat_offset[3], mmd->offset);
}
invert_m4_m4(obinv, ob->obmat);
mul_m4_series(r_offset, mat_offset, obinv, mmd->object->obmat);