[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33588] trunk/blender/source/blender/ blenkernel/intern/particle_system.c: Bug fix: child particles weren' t always updated correctly

Janne Karhu jhkarh at gmail.com
Fri Dec 10 11:34:12 CET 2010


Revision: 33588
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33588
Author:   jhk
Date:     2010-12-10 11:34:12 +0100 (Fri, 10 Dec 2010)

Log Message:
-----------
Bug fix: child particles weren't always updated correctly
* Calling update_children(..) is very light if there's nothing to update, so it doesn't matter if it's called every time the particle system is updated.

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

Modified: trunk/blender/source/blender/blenkernel/intern/particle_system.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/particle_system.c	2010-12-10 08:29:46 UTC (rev 33587)
+++ trunk/blender/source/blender/blenkernel/intern/particle_system.c	2010-12-10 10:34:12 UTC (rev 33588)
@@ -3555,8 +3555,12 @@
 	if((sim->psys->part->type == PART_HAIR) && (sim->psys->flag & PSYS_HAIR_DONE)==0)
 	/* don't generate children while growing hair - waste of time */
 		psys_free_children(sim->psys);
-	else if(sim->psys->part->childtype && sim->psys->totchild != get_psys_tot_child(sim->scene, sim->psys))
-		distribute_particles(sim, PART_FROM_CHILD);
+	else if(sim->psys->part->childtype) {
+		if(sim->psys->totchild != get_psys_tot_child(sim->scene, sim->psys))
+			distribute_particles(sim, PART_FROM_CHILD);
+		else
+			; /* Children are up to date, nothing to do. */
+	}
 	else
 		psys_free_children(sim->psys);
 }
@@ -3876,8 +3880,7 @@
 			BKE_ptcache_write_cache(use_cache, framenr);
 	}
 
-	if(init)
-		update_children(sim);
+	update_children(sim);
 
 /* cleanup */
 	if(psys->lattice){





More information about the Bf-blender-cvs mailing list