diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-02-06 23:59:09 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-02-06 23:59:09 +0300 |
commit | 7f2b2929ffd045b1694af29d121029fd94649638 (patch) | |
tree | e5c22a5e92167ed3126b3f8c0b0c143274dc4d53 /source/blender/blenkernel/intern | |
parent | dfc93b14248ddeadb4f5ce7618c03cc1cc37d5f7 (diff) |
Fix #20350: particles are offset from emittor in dupli-objects.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/anim.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 6d95df3ca84..6d57c2681ad 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -1083,7 +1083,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p ParticleCacheKey *cache; float ctime, pa_time, scale = 1.0f; float tmat[4][4], mat[4][4], pamat[4][4], vec[3], size=0.0; - float (*obmat)[4], (*oldobmat)[4]; + float (*obmat)[4], (*oldobmat)[4], recurs_mat[4][4]; int lay, a, b, counter, hair = 0; int totpart, totchild, totgroup=0, pa_num; @@ -1099,6 +1099,10 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p if(!psys_check_enabled(par, psys)) return; + + /* particles are already in world space, don't want the object mat twice */ + if(par_space_mat) + mul_m4_m4m4(recurs_mat, psys->imat, par_space_mat); ctime = bsystem_time(scene, par, (float)scene->r.cfra, 0.0); @@ -1243,7 +1247,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p mul_m4_m4m4(tmat, oblist[b]->obmat, pamat); mul_mat3_m4_fl(tmat, size*scale); if(par_space_mat) - mul_m4_m4m4(mat, tmat, par_space_mat); + mul_m4_m4m4(mat, tmat, recurs_mat); else copy_m4_m4(mat, tmat); @@ -1269,7 +1273,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p VECADD(tmat[3], tmat[3], vec); if(par_space_mat) - mul_m4_m4m4(mat, tmat, par_space_mat); + mul_m4_m4m4(mat, tmat, recurs_mat); else copy_m4_m4(mat, tmat); |