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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-05-19 08:07:01 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-05-19 08:07:01 +0400
commit0abe99343584ddfbf9f508f145a36a66312a2a60 (patch)
tree69aa7f76ec06e74aab2ab7a4330cdc7bb3f8c60e /source/blender/blenkernel/intern/anim.c
parent76ee6d3fc5dc2ce3322ed553aa418ac2613d41a3 (diff)
Fix #35407: different particle behavior compared to 2.66, reverted part of 56073.
Diffstat (limited to 'source/blender/blenkernel/intern/anim.c')
-rw-r--r--source/blender/blenkernel/intern/anim.c23
1 files changed, 7 insertions, 16 deletions
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)