Fix for [#19950] Object Particles and texture controlled density
authorJanne Karhu <jhkarh@gmail.com>
Fri, 3 Sep 2010 06:18:23 +0000 (06:18 +0000)
committerJanne Karhu <jhkarh@gmail.com>
Fri, 3 Sep 2010 06:18:23 +0000 (06:18 +0000)
* The hair strands that were cut based on the texture weren't properly checked for in the duplication code.

source/blender/blenkernel/intern/anim.c

index e27e3b2cd3f8c731caf8256e4ed988c5686be61f..4b9ffb1e3746b76cddbd12af40046263f562c3cd 100644 (file)
@@ -1285,6 +1285,12 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
                                size = psys_get_child_size(psys, cpa, ctime, 0);
                        }
 
+                       /* some hair paths might be non-existent so they can't be used for duplication */
+                       if(hair &&
+                               ((a < totpart && psys->pathcache[a]->steps < 0) ||
+                               (a >= totpart && psys->childcache[a-totpart]->steps < 0)))
+                               continue;
+
                        if(part->ren_as==PART_DRAW_GR) {
                                /* for groups, pick the object based on settings */
                                if(part->draw&PART_DRAW_RAND_GR)