Bugfix for [#17561] when i try to change the particle to hair I cant choose group...
authorDaniel Genrich <daniel.genrich@gmx.net>
Wed, 10 Sep 2008 15:25:06 +0000 (15:25 +0000)
committerDaniel Genrich <daniel.genrich@gmx.net>
Wed, 10 Sep 2008 15:25:06 +0000 (15:25 +0000)
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/particle.c

index e2ce4b9f6f3a7892df20f6bf08665c60dba9a6d2..ceb0e132ff98aca90ed00240920df81be04c4ba8 100644 (file)
@@ -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;
                                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);
                }
 
                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);
                                        }
 
                                        VECCOPY(pamat[3], cache->co);
+                                       pamat[3][3]= 1.0f;
+                                       
                                }
                                else if(step_nbr) {
                                        /* other keys */
                                }
                                else if(step_nbr) {
                                        /* other keys */
index 15d6f71073f25272eca2359d2dacf2e84decedab..72b36b312ffd8571bfdc81a128c8ced072f4c933 100644 (file)
@@ -3866,14 +3866,9 @@ void psys_get_dupli_path_transform(Object *ob, ParticleSystem *psys, ParticleSys
                Mat4MulMat4(mat, obrotmat, qmat);
        }
        else {
                Mat4MulMat4(mat, obrotmat, qmat);
        }
        else {
-               Crossf(side, nor, vec);
-               Normalize(side);
-               Crossf(nor, vec, side);
-
+               Normalize(nor);
                Mat4One(mat);
                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;
        }
 
        *scale= len;