diff options
author | Janne Karhu <jhkarh@gmail.com> | 2009-09-06 00:12:08 +0400 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2009-09-06 00:12:08 +0400 |
commit | 08b8fc34cfc082d73e657d1c2941662c36bc3514 (patch) | |
tree | 221eb2513a3830e8bd51e61ccbb44529afca5f58 /source/blender/blenkernel | |
parent | 05c44056dc48bf718475a1e98c9abbd6cc00a535 (diff) |
Disconnect/connect hair:
- Moves hair from face-space to global space and back.
- Allows for editing of emitter mesh after hair combing.
- Disconnect hair before doing topology changing changes in mesh edit mode, connect after changes.
- Notes:
* The closest location on emitter surface to the hair root is used to connect the hair.
* Emitter deflection, sticky roots and add brush don't apply for disconnect hair in particle mode.
- Todo for future:
* Copy disconnected hair from object to another (when 2.5 has proper copy operators again).
* Possible automatic disconnect/connect with topology changing operations in mesh edit mode.
Other changes/fixes:
- Proper subtypes for some particle mode notifiers.
- Particle mode selections didn't draw correctly because of using lighting for the paths.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_pointcache.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 2 |
3 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h index 9ba34091064..b7ab07b0f91 100644 --- a/source/blender/blenkernel/BKE_pointcache.h +++ b/source/blender/blenkernel/BKE_pointcache.h @@ -192,6 +192,7 @@ typedef struct PTCacheUndo { struct ParticleData *particles; struct KDTree *emitter_field; float *emitter_cosnos; + int psys_flag; /* cache stuff */ struct ListBase mem_cache; diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 81eb0b79c40..0ba2f357a1f 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -418,7 +418,7 @@ void psys_free_path_cache(ParticleSystem *psys, PTCacheEdit *edit) edit->pathcache= NULL; edit->totcached= 0; } - else { + if(psys) { psys_free_path_cache_buffers(psys->pathcache, &psys->pathcachebufs); psys->pathcache= NULL; psys->totcached= 0; @@ -2676,7 +2676,7 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra baked = psys->pointcache->flag & PTCACHE_BAKED; /* clear out old and create new empty path cache */ - psys_free_path_cache(psys, NULL); + psys_free_path_cache(psys, psys->edit); cache= psys->pathcache= psys_alloc_path_cache_buffers(&psys->pathcachebufs, totpart, steps+1); if(psys->soft && psys->softflag & OB_SB_ENABLE) { @@ -2891,7 +2891,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf if(!cache || edit->totpoint != edit->totcached) { /* clear out old and create new empty path cache */ - psys_free_path_cache(NULL, edit); + psys_free_path_cache(edit->psys, edit); cache= edit->pathcache= psys_alloc_path_cache_buffers(&edit->pathcachebufs, totpart, steps+1); } @@ -2946,7 +2946,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf do_particle_interpolation(psys, i, pa, t, frs_sec, &pind, &result); /* non-hair points are allready in global space */ - if(psys) + if(psys && !(psys->flag & PSYS_GLOBAL_HAIR)) Mat4MulVecfl(hairmat, result.co); VECCOPY(ca->co, result.co); diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index eb570ba287c..1931b89af38 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -158,7 +158,7 @@ void psys_reset(ParticleSystem *psys, int mode) psys->totchild= 0; /* reset path cache */ - psys_free_path_cache(psys, NULL); + psys_free_path_cache(psys, psys->edit); /* reset point cache */ psys->pointcache->flag &= ~PTCACHE_SIMULATION_VALID; |