Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-09-14 18:18:26 +0300
committerJacques Lucke <jacques@blender.org>2020-09-14 18:18:26 +0300
commitca3c16ec4337e25590ea1f7566cf34d0ae173930 (patch)
tree7a94fa1dedc71779a535266ec88f8f8e4e8b21fd /source/blender/blenkernel/intern/object_dupli.c
parent716ea15479895e56eb9f6d973aca88a5436d7efe (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
Diffstat (limited to 'source/blender/blenkernel/intern/object_dupli.c')
-rw-r--r--source/blender/blenkernel/intern/object_dupli.c8
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);