[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49127] trunk/blender/source/blender/ blenkernel/intern/anim.c: Fix for #32162 psys rotation causes size issues for particle instances
Janne Karhu
jhkarh at gmail.com
Mon Jul 23 01:07:43 CEST 2012
Revision: 49127
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49127
Author: jhk
Date: 2012-07-22 23:07:43 +0000 (Sun, 22 Jul 2012)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/blender/source/blender/blenkernel/intern/anim.c
Modified: trunk/blender/source/blender/blenkernel/intern/anim.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/anim.c 2012-07-22 22:58:12 UTC (rev 49126)
+++ trunk/blender/source/blender/blenkernel/intern/anim.c 2012-07-22 23:07:43 UTC (rev 49127)
@@ -1458,12 +1458,18 @@
/* 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
More information about the Bf-blender-cvs
mailing list