diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-03-26 19:41:56 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-03-26 19:41:56 +0300 |
commit | 8fcf774167a2ea52e63771655f6dd5eefb4ff7ee (patch) | |
tree | 5cb380002105582a76eb4aeac89b3050c14eb90e | |
parent | 112f431c3b71576a3a6dbd875340dc74e57502d0 (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...).
-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 66d6252c273..081244c5c6b 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; + } } } } |