[Bf-blender-cvs] [ca3c16ec433] master: Fix T73590: collection instance offset is not applied correctly
Jacques Lucke
noreply at git.blender.org
Mon Sep 14 17:19:12 CEST 2020
Commit: ca3c16ec4337e25590ea1f7566cf34d0ae173930
Author: Jacques Lucke
Date: Mon Sep 14 17:18:26 2020 +0200
Branches: master
https://developer.blender.org/rBca3c16ec4337e25590ea1f7566cf34d0ae173930
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
===================================================================
M 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);
More information about the Bf-blender-cvs
mailing list