diff options
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 3a19ca7304c..1495e914ad1 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -558,10 +558,24 @@ void initialize_particle(ParticleSimulationData *sim, ParticleData *pa) static void initialize_all_particles(ParticleSimulationData *sim) { ParticleSystem *psys = sim->psys; + ParticleSettings *part = psys->part; + /* Grid distributionsets UNEXIST flag, need to take care of + * it here because later this flag is being reset. + * + * We can't do it for any distribution, because it'll then + * conflict with texture influence, which does not free + * unexisting particles and only sets flag. + * + * It's not so bad, because only grid distribution sets + * UNEXIST flag. + */ + const bool emit_from_volume_grid = (part->distr == PART_DISTR_GRID) && + (!ELEM(part->from, PART_FROM_VERT, PART_FROM_CHILD)); PARTICLE_P; - LOOP_PARTICLES { - initialize_particle(sim, pa); + if (!(emit_from_volume_grid && (pa->flag & PARS_UNEXIST) != 0)) { + initialize_particle(sim, pa); + } } } |