From 3bf182c4b42d38c99e855232cb3d79fca69d2daa Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Wed, 10 Sep 2008 15:25:06 +0000 Subject: [PATCH] Bugfix for [#17561] when i try to change the particle to hair I cant choose group or object as viz; Bugfix for mat[4][4] equal to zero resulting in no duplis --> Important: Janne could you check that fixes? --- source/blender/blenkernel/intern/anim.c | 6 ++++++ source/blender/blenkernel/intern/particle.c | 9 ++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index e2ce4b9f6f3..ceb0e132ff9 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -783,6 +783,10 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Object *par, float par_ hair= (totchild == 0 || psys->childcache) && psys->pathcache; if(!hair) return; + + /* we use cache, update totchild according to cached data */ + totchild = psys->totchildcache; + totpart = psys->totcached; } psys->lattice = psys_get_lattice(par, psys); @@ -865,6 +869,8 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Object *par, float par_ } VECCOPY(pamat[3], cache->co); + pamat[3][3]= 1.0f; + } else if(step_nbr) { /* other keys */ diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 15d6f71073f..72b36b312ff 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3866,14 +3866,9 @@ void psys_get_dupli_path_transform(Object *ob, ParticleSystem *psys, ParticleSys Mat4MulMat4(mat, obrotmat, qmat); } else { - Crossf(side, nor, vec); - Normalize(side); - Crossf(nor, vec, side); - + Normalize(nor); Mat4One(mat); - VECCOPY(mat[0], vec); - VECCOPY(mat[1], side); - VECCOPY(mat[2], nor); + VECCOPY(mat[2], nor); // mat[2] is normal/direction } *scale= len;