[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15537] trunk/blender/source/blender/ blenkernel/intern/pointcache.c: Fix for bug [#13479] Particle system " corrupts" when changing material colour and used in conjunction with softbodies

Janne Karhu jhkarh at utu.fi
Sat Jul 12 01:47:45 CEST 2008


Revision: 15537
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15537
Author:   jhk
Date:     2008-07-12 01:47:44 +0200 (Sat, 12 Jul 2008)

Log Message:
-----------
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

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/pointcache.c

Modified: trunk/blender/source/blender/blenkernel/intern/pointcache.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/pointcache.c	2008-07-11 23:46:54 UTC (rev 15536)
+++ trunk/blender/source/blender/blenkernel/intern/pointcache.c	2008-07-11 23:47:44 UTC (rev 15537)
@@ -459,9 +459,10 @@
 	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 @@
 	}
 
 	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);
 		}
 	}





More information about the Bf-blender-cvs mailing list