diff options
author | Jacques Lucke <jacques@blender.org> | 2020-09-14 18:18:26 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-09-14 18:18:26 +0300 |
commit | ca3c16ec4337e25590ea1f7566cf34d0ae173930 (patch) | |
tree | 7a94fa1dedc71779a535266ec88f8f8e4e8b21fd | |
parent | 716ea15479895e56eb9f6d973aca88a5436d7efe (diff) |
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
-rw-r--r-- | source/blender/blenkernel/intern/object_dupli.c | 8 |
1 files changed, 3 insertions, 5 deletions
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); |