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:
authorJanne Karhu <jhkarh@gmail.com>2012-07-23 03:07:43 +0400
committerJanne Karhu <jhkarh@gmail.com>2012-07-23 03:07:43 +0400
commit161f502485513c80a01ade75f946a827b49a1c32 (patch)
treee84cc7d49b7b57146726bacdbd386d7bd0373dbb /source/blender/blenkernel/intern/anim.c
parent7fb85e1fb7a9ceb53b4477402a8536ae07cdc950 (diff)
Fix for #32162 psys rotation causes size issues for particle instances
- The original scaling of the object wasn't taken into account when not using the particle dupliobject rotation option.
Diffstat (limited to 'source/blender/blenkernel/intern/anim.c')
-rw-r--r--source/blender/blenkernel/intern/anim.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index 16ff1646f43..43b2df7ff95 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -1458,12 +1458,18 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
/* particle rotation uses x-axis as the aligned axis, so pre-rotate the object accordingly */
if ((part->draw & PART_DRAW_ROTATE_OB) == 0) {
- float xvec[3], q[4];
+ float xvec[3], q[4], size_mat[4][4], original_size[3];
+
+ mat4_to_size(original_size, obmat);
+ size_to_mat4(size_mat, original_size);
+
xvec[0] = -1.f;
xvec[1] = xvec[2] = 0;
vec_to_quat(q, xvec, ob->trackflag, ob->upflag);
quat_to_mat4(obmat, q);
obmat[3][3] = 1.0f;
+
+ mult_m4_m4m4(obmat, obmat, size_mat);
}
/* Normal particles and cached hair live in global space so we need to