diff options
author | Janne Karhu <jhkarh@gmail.com> | 2008-02-12 18:26:20 +0300 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2008-02-12 18:26:20 +0300 |
commit | f695c1524c0a78d909f39da23c3c21e806ab1c49 (patch) | |
tree | 736fe6c1aaa7727a32af79e1c5d0c9571beb7210 /source/blender/blenkernel | |
parent | 3974a0a3c1a19aaa2a06df1bad7f96f827088319 (diff) |
Fix for bug: [#8269] Particle / Vizualization / Draw / Disp reduces rendered particles
- Hair didn't update the visibility flag of each particle
- Changing the disp value gave a too strong update call to particles
- Changed disp value behavior for dynamic particles a bit, now all particles are always calculated for uncached frames so that every particle gets it's data cached. Now the disp value actually does what it's supposed to do, it alters the amount of particles DISPlayed in viewport, but doesn't change the simulations. (With old particles it was possible to only calculate the disp amount of particles too as everything was always recalculated from scratch anyways, but now that particles are more complicated and cached etc. it's not an option anymore.)
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 998d0f7cf61..c4ad6faadc2 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -4026,7 +4026,7 @@ static void dynamics_step(Object *ob, ParticleSystem *psys, ParticleSystemModifi vg_size=psys_cache_vgroup(psmd->dm,psys,PSYS_VG_SIZE); for(p=0, pa=psys->particles; p<totpart; p++,pa++){ - if(pa->flag & (PARS_NO_DISP+PARS_UNEXIST)) continue; + if(pa->flag & PARS_UNEXIST) continue; /* set correct ipo timing */ if((part->flag&PART_ABS_TIME)==0 && part->ipo){ @@ -4095,7 +4095,7 @@ static void dynamics_step(Object *ob, ParticleSystem *psys, ParticleSystemModifi /* main loop: calculate physics for all particles */ for(p=0, pa=psys->particles, key=outstate; p<totpart; p++,pa++,key++){ - if(pa->flag & (PARS_NO_DISP|PARS_UNEXIST)) continue; + if(pa->flag & PARS_UNEXIST) continue; copy_particle_key(key,&pa->state,1); @@ -4260,6 +4260,16 @@ static void psys_update_path_cache(Object *ob, ParticleSystemModifierData *psmd, static void hair_step(Object *ob, ParticleSystemModifierData *psmd, ParticleSystem *psys, float cfra) { ParticleSettings *part = psys->part; + ParticleData *pa; + int p; + float disp = (float)get_current_display_percentage(psys)/50.0f-1.0f; + + for(p=0, pa=psys->particles; p<psys->totpart; p++,pa++){ + if(pa->r_rot[0] > disp) + pa->flag |= PARS_NO_DISP; + else + pa->flag &= ~PARS_NO_DISP; + } if(psys->recalc & PSYS_DISTR) /* need this for changing subsurf levels */ |