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:
Diffstat (limited to 'source/blender/blenkernel/intern/object_dupli.c')
-rw-r--r--source/blender/blenkernel/intern/object_dupli.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c
index b7748039f62..33b65dbe4a3 100644
--- a/source/blender/blenkernel/intern/object_dupli.c
+++ b/source/blender/blenkernel/intern/object_dupli.c
@@ -837,7 +837,6 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem
float (*obmat)[4];
int a, b, hair = 0;
int totpart, totchild, totcollection = 0 /*, pa_num */;
- RNG *rng;
int no_draw_flag = PARS_UNEXIST;
@@ -859,8 +858,6 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem
totpart = psys->totpart;
totchild = psys->totchild;
- rng = BLI_rng_new_srandom(31415926u + (unsigned int)psys->seed);
-
if ((for_render || part->draw_as == PART_DRAW_REND) && ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) {
ParticleSimulationData sim = {NULL};
sim.depsgraph = ctx->depsgraph;
@@ -901,6 +898,7 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem
totpart = psys->totcached;
}
+ RNG *rng = BLI_rng_new_srandom(31415926u + (unsigned int)psys->seed);
psys_check_group_weights(part);
psys->lattice_deform_data = psys_create_lattice_deform_data(&sim);
@@ -1121,6 +1119,8 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem
}
else
*ob = obcopy;
+
+ BLI_rng_free(rng);
}
/* clean up */
@@ -1133,8 +1133,6 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem
end_latt_deform(psys->lattice_deform_data);
psys->lattice_deform_data = NULL;
}
-
- BLI_rng_free(rng);
}
static void make_duplis_particles(const DupliContext *ctx)