diff options
Diffstat (limited to 'source/blender/blenkernel/intern/particle_system.c')
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 4e3840832bb..1423f520b95 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -3510,13 +3510,15 @@ static void do_hair_dynamics(ParticleSimulationData *sim) static void hair_step(ParticleSimulationData *sim, float cfra) { ParticleSystem *psys = sim->psys; -/* ParticleSettings *part = psys->part; */ + ParticleSettings *part = psys->part; PARTICLE_P; float disp = (float)psys_get_current_display_percentage(psys)/100.0f; - BLI_srandom(psys->seed); - LOOP_PARTICLES { + pa->size = part->size; + if(part->randsize > 0.0f) + pa->size *= 1.0f - part->randsize * PSYS_FRAND(p + 1); + if(PSYS_FRAND(p) > disp) pa->flag |= PARS_NO_DISP; else @@ -3670,7 +3672,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra) pa->size *= 1.0f - part->randsize * PSYS_FRAND(p + 1); birthtime = pa->time; - dietime = birthtime + pa->lifetime; + dietime = pa->dietime; /* store this, so we can do multiple loops over particles */ pa->state.time = dfra; @@ -3801,8 +3803,6 @@ static void cached_step(ParticleSimulationData *sim, float cfra) PARTICLE_P; float disp, dietime; - BLI_srandom(psys->seed); - psys_update_effectors(sim); disp= (float)psys_get_current_display_percentage(psys)/100.0f; @@ -3987,7 +3987,7 @@ static void system_step(ParticleSimulationData *sim, float cfra) BKE_ptcache_id_time(pid, sim->scene, 0.0f, &startframe, &endframe, NULL); /* clear everythin on start frame */ - if((int)cfra == startframe) { + if(cfra == startframe) { BKE_ptcache_id_reset(sim->scene, pid, PTCACHE_RESET_OUTDATED); BKE_ptcache_validate(cache, startframe); cache->flag &= ~PTCACHE_REDO_NEEDED; @@ -4054,7 +4054,6 @@ static void system_step(ParticleSimulationData *sim, float cfra) /* set particles to be not calculated TODO: can't work with pointcache */ disp= (float)psys_get_current_display_percentage(psys)/100.0f; - BLI_srandom(psys->seed); LOOP_PARTICLES { if(PSYS_FRAND(p) > disp) pa->flag |= PARS_NO_DISP; |