diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-03-26 19:41:56 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-04-05 11:36:08 +0300 |
commit | 7ea29d69dfa79258c9f4c4e92b5c469606ff90dd (patch) | |
tree | 0a80f308ca3d3119be639e7a5a1478897a732944 /source | |
parent | 61aea37d3597e3755e7df1f5f38e368c42803fe4 (diff) |
Fix T47935: Hair particles; The display percentage parameter breaks after a render is done.
Follow same logic in `psys_render_restore` as in `psys_render_set` - if hair and
display percentage is not 100%, we have to recompute particles...
With regular 'emitter' particles just hiding some is fine (though using random here
will not give a precise proportion...).
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index d02308b6482..364bdbb5516 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -720,13 +720,19 @@ void psys_render_restore(Object *ob, ParticleSystem *psys) disp = psys_get_current_display_percentage(psys); if (disp != render_disp) { - PARTICLE_P; + /* Hair can and has to be recalculated if everything isn't displayed. */ + if (psys->part->type == PART_HAIR) { + psys->recalc |= PSYS_RECALC_RESET; + } + else { + PARTICLE_P; - LOOP_PARTICLES { - if (psys_frand(psys, p) > disp) - pa->flag |= PARS_NO_DISP; - else - pa->flag &= ~PARS_NO_DISP; + LOOP_PARTICLES { + if (psys_frand(psys, p) > disp) + pa->flag |= PARS_NO_DISP; + else + pa->flag &= ~PARS_NO_DISP; + } } } } |