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>2010-09-14 05:43:46 +0400
committerJanne Karhu <jhkarh@gmail.com>2010-09-14 05:43:46 +0400
commitca940016e17273d9b32b6b8717fee972de696979 (patch)
treec5e662da64690dccf45f8ccbcc7cc6656d01eb50 /source/blender/blenkernel/intern/anim.c
parent9cc3f7dd98cd718e87be89f8790d164782f1c333 (diff)
Fix for [#20350] particles are offset from emittor in dupli-objects
Diffstat (limited to 'source/blender/blenkernel/intern/anim.c')
-rw-r--r--source/blender/blenkernel/intern/anim.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index 4b9ffb1e374..98bdf3b2e9f 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -1357,19 +1357,25 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
VECCOPY(vec, obmat[3]);
obmat[3][0] = obmat[3][1] = obmat[3][2] = 0.0f;
- copy_m4_m4(mat, pamat);
+ /* Normal particles and cached hair live in global space so we need to
+ * remove the real emitter's transformation before 2nd order duplication.
+ */
+ if(par_space_mat)
+ mul_m4_m4m4(mat, pamat, psys->imat);
+ else
+ copy_m4_m4(mat, pamat);
mul_m4_m4m4(tmat, obmat, mat);
mul_mat3_m4_fl(tmat, size*scale);
- if(part->draw & PART_DRAW_GLOBAL_OB)
- VECADD(tmat[3], tmat[3], vec);
-
if(par_space_mat)
mul_m4_m4m4(mat, tmat, par_space_mat);
else
copy_m4_m4(mat, tmat);
+ if(part->draw & PART_DRAW_GLOBAL_OB)
+ VECADD(mat[3], mat[3], vec);
+
dob= new_dupli_object(lb, ob, mat, ob->lay, counter, OB_DUPLIPARTS, animated);
copy_m4_m4(dob->omat, oldobmat);
if(G.rendering)