From ca3c16ec4337e25590ea1f7566cf34d0ae173930 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Mon, 14 Sep 2020 17:18:26 +0200 Subject: Fix T73590: collection instance offset is not applied correctly The instance offset should be applied before scaling. This way the scaling is done from the "collection origin". Reviewers: zeddb, brecht Differential Revision: https://developer.blender.org/D8889 --- source/blender/blenkernel/intern/object_dupli.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'source/blender/blenkernel/intern/object_dupli.c') diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c index d69f4a39263..ceb744d2fe0 100644 --- a/source/blender/blenkernel/intern/object_dupli.c +++ b/source/blender/blenkernel/intern/object_dupli.c @@ -1354,15 +1354,13 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem part->instance_collection, object, mode) { copy_m4_m4(tmat, oblist[b]->obmat); + /* Apply collection instance offset. */ + sub_v3_v3(tmat[3], part->instance_collection->instance_offset); + /* Apply particle scale. */ mul_mat3_m4_fl(tmat, size * scale); mul_v3_fl(tmat[3], size * scale); - /* Collection dupli-offset, should apply after everything else. */ - if (!is_zero_v3(part->instance_collection->instance_offset)) { - sub_v3_v3(tmat[3], part->instance_collection->instance_offset); - } - /* Individual particle transform. */ mul_m4_m4m4(mat, pamat, tmat); -- cgit v1.2.3