[Bf-blender-cvs] [500088d] master: Fix T39078: crash increasing hair emission number

Campbell Barton noreply at git.blender.org
Tue Mar 11 13:06:34 CET 2014


Commit: 500088d9e34439a936d8060e4b0026508d046879
Author: Campbell Barton
Date:   Tue Mar 11 23:04:59 2014 +1100
https://developer.blender.org/rB500088d9e34439a936d8060e4b0026508d046879

Fix T39078: crash increasing hair emission number

===================================================================

M	source/blender/blenkernel/intern/particle.c

===================================================================

diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 1088976..3a6e710 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -2397,6 +2397,11 @@ void psys_find_parents(ParticleSimulationData *sim)
 	if ((sim->psys->renderdata || G.is_rendering) && part->child_nbr && part->ren_child_nbr)
 		totparent *= (float)part->child_nbr / (float)part->ren_child_nbr;
 
+	/* hard limit, workaround for it being ignored above */
+	if (sim->psys->totpart < totparent) {
+		totparent = sim->psys->totpart;
+	}
+
 	tree = BLI_kdtree_new(totparent);
 
 	for (p = 0, cpa = sim->psys->child; p < totparent; p++, cpa++) {




More information about the Bf-blender-cvs mailing list