Revision: 35451
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35451
Author:   jhk
Date:     2011-03-10 12:36:11 +0000 (Thu, 10 Mar 2011)
Log Message:
-----------
Fix for [#26441] Child Hair Crash
* Silly mistakes in my last particle distribution code commit.

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    
2011-03-10 11:47:36 UTC (rev 35450)
+++ trunk/blender/source/blender/blenkernel/intern/particle_system.c    
2011-03-10 12:36:11 UTC (rev 35451)
@@ -411,13 +411,14 @@
 
 static void distribute_simple_children(Scene *scene, Object *ob, DerivedMesh 
*finaldm, ParticleSystem *psys)
 {
-       ChildParticle *cpa = psys->child;
+       ChildParticle *cpa = NULL;
        int i, p;
        int child_nbr= get_psys_child_number(scene, psys);
        int totpart= get_psys_tot_child(scene, psys);
 
        alloc_child_particles(psys, totpart);
 
+       cpa = psys->child;
        for(i=0; i<child_nbr; i++){
                for(p=0; p<psys->totpart; p++,cpa++){
                        float length=2.0;
@@ -1076,9 +1077,6 @@
                dm= finaldm;
                children=1;
 
-               totpart = get_psys_tot_child(scene, psys);
-               cfrom = from = PART_FROM_FACE;
-
                tree=BLI_kdtree_new(totpart);
 
                for(p=0,pa=psys->particles; p<totpart; p++,pa++){
@@ -1088,6 +1086,9 @@
                }
 
                BLI_kdtree_balance(tree);
+
+               totpart = get_psys_tot_child(scene, psys);
+               cfrom = from = PART_FROM_FACE;
        }
        else {
                distr = part->distr;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to