Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanne Karhu <jhkarh@gmail.com>2008-07-12 03:47:44 +0400
committerJanne Karhu <jhkarh@gmail.com>2008-07-12 03:47:44 +0400
commit1ffdc6679171c40ac1b2e5852ceaaa1495fbcd17 (patch)
tree6aebb7a940d0fc9f13318d737f6dbecd715e8ced
parentefb2639a26d2dbbc11e2edc3b17c34646eade902 (diff)
Fix for bug [#13479] Particle system "corrupts" when changing material colour and used in conjunction with softbodies
- changing particlesystem settings for hair particles cleared & recalculated everything even when hair softbody was baked
-rw-r--r--source/blender/blenkernel/intern/pointcache.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 57ecffbb796..43805959e62 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -459,9 +459,10 @@ int BKE_ptcache_object_reset(Object *ob, int mode)
PTCacheID pid;
ParticleSystem *psys;
ModifierData *md;
- int reset;
+ int reset, skip;
reset= 0;
+ skip= 0;
if(ob->soft) {
BKE_ptcache_id_from_softbody(&pid, ob, ob->soft);
@@ -469,11 +470,18 @@ int BKE_ptcache_object_reset(Object *ob, int mode)
}
for(psys=ob->particlesystem.first; psys; psys=psys->next) {
- BKE_ptcache_id_from_particles(&pid, ob, psys);
- reset |= BKE_ptcache_id_reset(&pid, mode);
-
+ /* Baked softbody hair has to be checked first, because we don't want to reset */
+ /* particles or softbody in that case -jahka */
if(psys->soft) {
BKE_ptcache_id_from_softbody(&pid, ob, psys->soft);
+ if(mode == PSYS_RESET_ALL || !(psys->part->type == PART_HAIR && (pid.cache->flag & PTCACHE_BAKED)))
+ reset |= BKE_ptcache_id_reset(&pid, mode);
+ else
+ skip = 1;
+ }
+
+ if(skip == 0) {
+ BKE_ptcache_id_from_particles(&pid, ob, psys);
reset |= BKE_ptcache_id_reset(&pid, mode);
}
}