diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-07-01 11:32:30 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-07-01 11:32:30 +0300 |
commit | 9b64ebc605bafd3efa670b39dd53c100c7235cd7 (patch) | |
tree | 11a22b08561bad14c90bf117c7a5cb259a3eb998 /source/blender/blenkernel/intern/particle_system.c | |
parent | 95a1e9990946e8ea300e157f2dce2e03c075c44c (diff) |
Fix T45253: Particle emitter volume mode and grid mode broken in 2.75.x
This is a regression since dced56f and root of the issue comes to the fact
that grid distribution sets UNEXIST flag during distribution, which is then
being reset in initialize_all_particles().
This commit solves the issue, but it's not really nice and some smart guy
might want to revisit it.
Diffstat (limited to 'source/blender/blenkernel/intern/particle_system.c')
-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 7aa5f1eb750..89db2dd45a9 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -559,10 +559,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); + } } } |