diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-01-21 17:18:24 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-01-21 17:18:24 +0300 |
commit | 14241f8349e611c243ee4bdb9f2c56cbc32ba853 (patch) | |
tree | 22c2a7dfdb50b53de02df508fc75878965a6cf75 /source/blender/blenkernel | |
parent | 91e5b638c60e15ab3f3c651e7aa2241706315d75 (diff) |
Fixes:
- Particle system distribution wasn't flushed properly for non-edited hair.
- For instances in the renderer, also count their verts and faces in the stats.
- Fix for error in the "surface diffuse" formula for strand shading.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_particle.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 10 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 8 |
3 files changed, 16 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h index 399f67b7288..af5713b565d 100644 --- a/source/blender/blenkernel/BKE_particle.h +++ b/source/blender/blenkernel/BKE_particle.h @@ -213,6 +213,7 @@ void psys_free_path_cache(struct ParticleSystem *psys); void free_hair(struct ParticleSystem *psys); void free_keyed_keys(struct ParticleSystem *psys); void psys_free(struct Object * ob, struct ParticleSystem * psys); +void psys_free_children(struct ParticleSystem *psys); void psys_render_set(struct Object *ob, struct ParticleSystem *psys, float viewmat[][4], float winmat[][4], int winx, int winy); void psys_render_restore(struct Object *ob, struct ParticleSystem *psys); diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index bf8d1e9d8aa..9cfc7e9dafe 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -318,6 +318,16 @@ void psys_free_path_cache(ParticleSystem *psys) } free_child_path_cache(psys); } +void psys_free_children(ParticleSystem *psys) +{ + if(psys->child) { + MEM_freeN(psys->child); + psys->child=0; + psys->totchild=0; + } + + free_child_path_cache(psys); +} /* free everything */ void psys_free(Object *ob, ParticleSystem * psys) { diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 94cfdadbb16..88a75a50ce5 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -4468,9 +4468,11 @@ static void system_step(Object *ob, ParticleSystem *psys, ParticleSystemModifier distribute_particles(ob, psys, part->from); - if(!(psys->part->type == PART_HAIR) || (psys->flag & PSYS_HAIR_DONE)) - if(get_alloc_child_particles_tot(psys)) - distribute_particles(ob, psys, PART_FROM_CHILD); + if((psys->part->type == PART_HAIR) && !(psys->flag & PSYS_HAIR_DONE)) + /* don't generate children while growing hair - waste of time */ + psys_free_children(psys); + else if(get_alloc_child_particles_tot(psys)) + distribute_particles(ob, psys, PART_FROM_CHILD); } initialize_all_particles(ob, psys, psmd); |