From 0abe99343584ddfbf9f508f145a36a66312a2a60 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 19 May 2013 04:07:01 +0000 Subject: Fix #35407: different particle behavior compared to 2.66, reverted part of 56073. --- source/blender/blenkernel/intern/anim.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'source/blender/blenkernel/intern/anim.c') diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 3494f68984c..f81d6a17ced 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -1263,7 +1263,6 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p ChildParticle *cpa = NULL; ParticleKey state; ParticleCacheKey *cache; - RNG *rng = NULL; 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]; @@ -1294,9 +1293,14 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p totpart = psys->totpart; totchild = psys->totchild; + BLI_srandom(31415926 + psys->seed); + if ((psys->renderdata || part->draw_as == PART_DRAW_REND) && ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) { ParticleSimulationData sim = {NULL}; - + sim.scene = scene; + sim.ob = par; + sim.psys = psys; + sim.psmd = psys_get_modifier(par, psys); /* make sure emitter imat is in global coordinates instead of render view coordinates */ invert_m4_m4(par->imat, par->obmat); @@ -1328,12 +1332,6 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p psys_check_group_weights(part); - sim.scene = scene; - sim.ob = par; - sim.psys = psys; - sim.psmd = psys_get_modifier(par, psys); - sim.rng = BLI_rng_new(0); - psys->lattice = psys_get_lattice(&sim); /* gather list of objects or single object */ @@ -1380,8 +1378,6 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p obcopy = *ob; } - rng = BLI_rng_new_srandom(31415926 + psys->seed); - if (totchild == 0 || part->draw & PART_DRAW_PARENT) a = 0; else @@ -1421,7 +1417,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p /* for groups, pick the object based on settings */ if (part->draw & PART_DRAW_RAND_GR) - b = BLI_rng_get_int(rng) % totgroup; + b = BLI_rand() % totgroup; else b = a % totgroup; @@ -1565,8 +1561,6 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p } else *ob = obcopy; - - BLI_rng_free(sim.rng); } /* clean up */ @@ -1579,9 +1573,6 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p end_latt_deform(psys->lattice); psys->lattice = NULL; } - - if (rng) - BLI_rng_free(rng); } static Object *find_family_object(Object **obar, char *family, char ch) -- cgit v1.2.3